2020-06-13 18:32:09 -04:00
|
|
|
package d2netpacket
|
|
|
|
|
|
|
|
import "github.com/OpenDiablo2/OpenDiablo2/d2networking/d2netpacket/d2netpackettype"
|
|
|
|
|
2020-06-29 17:01:26 -04:00
|
|
|
// UpdateServerInfoPacket contains the ID for a player and the map seed.
|
2020-07-17 22:11:16 -04:00
|
|
|
// It is sent by the server to synchronize these values on the client.
|
2020-06-13 18:32:09 -04:00
|
|
|
type UpdateServerInfoPacket struct {
|
|
|
|
Seed int64 `json:"seed"`
|
2020-07-17 22:11:16 -04:00
|
|
|
PlayerID string `json:"playerId"`
|
2020-06-13 18:32:09 -04:00
|
|
|
}
|
|
|
|
|
2020-06-29 17:01:26 -04:00
|
|
|
// CreateUpdateServerInfoPacket returns a NetPacket which declares an
|
|
|
|
// UpdateServerInfoPacket with the given player ID and map seed.
|
2020-07-17 22:11:16 -04:00
|
|
|
func CreateUpdateServerInfoPacket(seed int64, playerID string) NetPacket {
|
2020-06-13 18:32:09 -04:00
|
|
|
return NetPacket{
|
|
|
|
PacketType: d2netpackettype.UpdateServerInfo,
|
|
|
|
PacketData: UpdateServerInfoPacket{
|
|
|
|
Seed: seed,
|
2020-07-17 22:11:16 -04:00
|
|
|
PlayerID: playerID,
|
2020-06-13 18:32:09 -04:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|