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