refactor(logic): 优化登录和地图相关逻辑

- 登录逻辑中添加了默认用户信息
- 优化了地图进入和退出的广播逻辑
- 调整了数据结构和方法,提高了代码可读性和可维护性
This commit is contained in:
2025-08-16 00:23:43 +08:00
parent 5e277defb7
commit 4306ed586f
6 changed files with 44 additions and 6 deletions

View File

@@ -8,5 +8,6 @@ import (
func (h *Controller) MapOut(data *maps.LeaveMapInboundInfo, c *entity.Player) (result *maps.LeaveMapOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
result = &maps.LeaveMapOutboundInfo{UserID: c.GetUserID()}
data.Broadcast(c.MapId, maps.LeaveMapOutboundInfo{UserID: c.GetUserID()}) //同步广播
return
}