1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-25 00:25:23 +00:00
OpenDiablo2/d2networking/d2netpacket/packet_update_server_info.go
dk d56c4387ff
delint_d2networking (#599)
* delint_d2networking

not sure what to do about lint error G110 on calls to `io.Copy`, warns
about gzip compression bomb possibility, leaving those.

all todo's have been left.

* removed duplicate const
2020-07-17 22:11:16 -04:00

23 lines
724 B
Go

package d2netpacket
import "github.com/OpenDiablo2/OpenDiablo2/d2networking/d2netpacket/d2netpackettype"
// UpdateServerInfoPacket contains the ID for a player and the map seed.
// It is sent by the server to synchronize these values on the client.
type UpdateServerInfoPacket struct {
Seed int64 `json:"seed"`
PlayerID string `json:"playerId"`
}
// CreateUpdateServerInfoPacket returns a NetPacket which declares an
// UpdateServerInfoPacket with the given player ID and map seed.
func CreateUpdateServerInfoPacket(seed int64, playerID string) NetPacket {
return NetPacket{
PacketType: d2netpackettype.UpdateServerInfo,
PacketData: UpdateServerInfoPacket{
Seed: seed,
PlayerID: playerID,
},
}
}