2020-06-13 18:32:09 -04:00
|
|
|
package d2netpacket
|
|
|
|
|
|
|
|
import (
|
2020-06-26 17:12:19 -04:00
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
2020-06-13 18:32:09 -04:00
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2networking/d2netpacket/d2netpackettype"
|
|
|
|
)
|
|
|
|
|
2020-06-29 17:01:26 -04:00
|
|
|
// GenerateMapPacket contains an enumerable representing a region. It
|
|
|
|
// is sent by the server to generate the map for the given region on
|
|
|
|
// a client.
|
2020-06-13 18:32:09 -04:00
|
|
|
type GenerateMapPacket struct {
|
2020-06-26 17:12:19 -04:00
|
|
|
RegionType d2enum.RegionIdType `json:"regionType"`
|
2020-06-13 18:32:09 -04:00
|
|
|
}
|
|
|
|
|
2020-06-29 17:01:26 -04:00
|
|
|
// CreateGenerateMapPacket returns a NetPacket which declares a
|
|
|
|
// GenerateMapPacket with the given regionType.
|
2020-06-26 17:12:19 -04:00
|
|
|
func CreateGenerateMapPacket(regionType d2enum.RegionIdType) NetPacket {
|
2020-06-13 18:32:09 -04:00
|
|
|
return NetPacket{
|
|
|
|
PacketType: d2netpackettype.GenerateMap,
|
|
|
|
PacketData: GenerateMapPacket{
|
2020-06-26 17:12:19 -04:00
|
|
|
RegionType: regionType,
|
2020-06-13 18:32:09 -04:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|