mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-12-27 12:36:38 -05:00
31 lines
941 B
Go
31 lines
941 B
Go
package d2netpacket
|
|
|
|
import (
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2inventory"
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2networking/d2netpacket/d2netpackettype"
|
|
)
|
|
|
|
type AddPlayerPacket struct {
|
|
Id string `json:"id"`
|
|
Name string `json:"name"`
|
|
X int `json:"x"`
|
|
Y int `json:"y"`
|
|
HeroType d2enum.Hero `json:"hero"`
|
|
Equipment d2inventory.CharacterEquipment `json:"equipment"`
|
|
}
|
|
|
|
func CreateAddPlayerPacket(id, name string, x, y int, heroType d2enum.Hero, equipment d2inventory.CharacterEquipment) NetPacket {
|
|
return NetPacket{
|
|
PacketType: d2netpackettype.AddPlayer,
|
|
PacketData: AddPlayerPacket{
|
|
Id: id,
|
|
Name: name,
|
|
X: x,
|
|
Y: y,
|
|
HeroType: heroType,
|
|
Equipment: equipment,
|
|
},
|
|
}
|
|
}
|