娃娃机
This commit is contained in:
parent
d2a8b0e618
commit
b9191e0538
|
|
@ -96,7 +96,7 @@ func (this *MachineManager) Update() {
|
||||||
delConn = append(delConn, v)
|
delConn = append(delConn, v)
|
||||||
v.Close()
|
v.Close()
|
||||||
logger.Logger.Tracef("断开连接:%v", v.Addr)
|
logger.Logger.Tracef("断开连接:%v", v.Addr)
|
||||||
this.UpdateToGameServer(int32(v.Id), 0, v.Addr)
|
this.UpdateToGameServer(v, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -126,7 +126,7 @@ func (this *MachineManager) Update() {
|
||||||
for _, v := range delIds {
|
for _, v := range delIds {
|
||||||
this.ConnMap[v.Id] = v
|
this.ConnMap[v.Id] = v
|
||||||
delete(this.DelConnMap, v.Id)
|
delete(this.DelConnMap, v.Id)
|
||||||
this.UpdateToGameServer(int32(v.Id), 1, v.Addr)
|
this.UpdateToGameServer(v, 1)
|
||||||
}
|
}
|
||||||
})).StartByFixExecutor(this.ModuleName())
|
})).StartByFixExecutor(this.ModuleName())
|
||||||
})).StartByFixExecutor(this.ModuleName())
|
})).StartByFixExecutor(this.ModuleName())
|
||||||
|
|
@ -135,17 +135,17 @@ func (this *MachineManager) Update() {
|
||||||
func (this *MachineManager) Shutdown() {
|
func (this *MachineManager) Shutdown() {
|
||||||
for _, v := range this.ConnMap {
|
for _, v := range this.ConnMap {
|
||||||
v.Close()
|
v.Close()
|
||||||
this.UpdateToGameServer(int32(v.Id), 0, v.Addr)
|
this.UpdateToGameServer(v, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
module.UnregisteModule(this)
|
module.UnregisteModule(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *MachineManager) UpdateToGameServer(id int32, status int32, VideoAddr string) {
|
func (this *MachineManager) UpdateToGameServer(conn *Conn, status int32) {
|
||||||
msg := &machine.MSUpdateDollMachineStatus{}
|
msg := &machine.MSUpdateDollMachineStatus{}
|
||||||
msg.Id = id
|
msg.Id = int32(conn.Id)
|
||||||
msg.Status = status
|
msg.Status = status
|
||||||
msg.VideoAddr = VideoAddr
|
msg.VideoAddr = conn.Addr
|
||||||
SendToGameServer(int(machine.DollMachinePacketID_PACKET_MSUpdateDollMachineStatus), msg)
|
SendToGameServer(int(machine.DollMachinePacketID_PACKET_MSUpdateDollMachineStatus), msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue