feat 修改usn类型为string

This commit is contained in:
2026-01-11 16:16:16 +08:00
parent 5af027b35c
commit 9e1889b956
13 changed files with 34 additions and 36 deletions

View File

@@ -44,7 +44,7 @@ func (g *GatewayWsServer) OnHandShake(conn socket.ISocketConn) socket.Action {
func (g *GatewayWsServer) OnMessage(conn socket.ISocketConn, bytes []byte) socket.Action {
cli, ok := conn.GetParam("client").(*client.Client)
if !ok || cli.USN == 0 || cli.Status != 1 {
if !ok || cli.USN == "" || cli.Status != 1 {
return socket.Close
}
cli.OnEvent(&client.ClientEvent{Msg: bytes})
@@ -53,7 +53,7 @@ func (g *GatewayWsServer) OnMessage(conn socket.ISocketConn, bytes []byte) socke
func (g *GatewayWsServer) OnPong(conn socket.ISocketConn) {
cli, ok := conn.GetParam("client").(*client.Client)
if !ok || cli.USN == 0 {
if !ok || cli.USN == "" {
return
}
cli.OnEvent(&client.PongEvent{})