2025-08-24 17:33:19 +08:00
|
|
|
|
package pet
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
2025-09-14 01:35:16 +08:00
|
|
|
|
"blazing/logic/service/common"
|
|
|
|
|
|
"blazing/logic/service/player"
|
2025-09-11 01:07:00 +08:00
|
|
|
|
"blazing/logic/service/space"
|
2025-08-24 17:33:19 +08:00
|
|
|
|
"blazing/modules/blazing/model"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type InInfo struct {
|
2025-09-14 01:35:16 +08:00
|
|
|
|
Head player.TomeeHeader `cmd:"2301" struc:"[0]pad"`
|
2025-08-24 17:33:19 +08:00
|
|
|
|
|
|
|
|
|
|
CatchTime uint32
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type OutInfo struct {
|
|
|
|
|
|
model.PetInfo
|
|
|
|
|
|
}
|
2025-08-30 21:59:52 +08:00
|
|
|
|
|
|
|
|
|
|
// PetReleaseOutboundInfo 宠物释放出站消息
|
|
|
|
|
|
type PetReleaseOutboundInfo struct {
|
2025-09-01 01:03:46 +08:00
|
|
|
|
HomeEnergy uint32 `json:"home_energy" fieldDescription:"暂定0" autoCodec:"true" uint:"true"`
|
|
|
|
|
|
FirstPetTime uint32 `json:"first_pet_time" fieldDescription:"精灵生成时间" autoCodec:"true" uint:"true"`
|
|
|
|
|
|
Flag uint32
|
|
|
|
|
|
PetInfo model.PetInfo `json:"pet_info" fieldDescription:"精灵信息" autoCodec:"true"`
|
2025-08-30 21:59:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 放入背包或者加入仓库
|
|
|
|
|
|
type PetReleaseInboundInfo struct {
|
2025-09-14 01:35:16 +08:00
|
|
|
|
Head player.TomeeHeader `cmd:"2304" struc:"[0]pad"`
|
|
|
|
|
|
CatchTime uint32 `json:"catch_time" fieldDescription:"精灵生成时间" autoCodec:"true" uint:"true"`
|
|
|
|
|
|
Flag uint32 `json:"flag" fieldDescription:"0为放入仓库,1为放入背包" autoCodec:"true" uint:"true"`
|
2025-08-30 21:59:52 +08:00
|
|
|
|
}
|
2025-09-11 01:07:00 +08:00
|
|
|
|
|
|
|
|
|
|
type PetShowInboundInfo struct {
|
2025-09-14 01:35:16 +08:00
|
|
|
|
Head player.TomeeHeader `cmd:"2305" struc:"[0]pad"`
|
2025-09-11 01:07:00 +08:00
|
|
|
|
|
|
|
|
|
|
CatchTime uint32 `codec:"catchTime" inboundMessageType:"Pet_Show"`
|
|
|
|
|
|
Flag uint32 `codec:"flag"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (t *PetShowInboundInfo) Broadcast(mapid uint32, o PetShowOutboundInfo) {
|
|
|
|
|
|
|
2025-09-14 01:35:16 +08:00
|
|
|
|
space.GetSpace(mapid).Range(func(playerID uint32, player common.PlayerI) bool {
|
2025-09-11 01:07:00 +08:00
|
|
|
|
t.Head.Result = 0
|
|
|
|
|
|
|
|
|
|
|
|
player.SendPack(t.Head.Pack(&o))
|
|
|
|
|
|
return true
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type PetShowOutboundInfo struct {
|
|
|
|
|
|
UserID uint32 `codec:"UserID" description:"米米号"`
|
|
|
|
|
|
CatchTime uint32 `codec:"CatchTime" description:"精灵获得的时间"`
|
|
|
|
|
|
ID uint32 `codec:"PetID" description:"精灵编号"`
|
|
|
|
|
|
Flag uint32 `codec:"flag" description:"1为显示 0为收回"`
|
|
|
|
|
|
Dv uint32 `codec:"dv" description:"个体"`
|
|
|
|
|
|
Shiny uint32 `codec:"shiny" description:"闪光状态标识"`
|
|
|
|
|
|
SkinID uint32 `codec:"skinID" description:"皮肤ID"`
|
|
|
|
|
|
Reserved1 [3]uint32
|
|
|
|
|
|
}
|
|
|
|
|
|
type PetOneCureInboundInfo struct {
|
2025-09-14 01:35:16 +08:00
|
|
|
|
Head player.TomeeHeader `cmd:"2310" struc:"[0]pad"`
|
|
|
|
|
|
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
|
2025-09-11 01:07:00 +08:00
|
|
|
|
} // PetOneCureOutboundInfo 宠物单个治疗出站消息
|
|
|
|
|
|
type PetOneCureOutboundInfo struct {
|
|
|
|
|
|
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
|
|
|
|
|
|
}
|
2025-09-12 19:21:39 +08:00
|
|
|
|
|
2025-09-21 08:07:17 +00:00
|
|
|
|
// PetDefaultInboundInfo
|
2025-09-12 19:21:39 +08:00
|
|
|
|
// 实现了InboundMessage接口
|
|
|
|
|
|
type PetDefaultInboundInfo struct {
|
2025-09-14 01:35:16 +08:00
|
|
|
|
Head player.TomeeHeader `cmd:"2308" struc:"[0]pad"`
|
|
|
|
|
|
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true" autoCodec:"true" inboundMessageType:"Pet_Default"`
|
2025-09-12 19:21:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-21 08:07:17 +00:00
|
|
|
|
// PetDefaultOutboundInfo
|
2025-09-12 19:21:39 +08:00
|
|
|
|
// 实现了OutboundMessage接口
|
|
|
|
|
|
type PetDefaultOutboundInfo struct {
|
|
|
|
|
|
IsDefault uint32 `json:"isDefault" fieldDescription:"0: 首发设置失败,1: 首发设置成功" uint:"true" autoCodec:"true" outboundMessageType:"Pet_Default"`
|
|
|
|
|
|
}
|