refactor(logic): 重构登录和地图相关逻辑
- 更新 Player 结构体,添加 Nick 字段 - 修改 ErrorCode 类型从 uint32 改为 int32 - 优化 SocketHandler 处理逻辑 - 重构 Controller 中的 Login 和地图相关方法 - 更新地图服务中的 MapIn 和 MapOut 方法 - 调整空间服务中的 Hot 和 Walk 方法
This commit is contained in:
20
logic/controller/map_list.go
Normal file
20
logic/controller/map_list.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"blazing/common/data/entity"
|
||||
"blazing/common/socket/errorcode"
|
||||
"blazing/logic/service/maps"
|
||||
)
|
||||
|
||||
func (h *Controller) MapList(data *maps.ListMapPlayerInboundInfo, c *entity.Player) (result *maps.ListMapPlayerOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
||||
|
||||
result = &maps.ListMapPlayerOutboundInfo{}
|
||||
result.Player = make([]maps.OutInfo, 0)
|
||||
result1 := maps.NewOutInfo()
|
||||
|
||||
result1.UserID = c.UserID
|
||||
//result.Pos = model.Pos{X: 500, Y: 400}
|
||||
result1.Nick = c.Nick
|
||||
result.Player = append(result.Player, *result1)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user