娃娃机

This commit is contained in:
by 2024-08-14 13:43:42 +08:00
parent d2a8b0e618
commit b9191e0538
1 changed files with 6 additions and 6 deletions

View File

@ -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)
}