feat(service): 更新地图与战斗信息服务结构及逻辑

- 移除 MapLeave 中对 player.Canmon 的重复设置
- 在 MapList 中增加对 TimeBoss 状态的处理并
This commit is contained in:
2025-12-09 16:52:53 +08:00
parent f6a305de77
commit 1ea4b756f6
6 changed files with 250 additions and 6 deletions

View File

@@ -38,7 +38,6 @@ func (h Controller) MapHot(data *maphot.InInfo, c *player.Player) (result *mapho
}
func (h *Controller) MapLeave(data *maps.LeaveMapInboundInfo, c *player.Player) (result *info.LeaveMapOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
atomic.StoreUint32(&c.Canmon, 0)
//data.Broadcast(c.Info.MapID, info.LeaveMapOutboundInfo{UserID: c.Info.UserID}) //同步广播
result = &info.LeaveMapOutboundInfo{
UserID: c.Info.UserID,
@@ -52,6 +51,10 @@ func (h *Controller) MapLeave(data *maps.LeaveMapInboundInfo, c *player.Player)
}
func (h *Controller) MapList(data *maps.ListMapPlayerInboundInfo, c *player.Player) (result *info.ListMapPlayerOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
atomic.StoreUint32(&c.Canmon, 2)
atomic.StoreUint32(&c.Canmon, 0)
if atomic.LoadUint32(&c.GetSpace().TimeBoss.Flag) == 1 {
defer c.SendPackCmd(2022, &c.GetSpace().TimeBoss)
}
result = &info.ListMapPlayerOutboundInfo{
Player: c.GetSpace().GetInfo(),
}