上传wocket 清理代码
This commit is contained in:
parent
b0d5a9b892
commit
5b74551605
@ -70,6 +70,7 @@ locp:
|
|||||||
go this.Close()
|
go this.Close()
|
||||||
break locp
|
break locp
|
||||||
}
|
}
|
||||||
|
this.wsConn.SetReadDeadline(time.Now().Add(time.Second * 30))
|
||||||
if err = proto.Unmarshal(data, msg); err != nil {
|
if err = proto.Unmarshal(data, msg); err != nil {
|
||||||
this.gateway.Errorf("agent:%s uId:%s Unmarshal err:%v", this.sessionId, this.uId, err)
|
this.gateway.Errorf("agent:%s uId:%s Unmarshal err:%v", this.sessionId, this.uId, err)
|
||||||
go this.Close()
|
go this.Close()
|
||||||
@ -177,9 +178,14 @@ func (this *Agent) decodeUserData(msg *pb.UserMessage) (code pb.ErrorCode, err e
|
|||||||
}
|
}
|
||||||
msg.Data = ad
|
msg.Data = ad
|
||||||
} else {
|
} else {
|
||||||
if msg.MainType != string(comm.ModuleNotify) && this.UserId() == "" {
|
switch msg.MainType {
|
||||||
this.gateway.Errorf("[%v.%v] Agent UId empty", msg.MainType, msg.SubType)
|
case string(comm.ModuleNotify), string(comm.ModuleGate):
|
||||||
return pb.ErrorCode_AgentUidEmpty, fmt.Errorf("no login")
|
return pb.ErrorCode_Success, nil
|
||||||
|
default:
|
||||||
|
if this.UserId() == "" {
|
||||||
|
this.gateway.Errorf("[%v.%v] Agent UId empty", msg.MainType, msg.SubType)
|
||||||
|
return pb.ErrorCode_AgentUidEmpty, fmt.Errorf("no login")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pb.ErrorCode_Success, nil
|
return pb.ErrorCode_Success, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user