From b9191e05380e3c838033cbeb558de57761e1015a Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Wed, 14 Aug 2024 13:43:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- machine/machinedoll/machinemgr.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/machine/machinedoll/machinemgr.go b/machine/machinedoll/machinemgr.go index cc40046..3c6827d 100644 --- a/machine/machinedoll/machinemgr.go +++ b/machine/machinedoll/machinemgr.go @@ -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) }