package controller

import (
	"blazing/common/socket/errorcode"
	"blazing/logic/service/maps"
	"blazing/logic/service/player"
	"context"

	"github.com/gogf/gf/v2/os/glog"
	"github.com/jinzhu/copier"
)

func (h Controller) Walk(data *maps.WalkInInfo, c *player.Player) (result *maps.WalkOutInfo, err errorcode.ErrorCode) {
	result = &maps.WalkOutInfo{}
	err1 := copier.Copy(result, data)
	result.UserID = data.Head.UserID
	glog.Debug(context.Background(), err1)
	data.Broadcast(c.Info.MapID, *result) //走路的广播

	return nil, -1
}
