package controller import ( "blazing/common/socket/errorcode" "blazing/logic/service/common" "blazing/logic/service/player" "blazing/modules/config/service" "github.com/samber/lo" ) // 进入超时空隧道 func (h Controller) TimeMap(data *C2s_SP, c *player.Player) (result *S2C_SP, err errorcode.ErrorCode) { result = &S2C_SP{} maps := service.NewMapService().GetTimeMap() result.MapList = make([]ServerInfo, len(maps)) for i, v := range maps { result.MapList[i].ID = v.MapID result.MapList[i].DropItemIds = v.DropItemIds pits := service.NewMapPitService().GetDataALL(v.MapID) for _, v := range pits { result.MapList[i].Pet = append(result.MapList[i].Pet, v.RefreshID...) } result.MapList[i].Pet = lo.Union(result.MapList[i].Pet) } return } // C2s_SP 定义请求或响应数据结构。 type C2s_SP struct { Head common.TomeeHeader `cmd:"60002" struc:"skip"` //超时空地图 } // OutInfo 表示地图热度的出站消息 type S2C_SP struct { MapListLen uint32 `struc:"sizeof=MapList"` MapList []ServerInfo } // ServerInfo 定义请求或响应数据结构。 type ServerInfo struct { ID uint32 //地图ID PetLen uint32 `struc:"sizeof=Pet"` Pet []uint32 //拥有的精灵 DropItemIdsLen uint32 `struc:"sizeof=DropItemIds"` DropItemIds []uint32 //掉落物 GameLen uint32 `struc:"sizeof=Game"` Game string }