mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
1.离线玩家数据加分布式锁操作
2.修复聊天记录错乱 3.修复重启服务器后无法登录
This commit is contained in:
@@ -263,10 +263,18 @@ func (g *GameManager) Close() {
|
||||
Msg: saveUserIdList,
|
||||
}
|
||||
<-EXIT_SAVE_FIN_CHAN
|
||||
// 单纯的告诉网关下线玩家
|
||||
// 告诉网关下线玩家并全服广播玩家离线
|
||||
userList := USER_MANAGER.GetAllOnlineUserList()
|
||||
for _, player := range userList {
|
||||
g.KickPlayer(player.PlayerID, kcp.EnetServerShutdown)
|
||||
MESSAGE_QUEUE.SendToAll(&mq.NetMsg{
|
||||
MsgType: mq.MsgTypeServer,
|
||||
EventId: mq.ServerUserOnlineStateChangeNotify,
|
||||
ServerMsg: &mq.ServerMsg{
|
||||
UserId: player.PlayerID,
|
||||
IsOnline: false,
|
||||
},
|
||||
})
|
||||
}
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user