1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-23 15:45:24 +00:00
OpenDiablo2/d2networking/d2netpacket/d2netpackettype/message_type.go
lord 78ecc3557e
simple item spawning in map (#651)
* wip d2items system and item properties

* added loader for TreasureClassEx.txt

* wip item spawn from treasure class records

* wip items

* add call to init item equivalencies, remove treasure class test from d2app

* made item affix records global var a map of affix codes to the records

* changed how item to item common record equivalency is determined

* changed set items records export to a map of their codes to the records, grouped property params into a struct

* changed property parameter field from calcstring to string

* fixed bug in stat value clone

* adding equipper interface as part of stat context, eventually to be used to resolve set bonus (among other things)

* made the item interface simpler, only needs name and description methods

* adding equipper interface, for anything that will equip or have active items

* handle case where min and max are swapped, removed commented code

* added property/stat resolution for magic, rare, set, and unique items

* adding item generator which can roll for items using treasure class records

* fixed item equivalency func being called in the wrong spot

* added item spawning

- added packet type for spawning items
- added client/server handlers for SpawnItem packets
- added map entity for items
- added simpler item provider function in diablo2item package
- added debug terminal command for spawning items
2020-07-30 15:04:05 -04:00

47 lines
2.3 KiB
Go

package d2netpackettype
// NetPacketType is an enum referring to all packet types in package
// d2netpacket.
type NetPacketType uint32
// (Except NetPacket which declares a NetPacketType to specify the packet body
// type. See d2netpackettype.NetPacket.)
//
// Warning
//
// Do NOT re-arrange the order of these packet values unless you want to
// break compatibility between clients of slightly different versions.
// Also note that the packet id is a byte, so if we use more than 256 of
// these then we are doing something very wrong.
const (
UpdateServerInfo NetPacketType = iota // Sent by the server, client sets the given player ID and map seed
GenerateMap // Sent by the server, client generates a map
AddPlayer // Sent by the server, client adds a player
MovePlayer // Sent by client or server, moves a player entity
PlayerConnectionRequest // Sent by the remote client when connecting
PlayerDisconnectionNotification // Sent by the remote client when disconnecting
Ping // Requests a Pong packet
Pong // Responds to a Ping packet
ServerClosed // Sent by the local host when it has closed the server
CastSkill // Sent by client or server, indicates entity casting skill
SpawnItem // Sent by server
)
func (n NetPacketType) String() string {
strings := map[NetPacketType]string{
UpdateServerInfo: "UpdateServerInfo",
GenerateMap: "GenerateMap",
AddPlayer: "AddPlayer",
MovePlayer: "MovePlayer",
PlayerConnectionRequest: "PlayerConnectionRequest",
PlayerDisconnectionNotification: "PlayerDisconnectionNotification",
Ping: "Ping",
Pong: "Pong",
ServerClosed: "ServerClosed",
CastSkill: "CastSkill",
SpawnItem: "SpawnItem",
}
return strings[n]
}