feat 修改usn类型为string
This commit is contained in:
@@ -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{})
|
||||
|
||||
Reference in New Issue
Block a user