29 #ifndef __MSGCHANNEL_H__
30 #define __MSGCHANNEL_H__
48 #define MAX_MESSAGE_SIZE 16384 // max length of a message, which may
50 #define CONNECTIONLESS_MESSAGE_ID -1 // id for connectionless messages
51 #define CONNECTIONLESS_MESSAGE_ID_MASK 0x7FFF // value to mask away connectionless message id
53 #define MAX_MSG_QUEUE_SIZE 16384 // must be a power of 2
60 void Init(
int sequence );
63 bool Get(
byte *data,
int &size );
198 void UpdatePacketLoss(
const int time,
const int numReceived,
const int numDropped );
void WriteData(const byte *data, const int size)
void UpdateIncomingRate(const int time, const int size)
int SendMessage(idPort &port, const int time, const idBitMsg &msg)
void ReadData(byte *data, const int size)
bool Process(const netadr_t from, int time, idBitMsg &msg, int &sequence)
float outgoingCompression
void SetMaxOutgoingRate(int rate)
int GetOutgoingRate(void) const
byte unsentBuffer[MAX_MESSAGE_SIZE]
int incomingPacketLossTime
bool SendReliableMessage(const idBitMsg &msg)
void Init(const netadr_t adr, const int id)
idCompressor * compressor
byte fragmentBuffer[MAX_MESSAGE_SIZE]
void SendNextFragment(idPort &port, const int time)
idMsgQueue reliableReceive
netadr_t GetRemoteAddress(void) const
void CopyToBuffer(byte *buf) const
float incomingDroppedPackets
int GetTotalSize(void) const
bool GetReliableMessage(idBitMsg &msg)
bool Get(byte *data, int &size)
GLsizei GLsizei GLenum GLenum const GLvoid * data
void ClearReliableMessages(void)
bool ReadyToSend(const int time) const
float incomingCompression
float GetIncomingCompression(void) const
void UpdatePacketLoss(const int time, const int numReceived, const int numDropped)
float incomingReceivedPackets
bool ReadMessageData(idBitMsg &out, const idBitMsg &msg)
bool UnsentFragmentsLeft(void) const
int GetIncomingRate(void) const
float GetIncomingPacketLoss(void) const
bool Add(const byte *data, const int size)
int GetMaxOutgoingRate(void)
int GetSpaceLeft(void) const
void UpdateOutgoingRate(const int time, const int size)
#define MAX_MSG_QUEUE_SIZE
void WriteMessageData(idBitMsg &out, const idBitMsg &msg)
float GetOutgoingCompression(void) const