|
Public Member Functions |
| ReliabilityLayer () |
| Constructor.
|
| ~ReliabilityLayer () |
| Destructor.
|
void | Reset (void) |
| Resets the layer for reuse.
|
void | SetEncryptionKey (const unsigned char *key) |
void | SetSocket (SOCKET s) |
SOCKET | GetSocket (void) |
void | SetTimeoutTime (unsigned int time) |
unsigned int | GetTimeoutTime (void) |
bool | HandleSocketReceiveFromConnectedPlayer (const char *buffer, int length, PlayerID playerId, BasicDataStructures::List< PluginInterface * > &messageHandlerList) |
int | Receive (char **data) |
bool | Send (char *data, int numberOfBitsToSend, PacketPriority priority, PacketReliability reliability, unsigned char orderingChannel, bool makeDataCopy, int MTUSize, unsigned int currentTime) |
void | Update (SOCKET s, PlayerID playerId, int MTUSize, unsigned int time, BasicDataStructures::List< PluginInterface * > &messageHandlerList) |
bool | IsCheater (void) const |
bool | IsDeadConnection (void) const |
void | KillConnection (void) |
| Causes IsDeadConnection to return true.
|
void | SetPing (unsigned int i) |
RakNetStatisticsStruct *const | GetStatistics (void) |
bool | IsDataWaiting (void) |
| Are we waiting for any data to be sent out or be processed by the player?
|
void | ApplyNetworkSimulator (unsigned short _maxPacketsOnWire, unsigned short _minExtraPing, unsigned short _extraPingVariance) |
bool | IsNetworkSimulatorActive (void) |
Private Member Functions |
bool | IsDatagramReady (unsigned int time, int MTUSize) |
void | GenerateDatagram (RakNet::BitStream *output, int MTUSize, bool *reliableDataSent, unsigned int time, PlayerID playerId, BasicDataStructures::List< PluginInterface * > &messageHandlerList) |
void | SendBitStream (SOCKET s, PlayerID playerId, RakNet::BitStream *bitStream) |
int | WriteToBitStreamFromInternalPacket (RakNet::BitStream *bitStream, const InternalPacket *const internalPacket) |
| Parse an internalPacket and create a bitstream to represent this dataReturns number of bits used.
|
InternalPacket * | CreateInternalPacketFromBitStream (RakNet::BitStream *bitStream, unsigned int time) |
| Parse a bitstream and create an internal packet to represent this data.
|
void | RemovePacketFromResendQueueAndDeleteOlderReliableSequenced (const MessageNumberType messageNumber, unsigned int time) |
| Does what the function name says.
|
void | SendAcknowledgementPacket (const MessageNumberType messageNumber, unsigned int time) |
| Acknowledge receipt of the packet with the specified messageNumber.
|
bool | IsSendThrottled (int MTUSize) |
| This will return true if we should not send at this time.
|
void | UpdateWindowFromPacketloss (unsigned int time) |
| We lost a packet.
|
void | UpdateWindowFromAck (unsigned int time) |
| Increase the window size.
|
int | GetBitStreamHeaderLength (const InternalPacket *const internalPacket) |
| Parse an internalPacket and figure out how many header bits would be written. Returns that number.
|
void | GetSHA1 (unsigned char *const buffer, unsigned int nbytes, char code[SHA1_LENGTH]) |
| Get the SHA1 code.
|
bool | CheckSHA1 (char code[SHA1_LENGTH], unsigned char *const buffer, unsigned int nbytes) |
| Check the SHA1 code.
|
void | DeleteSequencedPacketsInList (unsigned char orderingChannel, BasicDataStructures::List< InternalPacket * > &theList, int splitPacketId=-1) |
| Search the specified list for sequenced packets on the specified ordering channel, optionally skipping those with splitPacketId, and delete them.
|
void | DeleteSequencedPacketsInList (unsigned char orderingChannel, BasicDataStructures::Queue< InternalPacket * > &theList) |
| Search the specified list for sequenced packets with a value less than orderingIndex and delete them.
|
bool | IsOlderOrderedPacket (OrderingIndexType newPacketOrderingIndex, OrderingIndexType waitingForPacketOrderingIndex) |
| Returns true if newPacketOrderingIndex is older than the waitingForPacketOrderingIndex.
|
void | SplitPacket (InternalPacket *internalPacket, int MTUSize) |
| Split the passed packet into chunks under MTU_SIZE bytes (including headers) and save those new chunks.
|
void | InsertIntoSplitPacketList (InternalPacket *internalPacket) |
| Insert a packet into the split packet list.
|
InternalPacket * | BuildPacketFromSplitPacketList (unsigned int splitPacketId, unsigned int time) |
| Take all split chunks with the specified splitPacketId and try to reconstruct a packet. If we can, allocate and return it. Otherwise return 0.
|
void | DeleteOldUnreliableSplitPackets (unsigned int time) |
| Delete any unreliable split packets that have long since expired.
|
InternalPacket * | CreateInternalPacketCopy (InternalPacket *original, int dataByteOffset, int dataByteLength, unsigned int time) |
BasicDataStructures::LinkedList<
InternalPacket * > * | GetOrderingListAtOrderingStream (unsigned char orderingChannel) |
| Get the specified ordering list.
|
void | AddToOrderingList (InternalPacket *internalPacket) |
| Add the internal packet to the ordering list in order based on order index.
|
void | InsertPacketIntoResendQueue (InternalPacket *internalPacket, unsigned int time, bool makeCopyOfInternalPacket, bool firstResend) |
| Inserts a packet into the resend list in order.
|
void | FreeMemory (bool freeAllImmediately) |
| Memory handling.
|
void | FreeThreadedMemory (void) |
| Memory handling.
|
void | FreeThreadSafeMemory (void) |
| Memory handling.
|
void | InitializeVariables (void) |
bool | IsExpiredTime (unsigned int input, unsigned int currentTime) const |
| Given the current time, is this time so old that we should consider it a timeout?
|
unsigned int | GetResendQueueDataSize (void) const |
| How many elements are waiting to be resent?
|
void | UpdateThreadedMemory (void) |
| Update all memory which is not threadsafe.
|
Private Attributes |
BasicDataStructures::List<
InternalPacket * > | splitPacketList |
BasicDataStructures::List<
BasicDataStructures::LinkedList<
InternalPacket * > * > | orderingList |
BasicDataStructures::Queue<
InternalPacket * > | acknowledgementQueue |
BasicDataStructures::Queue<
InternalPacket * > | outputQueue |
BasicDataStructures::Queue<
InternalPacket * > | resendQueue |
BasicDataStructures::Queue<
InternalPacket * > | sendPacketSet [NUMBER_OF_PRIORITIES] |
MessageNumberType | messageNumber |
unsigned int | lastAckTime |
RakNet::BitStream | updateBitStream |
OrderingIndexType | waitingForOrderedPacketWriteIndex [NUMBER_OF_ORDERED_STREAMS] |
OrderingIndexType | waitingForSequencedPacketWriteIndex [NUMBER_OF_ORDERED_STREAMS] |
OrderingIndexType | waitingForOrderedPacketReadIndex [NUMBER_OF_ORDERED_STREAMS] |
OrderingIndexType | waitingForSequencedPacketReadIndex [NUMBER_OF_ORDERED_STREAMS] |
bool | deadConnection |
bool | cheater |
unsigned int | ping |
unsigned int | splitPacketId |
unsigned int | timeoutTime |
unsigned int | blockWindowIncreaseUntilTime |
RakNetStatisticsStruct | statistics |
BasicDataStructures::Queue<
unsigned > | hasReceivedPacketQueue |
MessageNumberType | receivedPacketsBaseIndex |
bool | resetReceivedPackets |
unsigned int | windowSize |
unsigned int | lastPacketLossTime |
| Limit how fast the window can drop, so many fast resends doesn't drop the window to nothing immediately.
|
unsigned int | lastWindowDropTime |
unsigned int | lastWindowIncreaseTime |
DataBlockEncryptor | encryptor |
unsigned | sendPacketCount |
unsigned | receivePacketCount |
bool | freeThreadedMemoryOnNextUpdate |
| This variable is so that free memory can be called by only theupdate thread so we don't have to mutex things so much.
|
BasicDataStructures::List<
DataAndTime * > | delayList |
unsigned short | maxPacketsOnWire |
unsigned short | minExtraPing |
unsigned short | extraPingVariance |
InternalPacketPool | internalPacketPool |
Classes |
struct | DataAndTime |