Planeshift
Public Member Functions | Static Public Member Functions | Public Attributes

psNetPacket Struct Reference

psNetPacket gives the networking code the context it needs, and all of this info goes out on the wire. More...

#include <netpacket.h>

List of all members.

Public Member Functions

size_t GetPacketSize () const
uint8_t GetPriority () const
uint8_t GetSequence () const
bool IsMultiPacket () const
void MarshallEndian ()
void UnmarshallEndian ()

Static Public Member Functions

static struct psNetPacketNetPacketFromBuffer (void *buffer, int buffer_length)

Public Attributes

char data [0]
 this can be used as a pointer to the data
uint8_t flags
 Each packet needs to know its own priority.
uint32_t msgsize
uint32_t offset
 offset and size together specify a memory block within the psMessageBytes struct
uint32_t pktid
 each packet must know what message it's a part of this should be 0 in most cases as it's assigned at the last minute when sending depending on the connection it's sent on.
uint16_t pktsize

Detailed Description

psNetPacket gives the networking code the context it needs, and all of this info goes out on the wire.

None of NetPacketEntry's info goes on the wire. A packet is exactly one udp packet that goes over the net, you can embed multiple messages in one packet or you can split up one message over multiple packets

Definition at line 55 of file netpacket.h.


Member Function Documentation

size_t psNetPacket::GetPacketSize ( ) const [inline]

Definition at line 78 of file netpacket.h.

uint8_t psNetPacket::GetPriority ( ) const [inline]

Definition at line 91 of file netpacket.h.

uint8_t psNetPacket::GetSequence ( ) const [inline]

Definition at line 96 of file netpacket.h.

bool psNetPacket::IsMultiPacket ( ) const [inline]

Definition at line 86 of file netpacket.h.

void psNetPacket::MarshallEndian ( ) [inline]

Definition at line 101 of file netpacket.h.

static struct psNetPacket* psNetPacket::NetPacketFromBuffer ( void *  buffer,
int  buffer_length 
) [inline, static, read]

Definition at line 123 of file netpacket.h.

void psNetPacket::UnmarshallEndian ( ) [inline]

Definition at line 109 of file netpacket.h.


Member Data Documentation

this can be used as a pointer to the data

Definition at line 75 of file netpacket.h.

Each packet needs to know its own priority.

This is stuck on the end to minimize alignment penalties

Definition at line 72 of file netpacket.h.

Definition at line 67 of file netpacket.h.

offset and size together specify a memory block within the psMessageBytes struct

Definition at line 66 of file netpacket.h.

each packet must know what message it's a part of this should be 0 in most cases as it's assigned at the last minute when sending depending on the connection it's sent on.

Definition at line 61 of file netpacket.h.

Definition at line 68 of file netpacket.h.


The documentation for this struct was generated from the following file: