refactor(logic): 重构登录和地图相关逻辑
- 更新 Player 结构体,添加 Nick 字段 - 修改 ErrorCode 类型从 uint32 改为 int32 - 优化 SocketHandler 处理逻辑 - 重构 Controller 中的 Login 和地图相关方法 - 更新地图服务中的 MapIn 和 MapOut 方法 - 调整空间服务中的 Hot 和 Walk 方法
This commit is contained in:
@@ -210,17 +210,23 @@ func Recv(c *entity.Conn, data handler.TomeeHeader) {
|
||||
}
|
||||
|
||||
aa, ok := ret[1].Interface().(errorcode.ErrorCode) //判断错误
|
||||
data.Result = uint32(aa)
|
||||
if aa == -1 {
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
if ok && aa != 0 { //这里实现回复错误包
|
||||
|
||||
cool.Loger.Error(context.Background(), aa.Code())
|
||||
|
||||
data.Result = uint32(aa)
|
||||
c.SendPack(data.Pack(nil))
|
||||
return
|
||||
|
||||
}
|
||||
data.Result = 0 //默认成功
|
||||
|
||||
data.Version = "7"
|
||||
|
||||
c.SendPack(data.Pack(ret[0].Interface()))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user