26 lines
565 B
Go
26 lines
565 B
Go
package maps
|
|
|
|
import (
|
|
"blazing/common/data/entity"
|
|
"blazing/common/socket/handler"
|
|
"blazing/logic/service/space"
|
|
)
|
|
|
|
type LeaveMapOutboundInfo struct {
|
|
// 米米号
|
|
UserID uint32 `struc:"uint32" fieldDesc:"米米号" json:"user_id"`
|
|
}
|
|
|
|
type LeaveMapInboundInfo struct {
|
|
Head handler.TomeeHeader `cmd:"2002" struc:"[0]pad"` //切换地图
|
|
}
|
|
|
|
func (t *LeaveMapInboundInfo) Broadcast(mapid uint32, o LeaveMapOutboundInfo) {
|
|
|
|
space.GetPlanet(mapid).Range(func(playerID uint32, player *entity.Player) bool {
|
|
|
|
player.SendPack(t.Head.Pack(o))
|
|
return true
|
|
})
|
|
}
|