2025-08-15 19:24:02 +08:00
|
|
|
package controller
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/common/socket/errorcode"
|
2025-09-14 01:35:16 +08:00
|
|
|
"blazing/logic/service/maps"
|
|
|
|
|
"blazing/logic/service/player"
|
2025-08-15 19:24:02 +08:00
|
|
|
)
|
|
|
|
|
|
2025-09-14 01:35:16 +08:00
|
|
|
func (h Controller) Walk(data *maps.WalkInInfo, c *player.Player) (result *maps.WalkOutInfo, err errorcode.ErrorCode) {
|
2025-10-29 20:33:43 +08:00
|
|
|
result = &maps.WalkOutInfo{
|
2025-11-09 06:50:12 +00:00
|
|
|
Flag: data.Flag,
|
|
|
|
|
Point: data.Point,
|
|
|
|
|
Path: data.Path,
|
2025-10-29 20:33:43 +08:00
|
|
|
}
|
|
|
|
|
|
2025-08-30 00:36:08 +08:00
|
|
|
result.UserID = data.Head.UserID
|
2025-10-13 23:38:48 +08:00
|
|
|
c.Info.Pos = data.Point
|
|
|
|
|
//glog.Debug(context.Background(), err1)
|
2025-11-09 06:50:12 +00:00
|
|
|
if !c.Info.Pos.BothLessThan50(data.Point) { //距离超过50才广播
|
|
|
|
|
data.Broadcast(c.Info.MapID, *result) //走路的广播
|
|
|
|
|
}
|
2025-08-15 22:44:28 +08:00
|
|
|
|
2025-08-17 21:55:15 +08:00
|
|
|
return nil, -1
|
2025-08-15 19:24:02 +08:00
|
|
|
}
|