更新说明
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
xinian
2026-04-05 23:13:06 +08:00
committed by cnb
parent 24b463f0aa
commit d83cf365ac
39 changed files with 307 additions and 111 deletions

View File

@@ -18,6 +18,7 @@ import (
"github.com/lunixbochs/struc"
)
// Maincontroller 是控制器层共享变量。
var Maincontroller = &Controller{} //注入service
// Controller 分发cmd逻辑实现

View File

@@ -43,6 +43,7 @@ var masterCupRequiredItems = map[uint32][]ItemS{
},
}
// DASHIbei 处理控制器请求。
func (h Controller) DASHIbei(req *C2s_MASTER_REWARDS, c *player.Player) (result *S2C_MASTER_REWARDS, err errorcode.ErrorCode) {
_ = req
result = &S2C_MASTER_REWARDS{}
@@ -52,6 +53,7 @@ func (h Controller) DASHIbei(req *C2s_MASTER_REWARDS, c *player.Player) (result
return
}
// DASHIbeiR 处理控制器请求。
func (h Controller) DASHIbeiR(req *C2s_MASTER_REWARDSR, c *player.Player) (result *S2C_MASTER_REWARDSR, err errorcode.ErrorCode) {
result = &S2C_MASTER_REWARDSR{}
@@ -94,6 +96,7 @@ func (h Controller) DASHIbeiR(req *C2s_MASTER_REWARDSR, c *player.Player) (resul
return
}
// ItemS 定义请求或响应数据结构。
type ItemS struct {
ItemId uint32
ItemCnt uint32
@@ -137,6 +140,7 @@ func appendMasterCupRewardItems(c *player.Player, result *S2C_MASTER_REWARDSR, i
}
}
// C2s_MASTER_REWARDS 定义请求或响应数据结构。
type C2s_MASTER_REWARDS struct {
Head common.TomeeHeader `cmd:"2611" struc:"skip"` //玩家登录
}
@@ -147,6 +151,7 @@ type S2C_MASTER_REWARDS struct {
Reward []uint32 `json:"Reward"`
}
// C2s_MASTER_REWARDSR 定义请求或响应数据结构。
type C2s_MASTER_REWARDSR struct {
Head common.TomeeHeader `cmd:"2612" struc:"skip"` //玩家登录
ElementType uint32

View File

@@ -12,6 +12,7 @@ import (
"github.com/gogf/gf/v2/util/grand"
)
// EggGamePlay 处理控制器请求。
func (h Controller) EggGamePlay(data1 *C2S_EGG_GAME_PLAY, c *player.Player) (result *S2C_EGG_GAME_PLAY, err errorcode.ErrorCode) {
switch data1.EggNum {

View File

@@ -37,6 +37,7 @@ func Draw15To10WithBitSet() uint32 {
return resultBits
}
// GET_XUANCAI 处理控制器请求。
func (h Controller) GET_XUANCAI(data *C2s_GET_XUANCAI, c *player.Player) (result *S2C_GET_XUANCAI, err errorcode.ErrorCode) {
result = &S2C_GET_XUANCAI{}
selectedCount := 0 // 已选中的数量
@@ -74,6 +75,7 @@ func (h Controller) GET_XUANCAI(data *C2s_GET_XUANCAI, c *player.Player) (result
}
// C2s_GET_XUANCAI 定义请求或响应数据结构。
type C2s_GET_XUANCAI struct {
Head common.TomeeHeader `cmd:"60001" struc:"skip"` //玩家登录
}

View File

@@ -30,6 +30,7 @@ func (h Controller) TimeMap(data *C2s_SP, c *player.Player) (result *S2C_SP, err
}
// C2s_SP 定义请求或响应数据结构。
type C2s_SP struct {
Head common.TomeeHeader `cmd:"60002" struc:"skip"` //超时空地图
}
@@ -40,6 +41,7 @@ type S2C_SP struct {
MapList []ServerInfo
}
// ServerInfo 定义请求或响应数据结构。
type ServerInfo struct {
ID uint32 //地图ID
PetLen uint32 `struc:"sizeof=Pet"`

View File

@@ -7,6 +7,7 @@ import (
"blazing/logic/service/player"
)
// GetLeiyiTrainStatus 处理控制器请求。
func (h Controller) GetLeiyiTrainStatus(data *C2s_LEIYI_TRAIN_GET_STATUS, c *player.Player) (result *S2C_LEIYI_TRAIN_GET_STATUS, err errorcode.ErrorCode) {
result = &S2C_LEIYI_TRAIN_GET_STATUS{}
@@ -19,6 +20,7 @@ func (h Controller) GetLeiyiTrainStatus(data *C2s_LEIYI_TRAIN_GET_STATUS, c *pla
}
// C2s_LEIYI_TRAIN_GET_STATUS 定义请求或响应数据结构。
type C2s_LEIYI_TRAIN_GET_STATUS struct {
Head common.TomeeHeader `cmd:"2393" struc:"skip"` //玩家登录
}
@@ -28,6 +30,7 @@ type S2C_LEIYI_TRAIN_GET_STATUS struct {
Status [10]S2C_LEIYI_TRAIN_GET_STATUS_info `json:"status"`
}
// S2C_LEIYI_TRAIN_GET_STATUS_info 定义请求或响应数据结构。
type S2C_LEIYI_TRAIN_GET_STATUS_info struct {
// Today uint32 // 今日训练HP次数
Current uint32 // 当前训练HP次数

View File

@@ -35,6 +35,7 @@ func (h Controller) HanLiuQiang(data *C2S_2608, c *player.Player) (result *fight
return result, -1
}
// C2S_2608 定义请求或响应数据结构。
type C2S_2608 struct {
Head common.TomeeHeader `cmd:"2608" struc:"skip"`
}

View File

@@ -70,9 +70,12 @@ func (h Controller) PetMelee(data *StartPetWarInboundInfo, c *player.Player) (re
return
}
// PetKing 处理控制器请求。
func (h Controller) PetKing(data *PetKingJoinInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
c.Fightinfo.Status = info.BattleMode.PET_TOPLEVEL
// ElementTypeNumbers 是控制器层共享变量。
var ElementTypeNumbers = []int{1, 2, 3, 5, 11, 4, 6, 7, 9}
switch data.Type {

View File

@@ -82,6 +82,7 @@ func (h Controller) FreshChoiceFightLevel(data *C2S_FRESH_CHOICE_FIGHT_LEVEL, c
return result, 0
}
// FreshLeaveFightLevel 处理控制器请求。
func (h Controller) FreshLeaveFightLevel(data *FRESH_LEAVE_FIGHT_LEVEL, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
_ = data
defer c.GetSpace().EnterMap(c)
@@ -92,6 +93,7 @@ func (h Controller) FreshLeaveFightLevel(data *FRESH_LEAVE_FIGHT_LEVEL, c *playe
return result, 0
}
// PetTawor 处理控制器请求。
func (h Controller) PetTawor(data *StartTwarInboundInfo, c *player.Player) (result *fight.S2C_ChoiceLevelRequestInfo, err errorcode.ErrorCode) {
if err = c.CanFight(); err != 0 {
return nil, err

View File

@@ -15,6 +15,7 @@ type PetTOPLEVELnboundInfo struct {
}
// JoINtop 处理控制器请求。
func (h Controller) JoINtop(data *PetTOPLEVELnboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
err = pvp.JoinPeakQueue(c, data.Mode)
if err != 0 {
@@ -23,11 +24,13 @@ func (h Controller) JoINtop(data *PetTOPLEVELnboundInfo, c *player.Player) (resu
return nil, -1
}
// CancelPeakQueue 处理控制器请求。
func (h Controller) CancelPeakQueue(data *PeakQueueCancelInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
pvp.CancelPeakQueue(c)
return nil, -1
}
// SubmitPeakBanPick 处理控制器请求。
func (h Controller) SubmitPeakBanPick(data *PeakBanPickSubmitInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
err = pvp.SubmitBanPick(c, data.SelectedCatchTimes, data.BanCatchTimes)
if err != 0 {

View File

@@ -12,6 +12,7 @@ import (
"blazing/logic/service/space"
)
// ARENA_SET_OWENR 定义请求或响应数据结构。
type ARENA_SET_OWENR struct {
Head common.TomeeHeader `cmd:"2417" struc:"skip"`
}
@@ -35,6 +36,7 @@ func (h Controller) ArenaSetOwner(data *ARENA_SET_OWENR, c *player.Player) (resu
return nil, errorcode.ErrorCodes.ErrChampionExists
}
// ARENA_FIGHT_OWENR 定义请求或响应数据结构。
type ARENA_FIGHT_OWENR struct {
Head common.TomeeHeader `cmd:"2418" struc:"skip"`
}

View File

@@ -2,56 +2,66 @@ package controller
import "blazing/logic/service/common"
// FightNpcMonsterInboundInfo 定义请求或响应数据结构。
type FightNpcMonsterInboundInfo struct {
Head common.TomeeHeader `cmd:"2408" struc:"skip"`
Number uint32 `fieldDesc:"地图刷新怪物结构体对应的序号 1 - 9 的位置序号" `
}
// ChallengeBossInboundInfo 定义请求或响应数据结构。
type ChallengeBossInboundInfo struct {
Head common.TomeeHeader `cmd:"2411" struc:"skip"`
BossId uint32 `json:"bossId"`
}
// ReadyToFightInboundInfo 定义请求或响应数据结构。
type ReadyToFightInboundInfo struct {
Head common.TomeeHeader `cmd:"2404" struc:"skip"`
}
// EscapeFightInboundInfo 定义请求或响应数据结构。
type EscapeFightInboundInfo struct {
Head common.TomeeHeader `cmd:"2410" struc:"skip"`
}
// StartPetWarInboundInfo 定义请求或响应数据结构。
type StartPetWarInboundInfo struct {
Head common.TomeeHeader `cmd:"2431" struc:"skip"`
}
// StartTwarInboundInfo 定义请求或响应数据结构。
type StartTwarInboundInfo struct {
Head common.TomeeHeader `cmd:"2429|2415|2425" struc:"skip"`
}
// ARENA_GET_INFO 定义请求或响应数据结构。
type ARENA_GET_INFO struct {
Head common.TomeeHeader `cmd:"2419" struc:"skip"`
}
// ARENA_UPFIGHT 定义请求或响应数据结构。
type ARENA_UPFIGHT struct {
Head common.TomeeHeader `cmd:"2420" struc:"skip"`
}
// ARENA_OWENR_ACCE 定义请求或响应数据结构。
type ARENA_OWENR_ACCE struct {
Head common.TomeeHeader `cmd:"2422" struc:"skip"`
}
// PetKingJoinInboundInfo 定义请求或响应数据结构。
type PetKingJoinInboundInfo struct {
Head common.TomeeHeader `cmd:"2413" struc:"skip"`
Type uint32
FightType uint32
}
// PeakQueueCancelInboundInfo 定义请求或响应数据结构。
type PeakQueueCancelInboundInfo struct {
Head common.TomeeHeader `cmd:"2459" struc:"skip"`
}
// PeakBanPickSubmitInboundInfo 定义请求或响应数据结构。
type PeakBanPickSubmitInboundInfo struct {
Head common.TomeeHeader `cmd:"2460" struc:"skip"`
@@ -62,6 +72,7 @@ type PeakBanPickSubmitInboundInfo struct {
BanCatchTimes []uint32 `json:"banCatchTimes"`
}
// HandleFightInviteInboundInfo 定义请求或响应数据结构。
type HandleFightInviteInboundInfo struct {
Head common.TomeeHeader `cmd:"2403" struc:"skip"`
UserID uint32 `json:"userId" codec:"userId,uint"`
@@ -69,21 +80,25 @@ type HandleFightInviteInboundInfo struct {
Mode uint32 `json:"mode" codec:"mode,uint"`
}
// InviteToFightInboundInfo 定义请求或响应数据结构。
type InviteToFightInboundInfo struct {
Head common.TomeeHeader `cmd:"2401" struc:"skip"`
UserID uint32
Mode uint32
}
// InviteFightCancelInboundInfo 定义请求或响应数据结构。
type InviteFightCancelInboundInfo struct {
Head common.TomeeHeader `cmd:"2402" struc:"skip"`
}
// UseSkillInInfo 定义请求或响应数据结构。
type UseSkillInInfo struct {
Head common.TomeeHeader `cmd:"2405" struc:"skip"`
SkillId uint32
}
// UseSkillAtInboundInfo 定义请求或响应数据结构。
type UseSkillAtInboundInfo struct {
Head common.TomeeHeader `cmd:"7505" struc:"skip"`
SkillId uint32 `json:"skillId"`
@@ -93,21 +108,25 @@ type UseSkillAtInboundInfo struct {
AtkType uint8 `json:"atkType"`
}
// ChangePetInboundInfo 定义请求或响应数据结构。
type ChangePetInboundInfo struct {
Head common.TomeeHeader `cmd:"2407" struc:"skip"`
CatchTime uint32 `json:"catchTime"`
}
// CatchMonsterInboundInfo 定义请求或响应数据结构。
type CatchMonsterInboundInfo struct {
Head common.TomeeHeader `cmd:"2409" struc:"skip"`
CapsuleId uint32 `json:"capsuleId" fieldDescription:"胶囊id" uint:"true"`
}
// LoadPercentInboundInfo 定义请求或响应数据结构。
type LoadPercentInboundInfo struct {
Head common.TomeeHeader `cmd:"2441" struc:"skip"`
Percent uint32 `fieldDescription:"加载百分比"`
}
// UsePetItemInboundInfo 定义请求或响应数据结构。
type UsePetItemInboundInfo struct {
Head common.TomeeHeader `cmd:"2406" struc:"skip"`
CatchTime uint32 `description:"精灵捕获时间" codec:"catchTime"`
@@ -115,6 +134,7 @@ type UsePetItemInboundInfo struct {
Reversed1 uint32 `description:"填充字段 0" codec:"reversed1"`
}
// ChatInfo 定义请求或响应数据结构。
type ChatInfo struct {
Head common.TomeeHeader `cmd:"50002" struc:"skip"`
Reserve uint32 `json:"reserve" fieldDescription:"填充 默认值为0" uint:"true"`
@@ -122,16 +142,19 @@ type ChatInfo struct {
Message string `json:"message" fieldDescription:"消息内容, 结束符为utf-8的数字0"`
}
// C2S_FRESH_CHOICE_FIGHT_LEVEL 定义请求或响应数据结构。
type C2S_FRESH_CHOICE_FIGHT_LEVEL struct {
Head common.TomeeHeader `cmd:"2428|2414" struc:"skip"`
Level uint `json:"level"`
}
// C2S_OPEN_DARKPORTAL 定义请求或响应数据结构。
type C2S_OPEN_DARKPORTAL struct {
Head common.TomeeHeader `cmd:"2424" struc:"skip"`
Level uint32 `json:"level"`
}
// FRESH_LEAVE_FIGHT_LEVEL 定义请求或响应数据结构。
type FRESH_LEAVE_FIGHT_LEVEL struct {
Head common.TomeeHeader `cmd:"2430|2416|2426" struc:"skip"`
}

View File

@@ -2,50 +2,59 @@ package controller
import "blazing/logic/service/common"
// SeeOnlineInboundInfo 定义请求或响应数据结构。
type SeeOnlineInboundInfo struct {
Head common.TomeeHeader `cmd:"2157" struc:"skip"`
UserIdsLen uint32 `json:"userIdsLen" struc:"sizeof=UserIds"`
UserIds []uint32 `json:"userIds" `
}
// FriendAddInboundInfo 定义请求或响应数据结构。
type FriendAddInboundInfo struct {
Head common.TomeeHeader `cmd:"2151" struc:"skip"`
UserID uint32 `json:"userID"`
}
// FriendAnswerInboundInfo 定义请求或响应数据结构。
type FriendAnswerInboundInfo struct {
Head common.TomeeHeader `cmd:"2152" struc:"skip"`
UserID uint32 `json:"userID"`
Flag uint32 `json:"flag"`
}
// FriendRemoveInboundInfo 定义请求或响应数据结构。
type FriendRemoveInboundInfo struct {
Head common.TomeeHeader `cmd:"2153" struc:"skip"`
UserID uint32 `json:"userID"`
}
// AcceptTaskInboundInfo 定义请求或响应数据结构。
type AcceptTaskInboundInfo struct {
Head common.TomeeHeader `cmd:"2201|2231" struc:"skip"`
TaskId uint32 `json:"taskId" description:"任务ID"`
}
// AddTaskBufInboundInfo 定义请求或响应数据结构。
type AddTaskBufInboundInfo struct {
Head common.TomeeHeader `cmd:"2204|2235" struc:"skip"`
TaskId uint32 `json:"taskId" description:"任务ID"`
TaskList []uint32 `struc:"[20]byte"`
}
// CompleteTaskInboundInfo 定义请求或响应数据结构。
type CompleteTaskInboundInfo struct {
Head common.TomeeHeader `cmd:"2202|2233" struc:"skip"`
TaskId uint32 `json:"taskId" description:"任务ID"`
OutState uint32 `json:"outState" `
}
// GetTaskBufInboundInfo 定义请求或响应数据结构。
type GetTaskBufInboundInfo struct {
Head common.TomeeHeader `cmd:"2203|2234" struc:"skip"`
TaskId uint32 `json:"taskId" description:"任务ID"`
}
// DeleteTaskInboundInfo 定义请求或响应数据结构。
type DeleteTaskInboundInfo struct {
Head common.TomeeHeader `cmd:"2205|2232" struc:"skip"`
TaskId uint32 `json:"taskId" description:"任务ID"`

View File

@@ -2,18 +2,21 @@ package controller
import "blazing/logic/service/common"
// BuyInboundInfo 定义请求或响应数据结构。
type BuyInboundInfo struct {
Head common.TomeeHeader `cmd:"2601" struc:"skip"`
ItemId int64 `struc:"uint32"`
Count int64 `struc:"uint32"`
}
// BuyMultiInboundInfo 定义请求或响应数据结构。
type BuyMultiInboundInfo struct {
Head common.TomeeHeader `cmd:"2606" struc:"skip"`
ItemListLen uint32 `struc:"sizeof=ItemIds"`
ItemIds []uint32 `json:"itemIds" description:"购买的物品ID列表"`
}
// C2S_GOLD_BUY_PRODUCT 定义请求或响应数据结构。
type C2S_GOLD_BUY_PRODUCT struct {
Head common.TomeeHeader `cmd:"1104" struc:"skip"`
Type uint32 `json:"type"`
@@ -21,6 +24,7 @@ type C2S_GOLD_BUY_PRODUCT struct {
Count int64 `struc:"uint32"`
}
// ItemListInboundInfo 定义请求或响应数据结构。
type ItemListInboundInfo struct {
Head common.TomeeHeader `cmd:"2605|4475" struc:"skip"`
Param1 uint32
@@ -28,36 +32,43 @@ type ItemListInboundInfo struct {
Param3 uint32
}
// GoldOnlineRemainInboundInfo 定义请求或响应数据结构。
type GoldOnlineRemainInboundInfo struct {
Head common.TomeeHeader `cmd:"1105|1106" struc:"skip"`
}
// ExpTotalRemainInboundInfo 定义请求或响应数据结构。
type ExpTotalRemainInboundInfo struct {
Head common.TomeeHeader `cmd:"2319" struc:"skip"`
}
// ChangePlayerClothInboundInfo 定义请求或响应数据结构。
type ChangePlayerClothInboundInfo struct {
Head common.TomeeHeader `cmd:"2604" struc:"skip"`
ClothesLen uint32 `struc:"sizeof=ClothList" fieldDesc:"穿戴装备的信息" json:"clothes_len"`
ClothList []uint32 `description:"玩家装备列表" codec:"list"`
}
// TalkCountInboundInfo 定义请求或响应数据结构。
type TalkCountInboundInfo struct {
Head common.TomeeHeader `cmd:"2701" struc:"skip"`
ID uint32 `description:"奖品的Type, 即ID" codec:"uint"`
}
// TalkCateInboundInfo 定义请求或响应数据结构。
type TalkCateInboundInfo struct {
Head common.TomeeHeader `cmd:"2702" struc:"skip"`
ID uint32 `description:"奖品的Type, 即ID" codec:"uint"`
}
// C2S_USE_PET_ITEM_OUT_OF_FIGHT 定义请求或响应数据结构。
type C2S_USE_PET_ITEM_OUT_OF_FIGHT struct {
Head common.TomeeHeader `cmd:"2326" struc:"skip"`
CatchTime uint32 `json:"catch_time"`
ItemID int32 `struc:"uint32"`
}
// C2S_PET_RESET_NATURE 定义请求或响应数据结构。
type C2S_PET_RESET_NATURE struct {
Head common.TomeeHeader `cmd:"2343" struc:"skip"`
CatchTime uint32
@@ -65,22 +76,26 @@ type C2S_PET_RESET_NATURE struct {
ItemId uint32
}
// C2S_ITEM_SALE 定义请求或响应数据结构。
type C2S_ITEM_SALE struct {
Head common.TomeeHeader `cmd:"2602" struc:"skip"`
ItemId uint32
Amount uint32
}
// C2S_USE_SPEEDUP_ITEM 定义请求或响应数据结构。
type C2S_USE_SPEEDUP_ITEM struct {
Head common.TomeeHeader `cmd:"2327" struc:"skip"`
ItemID uint32
}
// C2S_USE_ENERGY_XISHOU 定义请求或响应数据结构。
type C2S_USE_ENERGY_XISHOU struct {
Head common.TomeeHeader `cmd:"2331" struc:"skip"`
ItemID uint32
}
// C2S_USE_AUTO_FIGHT_ITEM 定义请求或响应数据结构。
type C2S_USE_AUTO_FIGHT_ITEM struct {
Head common.TomeeHeader `cmd:"2329" struc:"skip"`
ItemID uint32

View File

@@ -5,6 +5,7 @@ import (
"blazing/modules/player/model"
)
// EnterMapInboundInfo 定义请求或响应数据结构。
type EnterMapInboundInfo struct {
Head common.TomeeHeader `cmd:"2001" struc:"skip"`
MapType uint32
@@ -12,22 +13,27 @@ type EnterMapInboundInfo struct {
Point model.Pos `fieldDesc:"直接给坐标xy"`
}
// GetMapHotInboundInfo 定义请求或响应数据结构。
type GetMapHotInboundInfo struct {
Head common.TomeeHeader `cmd:"1004" struc:"skip"`
}
// LeaveMapInboundInfo 定义请求或响应数据结构。
type LeaveMapInboundInfo struct {
Head common.TomeeHeader `cmd:"2002" struc:"skip"`
}
// ListMapPlayerInboundInfo 定义请求或响应数据结构。
type ListMapPlayerInboundInfo struct {
Head common.TomeeHeader `cmd:"2003" struc:"skip"`
}
// AttackBossInboundInfo 定义请求或响应数据结构。
type AttackBossInboundInfo struct {
Head common.TomeeHeader `cmd:"2412" struc:"skip"`
}
// WalkInInfo 定义请求或响应数据结构。
type WalkInInfo struct {
Head common.TomeeHeader `cmd:"2101" struc:"skip"`
Flag uint32
@@ -36,20 +42,24 @@ type WalkInInfo struct {
Path string
}
// FitmentUseringInboundInfo 定义请求或响应数据结构。
type FitmentUseringInboundInfo struct {
Head common.TomeeHeader `cmd:"10006" struc:"skip"`
TargetUserID uint32 `json:"targetUserId"`
}
// PetRoomListInboundInfo 定义请求或响应数据结构。
type PetRoomListInboundInfo struct {
Head common.TomeeHeader `cmd:"2324" struc:"skip"`
TargetUserID uint32 `json:"targetUserId"`
}
// FitmentAllInboundEmpty 定义请求或响应数据结构。
type FitmentAllInboundEmpty struct {
Head common.TomeeHeader `cmd:"10007" struc:"skip"`
}
// SET_FITMENT 定义请求或响应数据结构。
type SET_FITMENT struct {
Head common.TomeeHeader `cmd:"10008" struc:"skip"`
RoomID uint32 `json:"roomID"`
@@ -57,44 +67,52 @@ type SET_FITMENT struct {
Fitments []model.FitmentShowInfo `json:"usedList"`
}
// C2S_PetShowList 定义请求或响应数据结构。
type C2S_PetShowList struct {
CatchTime uint32 `json:"catchTime"`
PetID uint32 `json:"petID"`
}
// C2S_PET_ROOM_SHOW 定义请求或响应数据结构。
type C2S_PET_ROOM_SHOW struct {
Head common.TomeeHeader `cmd:"2323" struc:"skip"`
PetShowInfoLen uint32 `json:"PetShowInfoLen" struc:"sizeof=PetShowList"`
PetShowList []C2S_PetShowList `json:"PetShowList"`
}
// C2S_RoomPetInfo 定义请求或响应数据结构。
type C2S_RoomPetInfo struct {
Head common.TomeeHeader `cmd:"2325" struc:"skip"`
UserID uint32 `json:"userID"`
CatchTime uint32 `json:"catchTime"`
}
// C2S_BUY_FITMENT 定义请求或响应数据结构。
type C2S_BUY_FITMENT struct {
Head common.TomeeHeader `cmd:"10004" struc:"skip"`
ID uint32 `json:"id"`
Count uint32 `json:"count"`
}
// NonoInboundInfo 定义请求或响应数据结构。
type NonoInboundInfo struct {
Head common.TomeeHeader `cmd:"9003" struc:"skip"`
UserID uint32
}
// NonoFollowOrHomeInInfo 定义请求或响应数据结构。
type NonoFollowOrHomeInInfo struct {
Head common.TomeeHeader `cmd:"9019" struc:"skip"`
Flag uint32 `fieldDescription:"1为跟随 0为收回 且如果为收回 那么后续结构不需要发送" uint:"true"`
}
// SwitchFlyingInboundInfo 定义请求或响应数据结构。
type SwitchFlyingInboundInfo struct {
Head common.TomeeHeader `cmd:"2112" struc:"skip"`
Type uint32 `description:"开关, 0为取消飞行模式, 大于0为开启飞行模式" codec:"auto" uint:"true"`
}
// PetCureInboundInfo 定义请求或响应数据结构。
type PetCureInboundInfo struct {
Head common.TomeeHeader `cmd:"2306" struc:"skip"`
}

View File

@@ -2,15 +2,18 @@ package controller
import "blazing/logic/service/common"
// GetPetInfoInboundInfo 定义请求或响应数据结构。
type GetPetInfoInboundInfo struct {
Head common.TomeeHeader `cmd:"2301" struc:"skip"`
CatchTime uint32
}
// GetUserBagPetInfoInboundEmpty 定义请求或响应数据结构。
type GetUserBagPetInfoInboundEmpty struct {
Head common.TomeeHeader `cmd:"4483" struc:"skip"`
}
// SavePetBagOrderInboundInfo 定义请求或响应数据结构。
type SavePetBagOrderInboundInfo struct {
Head common.TomeeHeader `cmd:"4484" struc:"skip"`
@@ -20,51 +23,60 @@ type SavePetBagOrderInboundInfo struct {
BackupPetList []uint32
}
// PetReleaseInboundInfo 定义请求或响应数据结构。
type PetReleaseInboundInfo struct {
Head common.TomeeHeader `cmd:"2304" struc:"skip"`
CatchTime uint32
Flag uint32 `json:"flag" fieldDescription:"0为放入仓库1为放入背包" autoCodec:"true" uint:"true"`
}
// PetShowInboundInfo 定义请求或响应数据结构。
type PetShowInboundInfo struct {
Head common.TomeeHeader `cmd:"2305" struc:"skip"`
CatchTime uint32 `codec:"catchTime" inboundMessageType:"Pet_Show"`
Flag uint32 `codec:"flag"`
}
// PetOneCureInboundInfo 定义请求或响应数据结构。
type PetOneCureInboundInfo struct {
Head common.TomeeHeader `cmd:"2310" struc:"skip"`
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
}
// PET_ROWEI 定义请求或响应数据结构。
type PET_ROWEI struct {
Head common.TomeeHeader `cmd:"2321" struc:"skip"`
ID uint32
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
}
// PET_RETRIEVE 定义请求或响应数据结构。
type PET_RETRIEVE struct {
Head common.TomeeHeader `cmd:"2322" struc:"skip"`
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
}
// PetDefaultInboundInfo 定义请求或响应数据结构。
type PetDefaultInboundInfo struct {
Head common.TomeeHeader `cmd:"2308" struc:"skip"`
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true" autoCodec:"true" inboundMessageType:"Pet_Default"`
}
// PetSetExpInboundInfo 定义请求或响应数据结构。
type PetSetExpInboundInfo struct {
Head common.TomeeHeader `cmd:"2318" struc:"skip"`
CatchTime uint32 `fieldDescription:"精灵获取时间" uint:"true" autoCodec:"true"`
Exp int64 `struc:"uint32"`
}
// PetBargeListInboundInfo 定义请求或响应数据结构。
type PetBargeListInboundInfo struct {
Head common.TomeeHeader `cmd:"2309" struc:"skip"`
StartPetId uint32 `description:"开始精灵id" codec:"startPetId"`
EndPetId uint32 `description:"结束精灵id" codec:"endPetId"`
}
// ChangeSkillInfo 定义请求或响应数据结构。
type ChangeSkillInfo struct {
Head common.TomeeHeader `cmd:"2312" struc:"skip"`
CatchTime uint32 `json:"catchTime"`
@@ -74,12 +86,14 @@ type ChangeSkillInfo struct {
ReplaceSkill uint32 `json:"replaceSkill"`
}
// C2S_Skill_Sort 定义请求或响应数据结构。
type C2S_Skill_Sort struct {
Head common.TomeeHeader `cmd:"2328" struc:"skip"`
CapTm uint32 `json:"capTm"`
Skill [4]uint32 `json:"skill_1"`
}
// C2S_PetFusion 定义请求或响应数据结构。
type C2S_PetFusion struct {
Head common.TomeeHeader `cmd:"2351" struc:"skip"`
Mcatchtime uint32 `json:"mcatchtime" msgpack:"mcatchtime"`

View File

@@ -10,11 +10,13 @@ import (
"hash/crc32"
)
// MAIN_LOGIN_IN 定义请求或响应数据结构。
type MAIN_LOGIN_IN struct {
Head common.TomeeHeader `cmd:"1001" struc:"skip"`
Sid []byte `struc:"[16]byte"`
}
// CheakSession 处理控制器请求。
func (l *MAIN_LOGIN_IN) CheakSession() (bool, uint32) {
t1 := hex.EncodeToString(l.Sid)
r, err := cool.CacheManager.Get(context.Background(), fmt.Sprintf("session:%d", l.Head.UserID))
@@ -30,16 +32,19 @@ func (l *MAIN_LOGIN_IN) CheakSession() (bool, uint32) {
return true, crcValue
}
// SimUserInfoInboundInfo 定义请求或响应数据结构。
type SimUserInfoInboundInfo struct {
Head common.TomeeHeader `cmd:"2051" struc:"skip"`
UserId uint32 `fieldDescription:"米米号" uint:"true" codec:"true"`
}
// MoreUserInfoInboundInfo 定义请求或响应数据结构。
type MoreUserInfoInboundInfo struct {
Head common.TomeeHeader `cmd:"2052" struc:"skip"`
UserId uint32 `fieldDescription:"米米号" uint:"true" codec:"true"`
}
// AimatInboundInfo 定义请求或响应数据结构。
type AimatInboundInfo struct {
Head common.TomeeHeader `cmd:"2104" struc:"skip"`
ItemId uint32 `description:"物品id 射击激光 物品id为0" codec:"auto" uint:"true"`
@@ -47,6 +52,7 @@ type AimatInboundInfo struct {
Point model.Pos `description:"射击的坐标 x y" codec:"auto"`
}
// ChatInboundInfo 定义请求或响应数据结构。
type ChatInboundInfo struct {
Head common.TomeeHeader `cmd:"2102" struc:"skip"`
Reserve uint32 `json:"reserve" fieldDescription:"填充 默认值为0" uint:"true"`
@@ -54,43 +60,51 @@ type ChatInboundInfo struct {
Message string `json:"message" fieldDescription:"消息内容, 结束符为utf-8的数字0"`
}
// ChangeColorInboundInfo 定义请求或响应数据结构。
type ChangeColorInboundInfo struct {
Head common.TomeeHeader `cmd:"2063" struc:"skip"`
Color uint32 `codec:"color"`
}
// ChangeDoodleInboundInfo 定义请求或响应数据结构。
type ChangeDoodleInboundInfo struct {
Head common.TomeeHeader `cmd:"2062" struc:"skip"`
Id uint32 `codec:"id"`
Color uint32 `codec:"color"`
}
// ChangeNONOColorInboundInfo 定义请求或响应数据结构。
type ChangeNONOColorInboundInfo struct {
Head common.TomeeHeader `cmd:"9012" struc:"skip"`
Color uint32 `codec:"color"`
}
// C2SDanceAction 定义请求或响应数据结构。
type C2SDanceAction struct {
Head common.TomeeHeader `cmd:"2103" struc:"skip"`
Reserve uint32 `struc:"uint32,big"`
Type uint32 `struc:"uint32,big"`
}
// C2SPEOPLE_TRANSFROM 定义请求或响应数据结构。
type C2SPEOPLE_TRANSFROM struct {
Head common.TomeeHeader `cmd:"2111" struc:"skip"`
SuitID uint32 `struc:"uint32,big"`
}
// ChangePlayerNameInboundInfo 定义请求或响应数据结构。
type ChangePlayerNameInboundInfo struct {
Head common.TomeeHeader `cmd:"2061" struc:"skip"`
Nickname string `struc:"[16]byte"`
}
// ChangeTitleInboundInfo 定义请求或响应数据结构。
type ChangeTitleInboundInfo struct {
Head common.TomeeHeader `cmd:"3404" struc:"skip"`
TileID uint32
}
// C2S_GET_GIFT_COMPLETE 定义请求或响应数据结构。
type C2S_GET_GIFT_COMPLETE struct {
Head common.TomeeHeader `cmd:"2801" struc:"skip"`
PassText string `struc:"[16]byte"`

View File

@@ -39,6 +39,7 @@ func (h Controller) EnterMap(data *EnterMapInboundInfo, c *player.Player) (resul
return nil, -1
}
// GetMapHot 处理控制器请求。
func (h Controller) GetMapHot(data *GetMapHotInboundInfo, c *player.Player) (result *maphot.OutInfo, err errorcode.ErrorCode) {
result = &maphot.OutInfo{
HotInfos: space.GetMapHot(),

View File

@@ -14,6 +14,7 @@ const (
nonoPetCureCost int64 = 50
)
// NonoFollowOrHome 处理控制器请求。
func (h Controller) NonoFollowOrHome(data *NonoFollowOrHomeInInfo, c *player.Player) (result *nono.NonoFollowOutInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
c.Info.NONO.Flag = data.Flag
result = &nono.NonoFollowOutInfo{
@@ -49,6 +50,7 @@ func (h *Controller) GetNonoInfo(data *NonoInboundInfo, c *player.Player) (resul
return
}
// SwitchFlying 处理控制器请求。
func (h *Controller) SwitchFlying(data *SwitchFlyingInboundInfo, c *player.Player) (result *nono.SwitchFlyingOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
result = &nono.SwitchFlyingOutboundInfo{
UserId: data.Head.UserID,
@@ -59,6 +61,7 @@ func (h *Controller) SwitchFlying(data *SwitchFlyingInboundInfo, c *player.Playe
return
}
// PlayerPetCure 处理控制器请求。
func (h *Controller) PlayerPetCure(data *PetCureInboundInfo, c *player.Player) (result *nono.PetCureOutboundEmpty, err errorcode.ErrorCode) { //这个时候player应该是空的
_ = data
if c.IsArenaHealLocked() {

View File

@@ -12,6 +12,7 @@ import (
"github.com/jinzhu/copier"
)
// PetELV 处理控制器请求。
func (h Controller) PetELV(data *C2S_PET_EVOLVTION, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
_, currentPet, found := c.FindPet(data.CacthTime)
if !found {

View File

@@ -63,6 +63,7 @@ func (h Controller) PetEVDiy(data *PetEV, c *player.Player) (result *fight.NullO
return result, 0
}
// PetEV 定义请求或响应数据结构。
type PetEV struct {
Head common.TomeeHeader `cmd:"50001" struc:"skip"`
CacthTime uint32 `description:"捕捉时间" codec:"cacthTime"`

View File

@@ -16,6 +16,7 @@ func (h Controller) PetExt(
}
// C2S_NONO_EXE_LIST 定义请求或响应数据结构。
type C2S_NONO_EXE_LIST struct {
Head common.TomeeHeader `cmd:"9015" struc:"skip"`
}

View File

@@ -19,6 +19,7 @@ const (
petFusionSoulID = 1000017
)
// PetFusion 处理控制器请求。
func (h Controller) PetFusion(data *C2S_PetFusion, c *player.Player) (result *pet.PetFusionInfo, err errorcode.ErrorCode) {
result = &pet.PetFusionInfo{
SoulID: petFusionSoulID,

View File

@@ -36,6 +36,7 @@ func (h Controller) GetUserBagPetInfo(
return player.GetUserBagPetInfo(), 0
}
// GetPetListInboundEmpty 定义请求或响应数据结构。
type GetPetListInboundEmpty struct {
Head common.TomeeHeader `cmd:"2303" struc:"skip"`
}
@@ -48,6 +49,7 @@ func (h Controller) GetPetList(
return buildPetListOutboundInfo(player.Info.PetList), 0
}
// GetPetListFreeInboundEmpty 定义请求或响应数据结构。
type GetPetListFreeInboundEmpty struct {
Head common.TomeeHeader `cmd:"2320" struc:"skip"`
}

View File

@@ -10,6 +10,7 @@ import (
"github.com/samber/lo"
)
// IsCollect 处理控制器请求。
func (h Controller) IsCollect(
data *pet.C2S_IS_COLLECT, c *player.Player) (result *pet.S2C_IS_COLLECT, err errorcode.ErrorCode) { //这个时候player应该是空的
result = &pet.S2C_IS_COLLECT{
@@ -49,6 +50,7 @@ var validTypeIDMap = map[int][]uint32{
100: {856, 857, 858}, //测试
}
// Collect 处理控制器请求。
func (h Controller) Collect(
data *pet.C2S_PET_COLLECT, c *player.Player) (result *pet.S2C_PET_COLLECT, err errorcode.ErrorCode) { //这个时候player应该是空的
result = &pet.S2C_PET_COLLECT{ID: data.ID}

View File

@@ -120,6 +120,7 @@ func canBreedPair(maleID, femaleID uint32) bool {
return ok
}
// GetEggList 处理控制器请求。
func (ctl Controller) GetEggList(
data *pet.C2S_GET_EGG_LIST, player *player.Player) (result *pet.S2C_GET_EGG_LIST, err errorcode.ErrorCode) { //这个时候player应该是空的

View File

@@ -8,6 +8,7 @@ import (
"blazing/logic/service/player"
)
// SystemTimeInfo 处理控制器请求。
func (h Controller) SystemTimeInfo(data *InInfo, c *player.Player) (result *OutInfo, err errorcode.ErrorCode) {
return &OutInfo{

View File

@@ -171,6 +171,7 @@ func (h Controller) ChangePlayerCloth(data *ChangePlayerClothInboundInfo, player
return
}
// ChangePlayerName 处理控制器请求。
func (h Controller) ChangePlayerName(data *ChangePlayerNameInboundInfo, c *player.Player) (result *user.ChangePlayerNameOutboundInfo, err errorcode.ErrorCode) {
newNickname := cool.Filter.Replace(strings.Trim(data.Nickname, "\x00"), '*')
@@ -183,6 +184,8 @@ func (h Controller) ChangePlayerName(data *ChangePlayerNameInboundInfo, c *playe
return result, 0
}
// ChangeTile 处理控制器请求。
func (h Controller) ChangeTile(data *ChangeTitleInboundInfo, c *player.Player) (result *user.ChangeTitleOutboundInfo, err errorcode.ErrorCode) {
result = &user.ChangeTitleOutboundInfo{

View File

@@ -9,6 +9,7 @@ import (
"time"
)
// CDK 处理控制器请求。
func (h Controller) CDK(data *C2S_GET_GIFT_COMPLETE, player *player.Player) (result *user.S2C_GET_GIFT_COMPLETE, err errorcode.ErrorCode) {
result = &user.S2C_GET_GIFT_COMPLETE{}

View File

@@ -7,6 +7,7 @@ import (
"blazing/modules/config/service"
)
// GetTalkCount 处理控制器请求。
func (h Controller) GetTalkCount(data *TalkCountInboundInfo, c *player.Player) (result *item.TalkCountOutboundInfo, err errorcode.ErrorCode) {
result = &item.TalkCountOutboundInfo{}
talkCount, ok := c.Service.Talk.Cheak(c.Info.MapID, int(data.ID))

View File

@@ -6,6 +6,7 @@ import (
"blazing/logic/service/space/info"
)
// PlayerWalk 处理控制器请求。
func (h Controller) PlayerWalk(data *WalkInInfo, c *player.Player) (result *info.WalkOutInfo, err errorcode.ErrorCode) {
result = &info.WalkOutInfo{
Flag: data.Flag,