Files
bl/logic/service/space/walk.go
昔念 9a6587a2da refactor(logic): 重构登录和地图相关逻辑
- 更新 Player 结构体,添加 Nick 字段
- 修改 ErrorCode 类型从 uint32 改为 int32
- 优化 SocketHandler 处理逻辑
- 重构 Controller 中的 Login 和地图相关方法
- 更新地图服务中的 MapIn 和 MapOut 方法
- 调整空间服务中的 Hot 和 Walk 方法
2025-08-17 21:55:15 +08:00

49 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package space
import (
"blazing/common/data/entity"
"blazing/common/socket/handler"
"blazing/modules/blazing/model"
)
type InInfo struct {
Head handler.TomeeHeader `cmd:"2101" struc:"[0]pad"` //走路包
// Flag: 0为走1为飞行模式对应Java的@UInt long
Flag uint32
// Point: 直接给坐标xy
Point model.Pos `fieldDesc:"直接给坐标xy"`
// Reverse2: 暂定 占位字符2
Reverse2 string `struc:"[2]byte"`
}
func (t *InInfo) Broadcast(mapid uint32, o OutInfo) {
//tt := planetmap
//g.Dump(GetSpace(mapid).Len())
GetSpace(mapid).Range(func(playerID uint32, player *entity.Player) bool {
t.Head.Result = 0
tt := t.Head.Pack(&o)
err := player.SendPack(tt)
player.Cheak(err)
return true
})
}
// PeopleWalkOutboundInfo 对应Java的PeopleWalkOutboundInfo类实现OutboundMessage接口
type OutInfo struct {
// Flag: 0为走1为飞行模式
Flag uint32 `fieldDesc:"0为走1为飞行模式" codec:"uint"`
// UserID: 走动的人的米米号
UserID uint32 `fieldDesc:"走动的人的米米号" codec:"uint"`
// Point: 直接给坐标xy
Point model.Pos `fieldDesc:"直接给坐标xy"`
// Reserve2: 这个字段同C2S_People_Walk中的reserve2
Reserve2 string `struc:"[2]byte"`
}