221 lines
7.6 KiB
Go
221 lines
7.6 KiB
Go
package fight
|
||
|
||
import (
|
||
"blazing/logic/service/common"
|
||
_ "blazing/logic/service/fight/boss"
|
||
_ "blazing/logic/service/fight/effect"
|
||
)
|
||
|
||
// 野怪对战包
|
||
type FightNpcMonsterInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2408" struc:"skip"`
|
||
// Number 地图刷新怪物结构体对应的序号(1-9的位置序号)
|
||
|
||
Number uint32 `fieldDesc:"地图刷新怪物结构体对应的序号 1 - 9 的位置序号" `
|
||
}
|
||
type ChallengeBossInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2411" struc:"skip"`
|
||
BossId uint32 `json:"bossId"`
|
||
}
|
||
type NullOutboundInfo struct {
|
||
}
|
||
|
||
type S2C_ChoiceLevelRequestInfo struct {
|
||
CurFightLevel uint32 `json:"curFightLevel"` // 当前战斗层数
|
||
BossLen uint32 `struc:"sizeof=BossID"`
|
||
BossID []uint32 `json:"bossId"` // 下一层的精灵id数组
|
||
}
|
||
|
||
// 准备战斗包
|
||
type ReadyToFightInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2404" struc:"skip"`
|
||
}
|
||
|
||
// 战斗逃跑
|
||
type EscapeFightInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2410" struc:"skip"`
|
||
}
|
||
|
||
// 精灵王
|
||
type StartPetWarInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2431" struc:"skip"`
|
||
}
|
||
type StartTwarInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2429|2415|2425" struc:"skip"`
|
||
}
|
||
type ARENA_SET_OWENR struct {
|
||
Head common.TomeeHeader `cmd:"2417" struc:"skip"`
|
||
}
|
||
type ARENA_FIGHT_OWENR struct {
|
||
Head common.TomeeHeader `cmd:"2418" struc:"skip"`
|
||
}
|
||
|
||
type ARENA_GET_INFO struct {
|
||
Head common.TomeeHeader `cmd:"2419" struc:"skip"`
|
||
}
|
||
|
||
type ARENA_UPFIGHT struct {
|
||
Head common.TomeeHeader `cmd:"2420" struc:"skip"`
|
||
}
|
||
type ARENA_OWENR_ACCE struct {
|
||
Head common.TomeeHeader `cmd:"2422" struc:"skip"`
|
||
}
|
||
|
||
// 表示"宠物王加入"的入站消息数据
|
||
type PetKingJoinInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2413" struc:"skip"`
|
||
Type uint32 // 战斗类型:5=单精灵,6=多精灵,11=精灵大师赛
|
||
FightType uint32 // 仅当Type为11时有效
|
||
}
|
||
|
||
// PeakQueueCancelInboundInfo 取消跨服巅峰队列。
|
||
type PeakQueueCancelInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2459" struc:"skip"`
|
||
}
|
||
|
||
// PeakBanPickSubmitInboundInfo 提交 ban/pick 结果。
|
||
type PeakBanPickSubmitInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2460" struc:"skip"`
|
||
|
||
SelectedCatchTimesLen uint32 `struc:"sizeof=SelectedCatchTimes"`
|
||
SelectedCatchTimes []uint32 `json:"selectedCatchTimes"`
|
||
|
||
BanCatchTimesLen uint32 `struc:"sizeof=BanCatchTimes"`
|
||
BanCatchTimes []uint32 `json:"banCatchTimes"`
|
||
}
|
||
|
||
// CrossServerBanPickStartOutboundInfo 跨服匹配成功后,通知前端进入 ban/pick。
|
||
type CrossServerBanPickPetInfo struct {
|
||
CatchTime uint32 `json:"catchTime"`
|
||
PetID uint32 `json:"petId"`
|
||
Name string `struc:"[16]byte" json:"name"`
|
||
Level uint32 `json:"level"`
|
||
Hp uint32 `json:"hp"`
|
||
MaxHp uint32 `json:"maxHp"`
|
||
}
|
||
|
||
type CrossServerBanPickStartOutboundInfo struct {
|
||
SessionIDLen uint32 `struc:"sizeof=SessionID"`
|
||
SessionID string `json:"sessionId"`
|
||
|
||
OpponentUserID uint32 `json:"opponentUserId"`
|
||
OpponentNick string `struc:"[16]byte" json:"opponentNick"`
|
||
|
||
FightMode uint32 `json:"fightMode"`
|
||
Status uint32 `json:"status"`
|
||
|
||
TimeoutSeconds uint32 `json:"timeoutSeconds"`
|
||
SelectableCount uint32 `json:"selectableCount"`
|
||
|
||
MyPetsLen uint32 `struc:"sizeof=MyPets"`
|
||
MyPets []CrossServerBanPickPetInfo `json:"myPets"`
|
||
|
||
OpponentPetsLen uint32 `struc:"sizeof=OpponentPets"`
|
||
OpponentPets []CrossServerBanPickPetInfo `json:"opponentPets"`
|
||
}
|
||
|
||
// HandleFightInviteInboundInfo 处理战斗邀请的入站消息
|
||
|
||
type HandleFightInviteInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2403" struc:"skip"`
|
||
UserID uint32 `json:"userId" codec:"userId,uint"` // 邀请我对战人的userid
|
||
Flag uint32 `json:"flag" codec:"flag,uint"` // 1为同意对战 0为取消对战
|
||
Mode uint32 `json:"mode" codec:"mode,uint"` // 战斗类型 1 = 1v1 2 = 6v6
|
||
}
|
||
|
||
type InviteToFightInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2401" struc:"skip"`
|
||
|
||
UserID uint32
|
||
|
||
// Mode 战斗类型 1 = 1v1 2 = 6v6
|
||
Mode uint32
|
||
}
|
||
type InviteFightCancelInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2402" struc:"skip"`
|
||
}
|
||
|
||
// 2502的回复包 PVP邀请消息
|
||
type NoteHandleFightInviteOutboundInfo struct {
|
||
UserID uint32
|
||
Nickname string `struc:"[16]byte"` // 固定长度16字节
|
||
Result uint32 // 0=拒绝 1=同意 2=在线超6小时 3=无出战精灵 4=不在线
|
||
}
|
||
|
||
type UseSkillInInfo struct {
|
||
Head common.TomeeHeader `cmd:"2405" struc:"skip"`
|
||
// 技能id,
|
||
SkillId uint32
|
||
}
|
||
|
||
// UseSkillAtInboundInfo 组队/多战位技能使用包(新增)。
|
||
// 目标关系与前端 AtkType 语义对齐:
|
||
// 0=对方 1=自己 2=队友;AtkType: 0=所有人 1=仅己方 2=仅对方 3=仅自己。
|
||
type UseSkillAtInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"7505" struc:"skip"`
|
||
SkillId uint32 `json:"skillId"`
|
||
// 出手方槽位(我方)
|
||
ActorIndex uint8 `json:"actorIndex"`
|
||
// 目标槽位(按 TargetRelation 所属阵营解释)
|
||
TargetIndex uint8 `json:"targetIndex"`
|
||
// 0=对方 1=自己 2=队友
|
||
TargetRelation uint8 `json:"targetRelation"`
|
||
// 前端技能目标类型(可选兜底),同 GBTL AtkType 定义
|
||
AtkType uint8 `json:"atkType"`
|
||
}
|
||
type ChangePetInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2407" struc:"skip"`
|
||
// CatchTime 捕捉时间
|
||
CatchTime uint32 `json:"catchTime"`
|
||
}
|
||
type CatchMonsterInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2409" struc:"skip"`
|
||
// CapsuleId 胶囊id
|
||
|
||
CapsuleId uint32 `json:"capsuleId" fieldDescription:"胶囊id" uint:"true"`
|
||
}
|
||
|
||
type LoadPercentInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2441" struc:"skip"`
|
||
Percent uint32 `fieldDescription:"加载百分比"`
|
||
}
|
||
|
||
// UsePetItemInboundInfo 对应Java的UsePetItemInboundInfo,实现InboundMessage接口
|
||
type UsePetItemInboundInfo struct {
|
||
Head common.TomeeHeader `cmd:"2406" struc:"skip"`
|
||
// 字段首字母大写以导出(对应Java的可访问性,配合@Data的getter/setter)
|
||
CatchTime uint32 `description:"精灵捕获时间" codec:"catchTime"`
|
||
ItemId uint32 `description:"使用的物品ID" codec:"itemId"` // 结构体标签模拟@FieldDescription和@AutoCodec注解
|
||
Reversed1 uint32 `description:"填充字段 0" codec:"reversed1"` // reversed1对应原Java的填充字段
|
||
}
|
||
type ChatInfo struct {
|
||
Head common.TomeeHeader `cmd:"50002" struc:"skip"`
|
||
Reserve uint32 `json:"reserve" fieldDescription:"填充 默认值为0" uint:"true"`
|
||
MessageLen uint32 `struc:"sizeof=Message"`
|
||
Message string `json:"message" fieldDescription:"消息内容, 结束符为utf-8的数字0"` // 消息内容,包含utf-8空字符('\x00')作为结束符
|
||
}
|
||
type C2S_FRESH_CHOICE_FIGHT_LEVEL struct {
|
||
Head common.TomeeHeader `cmd:"2428|2414" struc:"skip"`
|
||
|
||
Level uint `json:"level"` // 若使用JSON序列化,添加tag;若用protobuf可替换为对应的tag
|
||
}
|
||
type C2S_OPEN_DARKPORTAL struct {
|
||
Head common.TomeeHeader `cmd:"2424" struc:"skip"`
|
||
|
||
Level uint32 `json:"level"` // 若使用JSON序列化,添加tag;若用protobuf可替换为对应的tag
|
||
}
|
||
type S2C_OPEN_DARKPORTAL struct {
|
||
CurBossID uint32 `json:"curBossID"`
|
||
}
|
||
|
||
type S2C_FreshChoiceLevelRequestInfo struct {
|
||
// CurFightLevel 当前战斗层数(对应前端 curFightLevel 字段)
|
||
CurFightLevel uint32 `json:"curFightLevel"` // JSON序列化tag,保证字段名与前端一致
|
||
BossIdLen uint32 `struc:"sizeof=BossId"`
|
||
// BossId 当前层数的精灵ID数组(对应前端 bossId 字段,C# List<uint> 对应Go []uint切片)
|
||
BossId []uint32 `json:"bossId"`
|
||
}
|
||
type FRESH_LEAVE_FIGHT_LEVEL struct {
|
||
Head common.TomeeHeader `cmd:"2430|2416|2426" struc:"skip"`
|
||
}
|