完善文档

This commit is contained in:
flswld
2022-12-30 18:27:51 +08:00
parent 6fd3d6a349
commit 2bc157dd2d
22 changed files with 467 additions and 233 deletions

View File

@@ -295,7 +295,7 @@ func (k *KcpConnectManager) getPlayerToken(req *proto.GetPlayerTokenReq, session
}
oldSession := k.GetSessionByUserId(tokenVerifyRsp.PlayerID)
if oldSession != nil {
// 顶号
// 本地顶号
kickFinishNotifyChan := make(chan bool)
k.kcpEventInput <- &KcpEvent{
ConvId: oldSession.conn.GetConv(),
@@ -303,6 +303,18 @@ func (k *KcpConnectManager) getPlayerToken(req *proto.GetPlayerTokenReq, session
EventMessage: kickFinishNotifyChan,
}
<-kickFinishNotifyChan
} else {
// 远程全局顶号
connCtrlMsg := new(mq.ConnCtrlMsg)
connCtrlMsg.KickUserId = tokenVerifyRsp.PlayerID
connCtrlMsg.KickReason = kcp.EnetServerRelogin
k.messageQueue.SendToAll(&mq.NetMsg{
MsgType: mq.MsgTypeConnCtrl,
EventId: mq.KickPlayerNotify,
ConnCtrlMsg: connCtrlMsg,
})
// TODO 确保旧连接已下线 已通知GS已保存好数据
time.Sleep(time.Second)
}
// 关联玩家uid和连接信息
session.userId = tokenVerifyRsp.PlayerID