Documentation
¶
Index ¶
Constants ¶
const ( NcmdExit = 0x80000000 NcmdRetransmit = 0x40000000 NcmdSetup = 0x20000000 NcmdKill = 0x10000000 NcmdChecksum = 0x0fffffff )
Variables ¶
var (
ErrShortPacket = errors.New("packet too short")
)
Functions ¶
func ExpandTicNum ¶
ExpandTicNum takes the low byte of a tic number and "expands" it back to a 32-bit value, using the base parameter as a reference.
func GamePacketChecksum ¶
GamePacketChecksum calculates the checksum for a marshaled GamePacket; it should be called with the first four bytes stripped.
Types ¶
type GamePacket ¶
type GamePacket struct {
Checksum uint32
RetransmitFrom byte
StartTic byte
Player byte
NumTics byte
Commands []byte
}
GamePacket contains a decoded form of the data found in Doom's network protocol messages. This layer is used in all Doom games and is not specific to just IPX games.
func (*GamePacket) MarshalBinary ¶
func (p *GamePacket) MarshalBinary() ([]byte, error)
func (*GamePacket) UnmarshalBinary ¶
func (p *GamePacket) UnmarshalBinary(data []byte) error
func (*GamePacket) UpdateChecksum ¶
func (p *GamePacket) UpdateChecksum()
UpdateChecksum updates the Checksum field of the given GamePacket. The high bits that store additional information (setup, retransmit, etc.) are left untouched.
type IPXPacket ¶
IPXPacket contains a decoded form of the wrapper format used for Doom IPX packets.
func (*IPXPacket) MarshalBinary ¶
func (*IPXPacket) UnmarshalBinary ¶
type Payload ¶
type Payload interface {
encoding.BinaryMarshaler
encoding.BinaryUnmarshaler
}
type SetupPacket ¶
type SetupPacket struct {
GameID uint16
Drone uint16
NodesFound uint16
NodesWanted uint16
Extra []byte
}
SetupPacket contains a decoded form of the data found in Doom IPX setup packets. These are messages generated and interpreted by the ipxsetup.exe network driver.
func (*SetupPacket) MarshalBinary ¶
func (p *SetupPacket) MarshalBinary() ([]byte, error)
func (*SetupPacket) UnmarshalBinary ¶
func (p *SetupPacket) UnmarshalBinary(data []byte) error