2025-08-15 22:44:28 +08:00
|
|
|
|
package maps
|
2025-08-15 19:24:02 +08:00
|
|
|
|
|
|
|
|
|
|
import (
|
2025-09-14 01:35:16 +08:00
|
|
|
|
"blazing/logic/service/player"
|
2025-08-15 22:44:28 +08:00
|
|
|
|
"blazing/logic/service/space"
|
2025-09-04 02:00:57 +08:00
|
|
|
|
|
2025-08-15 19:24:02 +08:00
|
|
|
|
"blazing/modules/blazing/model"
|
2025-08-17 21:55:15 +08:00
|
|
|
|
|
|
|
|
|
|
"github.com/creasty/defaults"
|
2025-08-15 19:24:02 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
2025-08-15 22:44:28 +08:00
|
|
|
|
type InInfo struct {
|
2025-09-14 01:35:16 +08:00
|
|
|
|
Head player.TomeeHeader `cmd:"2001" struc:"[0]pad"` //切换地图
|
2025-08-15 22:44:28 +08:00
|
|
|
|
// 地图类型
|
|
|
|
|
|
MapType uint32
|
|
|
|
|
|
|
|
|
|
|
|
MapId uint32
|
|
|
|
|
|
// Point: 直接给坐标x,y
|
2025-09-21 08:00:58 +00:00
|
|
|
|
Point model.Pos `fieldDesc:"直接给坐标x,y"`
|
|
|
|
|
|
|
2025-08-15 22:44:28 +08:00
|
|
|
|
// Reverse2: 暂定 占位字符2
|
2025-08-16 00:23:43 +08:00
|
|
|
|
//Reverse2 string `struc:"[2]byte"`
|
2025-08-15 22:44:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (t *InInfo) Broadcast(mapid uint32, o OutInfo) {
|
|
|
|
|
|
|
2025-10-10 04:49:23 +00:00
|
|
|
|
for _, v := range space.GetSpace(mapid).User.Items() {
|
2025-08-17 21:55:15 +08:00
|
|
|
|
t.Head.Result = 0
|
2025-08-15 22:44:28 +08:00
|
|
|
|
|
2025-10-10 04:49:23 +00:00
|
|
|
|
v.SendPack(t.Head.Pack(&o))
|
|
|
|
|
|
}
|
2025-08-15 22:44:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 这里存储星球的map
|
|
|
|
|
|
//var planetmap utils.SyncMap[] //= space.NewSyncMap()
|
|
|
|
|
|
|
2025-08-26 23:22:10 +00:00
|
|
|
|
// PeopleInfo PeopleInfo类,实现OutboundMessage接口
|
2025-08-15 19:24:02 +08:00
|
|
|
|
type OutInfo struct {
|
|
|
|
|
|
UserID uint32 `struc:"uint32" fieldDesc:"米米号" json:"user_id"`
|
|
|
|
|
|
|
|
|
|
|
|
// 16字节昵称
|
|
|
|
|
|
Nick string `struc:"[16]byte" fieldDesc:"16字节昵称" json:"nick"`
|
|
|
|
|
|
|
|
|
|
|
|
// 机器人人物颜色 00 rgb
|
|
|
|
|
|
Color uint32 `struc:"uint32" fieldDesc:"机器人人物颜色 00 rgb" json:"color"`
|
|
|
|
|
|
|
|
|
|
|
|
// 固定值0
|
|
|
|
|
|
Texture uint32 `struc:"uint32" fieldDesc:"固定值0" json:"texture"`
|
|
|
|
|
|
|
|
|
|
|
|
// 暂时不明建议先给固定值0
|
2025-08-18 00:38:14 +08:00
|
|
|
|
Vip uint16 ` json:"vip"`
|
2025-08-15 19:24:02 +08:00
|
|
|
|
|
|
|
|
|
|
// 暂时不明建议先给固定值15
|
2025-08-18 00:38:14 +08:00
|
|
|
|
Viped uint16 ` default:"15" json:"viped"`
|
2025-08-15 19:24:02 +08:00
|
|
|
|
|
|
|
|
|
|
// 暂时不明建议先给固定值1
|
|
|
|
|
|
VipStage uint32 `struc:"uint32" fieldDesc:"暂时不明建议先给固定值1" json:"vip_stage"`
|
|
|
|
|
|
|
|
|
|
|
|
// 人物状态 =0 步行 !=0 飞行
|
|
|
|
|
|
ActionType uint32 `struc:"uint32" fieldDesc:"人物状态 =0 步行 !=0 飞行" json:"action_type"`
|
|
|
|
|
|
|
|
|
|
|
|
// 上线的地图id
|
|
|
|
|
|
Pos model.Pos `fieldDesc:"上线的地图id" json:"pos"`
|
|
|
|
|
|
|
2025-10-13 23:38:48 +08:00
|
|
|
|
// 动作, 大于10000时为蹲下
|
2025-08-15 19:24:02 +08:00
|
|
|
|
Action uint32 `struc:"uint32" fieldDesc:"暂时不明给0" json:"action"`
|
|
|
|
|
|
|
2025-10-13 23:38:48 +08:00
|
|
|
|
// 动作, 默认情况下为2, 蹲下为3
|
2025-08-15 19:24:02 +08:00
|
|
|
|
Direction uint32 `struc:"uint32" default:"2" fieldDesc:"暂时不明给2" json:"direction"`
|
|
|
|
|
|
|
2025-10-13 23:38:48 +08:00
|
|
|
|
// 变形套装ID
|
2025-08-15 19:24:02 +08:00
|
|
|
|
ChangeShape uint32 `struc:"uint32" fieldDesc:"暂时不明给0" json:"change_shape"`
|
|
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
|
|
|
|
|
SpiritTime uint32 `struc:"uint32" fieldDesc:"暂时不明给0" json:"spirit_time"`
|
|
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
|
|
|
|
|
SpiritID uint32 `struc:"uint32" fieldDesc:"暂时不明给0" json:"spirit_id"`
|
|
|
|
|
|
|
2025-08-17 21:55:15 +08:00
|
|
|
|
// 宠物 ID 暂时无法测试,给 0
|
|
|
|
|
|
PetDV uint32 `struc:"uint32" fieldDesc:"宠物ID暂时无法测试, 给0" json:"pet_dv"`
|
|
|
|
|
|
// 宠物闪光暂时无法测试,给 0
|
|
|
|
|
|
PetShiny uint32 `struc:"uint32" fieldDesc:"宠物闪光暂时无法测试, 给0" json:"pet_shiny"`
|
|
|
|
|
|
// 宠物皮肤暂时无法测试,给 0
|
|
|
|
|
|
PetSkin uint32 `struc:"uint32" fieldDesc:"宠物皮肤暂时无法测试, 给0" json:"pet_skin"`
|
|
|
|
|
|
// 填充字符
|
|
|
|
|
|
Reserved uint32 `struc:"uint32" fieldDesc:"填充字符" json:"reserved"`
|
|
|
|
|
|
// 填充字符
|
|
|
|
|
|
Reserved1 uint32 `struc:"uint32" fieldDesc:"填充字符" json:"reserved1"`
|
|
|
|
|
|
// 填充字符
|
|
|
|
|
|
Reserved2 uint32 `struc:"uint32" fieldDesc:"填充字符" json:"reserved2"`
|
2025-08-15 19:24:02 +08:00
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
|
|
|
|
|
FightFlag uint32 `struc:"uint32" fieldDesc:"暂时不明给0" json:"fight_flag"`
|
|
|
|
|
|
|
|
|
|
|
|
// 教官ID
|
|
|
|
|
|
TeacherID uint32 `struc:"uint32" fieldDesc:"教官ID" json:"teacher_id"`
|
|
|
|
|
|
|
|
|
|
|
|
// 学员ID
|
|
|
|
|
|
StudentID uint32 `struc:"uint32" fieldDesc:"学员ID" json:"student_id"`
|
|
|
|
|
|
|
|
|
|
|
|
// nono状态 固定值-1
|
|
|
|
|
|
NonoState uint32 `struc:"uint32" default:"0xFFFFFFFF" fieldDesc:"nono状态 固定值-1" json:"nono_state"`
|
|
|
|
|
|
|
|
|
|
|
|
// nono颜色 00 FF FF FF
|
|
|
|
|
|
NonoColor uint32 `struc:"uint32" fieldDesc:"nono颜色 00 FF FF FF" json:"nono_color"`
|
|
|
|
|
|
|
|
|
|
|
|
// 是不是超能nono 固定值1
|
|
|
|
|
|
SuperNono uint32 `struc:"uint32" default:"1" fieldDesc:"是不是超能nono 固定值1" json:"super_nono"`
|
|
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
|
|
|
|
|
PlayerForm uint32 `struc:"uint32" fieldDesc:"暂时不明给0" json:"player_form"`
|
|
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
|
|
|
|
|
TransTime uint32 `struc:"uint32" fieldDesc:"暂时不明给0" json:"trans_time"`
|
|
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
|
|
|
|
|
TeamID uint32 `struc:"uint32" fieldDesc:"暂时不明给0" json:"team_id"`
|
|
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
|
|
|
|
|
TeamCoreCount uint32 `struc:"uint32" fieldDesc:"暂时不明给0" json:"team_core_count"`
|
|
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
|
|
|
|
|
TeamIsShow uint32 `struc:"uint32" fieldDesc:"暂时不明给0" json:"team_is_show"`
|
|
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
2025-08-17 21:55:15 +08:00
|
|
|
|
LogoBg uint16 `json:"logo_bg"`
|
2025-08-15 19:24:02 +08:00
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
2025-08-17 21:55:15 +08:00
|
|
|
|
LogoIcon uint16 ` json:"logo_icon"`
|
2025-08-15 19:24:02 +08:00
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
2025-08-17 21:55:15 +08:00
|
|
|
|
LogoColor uint16 `json:"logo_color"`
|
2025-08-15 19:24:02 +08:00
|
|
|
|
|
|
|
|
|
|
// 暂时不明给0
|
2025-08-17 21:55:15 +08:00
|
|
|
|
TxtColor uint16 `json:"txt_color"`
|
2025-08-15 19:24:02 +08:00
|
|
|
|
|
|
|
|
|
|
// 4字节
|
2025-08-17 21:55:15 +08:00
|
|
|
|
LogoWord [4]byte `struc:"[4]byte" fieldDesc:"4字节" json:"logo_word"`
|
|
|
|
|
|
ClothesLen uint32 `struc:"sizeof=Clothes" fieldDesc:"穿戴装备的信息" json:"clothes_len"`
|
2025-08-15 19:24:02 +08:00
|
|
|
|
|
|
|
|
|
|
// 穿戴装备的信息
|
|
|
|
|
|
Clothes []model.PeopleItemInfo `fieldDesc:"穿戴装备的信息" json:"clothes"`
|
|
|
|
|
|
}
|
2025-08-17 21:55:15 +08:00
|
|
|
|
|
|
|
|
|
|
func NewOutInfo() *OutInfo {
|
|
|
|
|
|
l := &OutInfo{}
|
|
|
|
|
|
|
|
|
|
|
|
// 自动填充 struct tag 里的 default 值
|
|
|
|
|
|
if err := defaults.Set(l); err != nil {
|
|
|
|
|
|
panic(err) // 方便发现 default 设置错误
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return l
|
|
|
|
|
|
}
|