mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-01-12 20:36:25 -05:00
52f8cd6d0c
* Switched to json formatted characters * Added infrastructure for networking * Minor updates. * more updates for map engine/rendering * More map engine changes and fixes
27 lines
663 B
Go
27 lines
663 B
Go
package d2netpacket
|
|
|
|
import "github.com/OpenDiablo2/OpenDiablo2/d2networking/d2netpacket/d2netpackettype"
|
|
|
|
// TODO: Need to handle being on different maps
|
|
|
|
type MovePlayerPacket struct {
|
|
PlayerId string `json:"playerId"`
|
|
StartX float64 `json:"startX"`
|
|
StartY float64 `json:"startY"`
|
|
DestX float64 `json:"destX"`
|
|
DestY float64 `json:"destY"`
|
|
}
|
|
|
|
func CreateMovePlayerPacket(playerId string, startX, startY, destX, destY float64) NetPacket {
|
|
return NetPacket{
|
|
PacketType: d2netpackettype.MovePlayer,
|
|
PacketData: MovePlayerPacket{
|
|
PlayerId: playerId,
|
|
StartX: startX,
|
|
StartY: startY,
|
|
DestX: destX,
|
|
DestY: destY,
|
|
},
|
|
}
|
|
}
|