Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Ult::Packet Class Reference

#include <Packet.h>

Public Member Functions

 Packet (NetPacketValue usage, NetPacketValue id, const char *data, int size)
 
 ~Packet ()
 
int GetPacketSize () const
 
NetPacketValue GetUsage () const
 
NetPacketValue GetId () const
 
NetPacketValueGetData ()
 
int GetDataSize ()
 

Detailed Description

Wraps data to be sent over the network.

Constructor & Destructor Documentation

◆ Packet()

Ult::Packet::Packet ( NetPacketValue usage,
NetPacketValue id,
const char * data,
int size )

Packet constructor.

Parameters
usageCategory value for the packet, e.g. NetSystemUsage or custom.
idIdentifier/Type value for the packet, e.g. NetMsgType.
dataPacket data bytes, max length is MAX_PACKET_SIZE. Copied internally.
sizeThe number of packet data bytes.

◆ ~Packet()

Ult::Packet::~Packet ( )

Packet destructor.

Member Function Documentation

◆ GetData()

NetPacketValue * Ult::Packet::GetData ( )
inline

Returns a pointer to the packet data.

◆ GetDataSize()

int Ult::Packet::GetDataSize ( )

Returns the size of the packet data in bytes.

◆ GetId()

NetPacketValue Ult::Packet::GetId ( ) const
inline

Returns the packet Id type value.

◆ GetPacketSize()

int Ult::Packet::GetPacketSize ( ) const
inline

Returns the size in bytes of 1 Packet instance.

◆ GetUsage()

NetPacketValue Ult::Packet::GetUsage ( ) const
inline

Returns the packet usage value.


The documentation for this class was generated from the following files: