feat(controller): 增强命令注册逻辑并修复试炼塔关卡限制 - 在命令注册时检查重复方法,如果存在则panic提示错误 - 移除CurrentFreshStage和CurrentStage的默认值设置逻辑 - 添加关卡等级验证,确保用户不能挑战超过最大关卡数的关卡 - 修复试炼之塔和勇者之塔的关卡计算逻辑 fix(item): 修复道具
This commit is contained in:
51
logic/controller/action_超时空隧道.go
Normal file
51
logic/controller/action_超时空隧道.go
Normal file
@@ -0,0 +1,51 @@
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
type C2s_SP struct {
|
||||
Head common.TomeeHeader `cmd:"60002" struc:"skip"` //超时空地图
|
||||
}
|
||||
|
||||
// OutInfo 表示地图热度的出站消息
|
||||
type S2C_SP struct {
|
||||
MapListLen uint32 `struc:"sizeof=MapList"`
|
||||
MapList []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
|
||||
}
|
||||
Reference in New Issue
Block a user