feat 稳定300人

This commit is contained in:
2025-12-17 09:54:24 +08:00
parent 4983638c19
commit 0274262591
16 changed files with 467 additions and 234 deletions

View File

@@ -30,11 +30,11 @@ func (g *GatewayWsServer) OnHandShake(conn socket.ISocketConn) {
if err != nil {
_ = conn.Close()
}
if oldClient := ws_handler.UserMgr.GetByUID(t); oldClient != nil {
if oldClient := ws_handler.UserMgr.GetByUID(int32(t)); oldClient != nil {
oldClient.CloseClient()
}
client := ws_handler.NewClient(t, conn)
ws_handler.UserMgr.Add(t, client)
client := ws_handler.NewClient(int32(t), conn)
ws_handler.UserMgr.Add(int32(t), client)
conn.SetParam("client", client)
}