玩家管理模块接入redis,已完整实现好友、多人世界的跨服交互功能

This commit is contained in:
flswld
2022-12-29 22:42:57 +08:00
parent 0a2e13fad3
commit 6fd3d6a349
25 changed files with 1094 additions and 407 deletions

View File

@@ -361,14 +361,14 @@ func (k *KcpConnectManager) closeKcpConn(session *Session, enetType uint32) {
EventId: KcpConnCloseNotify,
}
// 通知GS玩家下线
gameMsg := new(mq.GameMsg)
gameMsg.UserId = session.userId
connCtrlMsg := new(mq.ConnCtrlMsg)
connCtrlMsg.UserId = session.userId
k.messageQueue.SendToGs(session.gsServerAppId, &mq.NetMsg{
MsgType: mq.MsgTypeGame,
EventId: mq.UserOfflineNotify,
GameMsg: gameMsg,
MsgType: mq.MsgTypeConnCtrl,
EventId: mq.UserOfflineNotify,
ConnCtrlMsg: connCtrlMsg,
})
logger.Info("send to gs user offline, ConvId: %v, UserId: %v", convId, gameMsg.UserId)
logger.Info("send to gs user offline, ConvId: %v, UserId: %v", convId, connCtrlMsg.UserId)
k.destroySessionChan <- session
}