Planeshift
|
The structure of 1 queue entry (pointer to a message) More...
#include <message.h>
Public Member Functions | |
void | Add (const char *str) |
Add a string to the current psMessageBytes buffer. | |
void | Add (const float f) |
Add a float to the current psMessageBytes buffer. | |
void | Add (const uint16_t s) |
Add a double the current psMessageBytes buffer. | |
void | Add (const bool b) |
Add bool to current psMessageBytes buffer. | |
void | Add (const csVector2 &v) |
Add an x,y vector to the buffer. | |
void | Add (const csVector3 &v) |
Add an x,y,z vector to the buffer. | |
void | Add (const csVector4 &v) |
Add an x,y,z,w vector to the buffer. | |
void | Add (const int16_t s) |
Add signed 16 bit int to current psMessageBytes buffer. | |
void | Add (const iSector *sector, const csStringSet *msgstrings, const csStringHashReversible *msgstringshash=NULL) |
void | Add (const iSector *sector) |
void | Add (const int32_t i) |
Add unsigned 32Bit Int to current psMessageBytes buffer. | |
void | Add (const void *datastream, const uint32_t length) |
Add a processed buffer of some kind; should only be used by files and the like. | |
void | Add (const uint32_t i) |
Add unsigned 4byte int to current psMessageBytes buffer. | |
void | Add (const uint8_t i) |
Add 8bit unsigned int to current psMessageBytes buffer. | |
void | Add (const int8_t i) |
Add 8 bit signed int to buffer. | |
void | AddPointer (const uintptr_t i) |
Add a pointer to the current psMessageBytes buffer. Pointers must never be sent over the network! | |
void | ClipToCurrentSize () |
bool | GetBool () |
Get a bool from the current psMessageBytes buffer. | |
void * | GetBufferPointerUnsafe (uint32_t &length) |
float | GetFloat () |
Get a float from the current psMessageBytes buffer. | |
int16_t | GetInt16 () |
Get a signed 16bit Integer from the current psMessageBytes buffer. | |
int32_t | GetInt32 () |
Get a signed 32Bit Integer from the current psMessageBytes buffer. | |
int8_t | GetInt8 () |
Get a signed 8bit Integer from the current psMessageBytes buffer. | |
bool | GetPending () |
uintptr_t | GetPointer () |
Get a pointer from the current psMessageBytes buffer. Pointers must never be sent over the network! | |
iSector * | GetSector (const csStringSet *msgstrings, const csStringHashReversible *msgstringshash, iEngine *engine) |
iSector * | GetSector () |
int | GetSequenceNumber () |
size_t | GetSize () |
Return the size of the databuffer. | |
const char * | GetStr () |
Get a null-terminated string from the current psMessageBytes buffer. | |
uint8_t | GetType () |
uint16_t | GetUInt16 () |
Get a unsigned 16bit Integer from the curren psMessageBytes buffer. | |
uint32_t | GetUInt32 () |
Get an unsigned 4byte int from the current psMessageBytes buffer. | |
uint8_t | GetUInt8 () |
Get an unsigned 8Bit Integer from the current psMessageBytes buffer. | |
csVector2 | GetVector2 () |
csVector3 | GetVector3 () |
csVector4 | GetVector4 () |
bool | HasMore (int howMuchMore=1) |
Check if we have more data in the current psMessageBytes buffer. | |
bool | IsEmpty () |
Check if we are at the end of the current psMessageBytes buffer. | |
MsgEntry (const psMessageBytes *msg) | |
MsgEntry (size_t datasize=0, uint8_t msgpriority=PRIORITY_HIGH, uint8_t sequence=0) | |
MsgEntry (const MsgEntry *me) | |
void | Reset (int pos=0) |
void | SetPending (bool) |
void | SetType (uint8_t type) |
virtual | ~MsgEntry () |
Public Attributes | |
psMessageBytes * | bytes |
The message itself ie one block of memory with the header and data following. | |
uint32_t | clientnum |
The Number of the client the Message is from/goes to. | |
size_t | current |
The current position for Pushing and Popping. | |
uint32_t | msgid |
Unique identifier per machine. | |
bool | overrun |
Indicates wether a read or write overrun has occured. | |
uint8_t | priority |
The priority this message should be handled. |
MsgEntry::MsgEntry | ( | size_t | datasize = 0 , |
uint8_t | msgpriority = PRIORITY_HIGH , |
||
uint8_t | sequence = 0 |
||
) | [inline] |
MsgEntry::MsgEntry | ( | const psMessageBytes * | msg | ) | [inline] |
void MsgEntry::Add | ( | const char * | str | ) | [inline] |
Add a string to the current psMessageBytes buffer.
void MsgEntry::Add | ( | const float | f | ) | [inline] |
Add a float to the current psMessageBytes buffer.
void MsgEntry::Add | ( | const uint32_t | i | ) | [inline] |
Add unsigned 4byte int to current psMessageBytes buffer.
void MsgEntry::Add | ( | const iSector * | sector, |
const csStringSet * | msgstrings, | ||
const csStringHashReversible * | msgstringshash = NULL |
||
) | [inline] |
void MsgEntry::Add | ( | const iSector * | sector | ) |
void MsgEntry::Add | ( | const void * | datastream, |
const uint32_t | length | ||
) | [inline] |
void MsgEntry::Add | ( | const uint16_t | s | ) | [inline] |
Add a double the current psMessageBytes buffer.
Add unsigned 16 bit int to current psMessageBytes buffer
void MsgEntry::Add | ( | const uint8_t | i | ) | [inline] |
Add 8bit unsigned int to current psMessageBytes buffer.
void MsgEntry::Add | ( | const int8_t | i | ) | [inline] |
void MsgEntry::Add | ( | const int16_t | s | ) | [inline] |
Add signed 16 bit int to current psMessageBytes buffer.
void MsgEntry::Add | ( | const bool | b | ) | [inline] |
Add bool to current psMessageBytes buffer.
void MsgEntry::Add | ( | const csVector2 & | v | ) | [inline] |
void MsgEntry::Add | ( | const int32_t | i | ) | [inline] |
Add unsigned 32Bit Int to current psMessageBytes buffer.
void MsgEntry::Add | ( | const csVector3 & | v | ) | [inline] |
void MsgEntry::Add | ( | const csVector4 & | v | ) | [inline] |
void MsgEntry::AddPointer | ( | const uintptr_t | i | ) | [inline] |
Add a pointer to the current psMessageBytes buffer. Pointers must never be sent over the network!
bool MsgEntry::GetBool | ( | ) | [inline] |
Get a bool from the current psMessageBytes buffer.
void* MsgEntry::GetBufferPointerUnsafe | ( | uint32_t & | length | ) | [inline] |
float MsgEntry::GetFloat | ( | ) | [inline] |
Get a float from the current psMessageBytes buffer.
int16_t MsgEntry::GetInt16 | ( | ) | [inline] |
Get a signed 16bit Integer from the current psMessageBytes buffer.
int32_t MsgEntry::GetInt32 | ( | ) | [inline] |
Get a signed 32Bit Integer from the current psMessageBytes buffer.
int8_t MsgEntry::GetInt8 | ( | ) | [inline] |
Get a signed 8bit Integer from the current psMessageBytes buffer.
uintptr_t MsgEntry::GetPointer | ( | ) | [inline] |
Get a pointer from the current psMessageBytes buffer. Pointers must never be sent over the network!
iSector* MsgEntry::GetSector | ( | const csStringSet * | msgstrings, |
const csStringHashReversible * | msgstringshash, | ||
iEngine * | engine | ||
) | [inline] |
iSector* MsgEntry::GetSector | ( | ) |
size_t MsgEntry::GetSize | ( | ) | [inline] |
const char* MsgEntry::GetStr | ( | ) | [inline] |
Get a null-terminated string from the current psMessageBytes buffer.
uint16_t MsgEntry::GetUInt16 | ( | ) | [inline] |
Get a unsigned 16bit Integer from the curren psMessageBytes buffer.
uint32_t MsgEntry::GetUInt32 | ( | ) | [inline] |
Get an unsigned 4byte int from the current psMessageBytes buffer.
uint8_t MsgEntry::GetUInt8 | ( | ) | [inline] |
Get an unsigned 8Bit Integer from the current psMessageBytes buffer.
bool MsgEntry::HasMore | ( | int | howMuchMore = 1 | ) | [inline] |
Check if we have more data in the current psMessageBytes buffer.
bool MsgEntry::IsEmpty | ( | ) | [inline] |
Check if we are at the end of the current psMessageBytes buffer.
uint32_t MsgEntry::clientnum |
size_t MsgEntry::current |
uint32_t MsgEntry::msgid |
bool MsgEntry::overrun |
uint8_t MsgEntry::priority |