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