mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-23 14:32:27 +08:00
修复异常在线数量错误
This commit is contained in:
@@ -150,6 +150,7 @@ func (k *KcpConnectManager) acceptHandle(listener *kcp.Listener) {
|
|||||||
}
|
}
|
||||||
conn.SetACKNoDelay(true)
|
conn.SetACKNoDelay(true)
|
||||||
conn.SetWriteDelay(false)
|
conn.SetWriteDelay(false)
|
||||||
|
atomic.AddInt32(&CLIENT_CONN_NUM, 1)
|
||||||
logger.Info("client connect, convId: %v", convId)
|
logger.Info("client connect, convId: %v", convId)
|
||||||
kcpRawSendChan := make(chan *ProtoMsg, 1000)
|
kcpRawSendChan := make(chan *ProtoMsg, 1000)
|
||||||
session := &Session{
|
session := &Session{
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ func (k *KcpConnectManager) getPlayerToken(req *proto.GetPlayerTokenReq, session
|
|||||||
// 封号通知
|
// 封号通知
|
||||||
return loginFailRsp(int32(proto.Retcode_RET_BLACK_UID), true, tokenVerifyRsp.ForbidEndTime)
|
return loginFailRsp(int32(proto.Retcode_RET_BLACK_UID), true, tokenVerifyRsp.ForbidEndTime)
|
||||||
}
|
}
|
||||||
clientConnNum := atomic.AddInt32(&CLIENT_CONN_NUM, 1)
|
clientConnNum := atomic.LoadInt32(&CLIENT_CONN_NUM)
|
||||||
if clientConnNum > MaxClientConnNumLimit {
|
if clientConnNum > MaxClientConnNumLimit {
|
||||||
logger.Error("gate conn num limit, uid: %v", uid)
|
logger.Error("gate conn num limit, uid: %v", uid)
|
||||||
return loginFailRsp(int32(proto.Retcode_RET_MAX_PLAYER), false, 0)
|
return loginFailRsp(int32(proto.Retcode_RET_MAX_PLAYER), false, 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user