mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
修复网关本地顶登录问题
This commit is contained in:
+18
-9
@@ -398,15 +398,24 @@ func (k *KcpConnectManager) getPlayerToken(req *proto.GetPlayerTokenReq, session
|
|||||||
return nil
|
return nil
|
||||||
case <-regFinishNotifyChan:
|
case <-regFinishNotifyChan:
|
||||||
}
|
}
|
||||||
// 顶号
|
oldSession := k.GetSessionByUserId(uid)
|
||||||
connCtrlMsg := new(mq.ConnCtrlMsg)
|
if oldSession != nil {
|
||||||
connCtrlMsg.KickUserId = uid
|
// 本地顶号
|
||||||
connCtrlMsg.KickReason = kcp.EnetServerRelogin
|
k.kcpEventInput <- &KcpEvent{
|
||||||
k.messageQueue.SendToAll(&mq.NetMsg{
|
ConvId: oldSession.conn.GetConv(),
|
||||||
MsgType: mq.MsgTypeConnCtrl,
|
EventId: KcpConnRelogin,
|
||||||
EventId: mq.KickPlayerNotify,
|
}
|
||||||
ConnCtrlMsg: connCtrlMsg,
|
} else {
|
||||||
})
|
// 远程顶号
|
||||||
|
connCtrlMsg := new(mq.ConnCtrlMsg)
|
||||||
|
connCtrlMsg.KickUserId = uid
|
||||||
|
connCtrlMsg.KickReason = kcp.EnetServerRelogin
|
||||||
|
k.messageQueue.SendToAll(&mq.NetMsg{
|
||||||
|
MsgType: mq.MsgTypeConnCtrl,
|
||||||
|
EventId: mq.KickPlayerNotify,
|
||||||
|
ConnCtrlMsg: connCtrlMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
// 顶号等待
|
// 顶号等待
|
||||||
logger.Info("run global interrupt login kick wait, uid: %v", uid)
|
logger.Info("run global interrupt login kick wait, uid: %v", uid)
|
||||||
timer = time.NewTimer(time.Second * 10)
|
timer = time.NewTimer(time.Second * 10)
|
||||||
|
|||||||
Reference in New Issue
Block a user