refactor(logic): 重构登录和地图相关逻辑
- 更新 Player 结构体,添加 Nick 字段 - 修改 ErrorCode 类型从 uint32 改为 int32 - 优化 SocketHandler 处理逻辑 - 重构 Controller 中的 Login 和地图相关方法 - 更新地图服务中的 MapIn 和 MapOut 方法 - 调整空间服务中的 Hot 和 Walk 方法
This commit is contained in:
@@ -58,7 +58,7 @@ func (h *TomeeHandler) Handle(c gnet.Conn, data []byte) { //处理接收到的
|
||||
header.Result, _ = tempdata.ReadUInt32()
|
||||
header.Data = tempdata.BytesAvailable()
|
||||
//fmt.Println("接收封包", header)
|
||||
h.Callback( entity.NewConn(c), header)
|
||||
h.Callback(entity.NewConn(c), header)
|
||||
//return header
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ func (h *TomeeHandler) Handle(c gnet.Conn, data []byte) { //处理接收到的
|
||||
// 结构体类型使用struc库进行序列化。
|
||||
// 最后,将数据长度、版本号、命令码、用户ID和结果代码一并打包进返回的字节切片中。
|
||||
func (h *TomeeHeader) Pack(data any) []byte { //组包
|
||||
//h.Result = 0//默认置0
|
||||
|
||||
//t := reflect.TypeOf(data)
|
||||
tv := reflect.ValueOf(data)
|
||||
|
||||
Reference in New Issue
Block a user