Shadowrun: Awakened 29 September 2011 - Build 871
InternalPacket.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef __INTERNAL_PACKET_H
00019 #define __INTERNAL_PACKET_H
00020 
00021 #include "PacketPriority.h"
00022 #include "RakNetTypes.h"
00023 #include "RakMemoryOverride.h"
00024 #include "RakNetDefines.h"
00025 #include "NativeTypes.h"
00026 #include "RakNetDefines.h"
00027 #if USE_SLIDING_WINDOW_CONGESTION_CONTROL!=1
00028 #include "CCRakNetUDT.h"
00029 #else
00030 #include "CCRakNetSlidingWindow.h"
00031 #endif
00032 
00033 namespace RakNet {
00034 
00035 typedef uint16_t SplitPacketIdType;
00036 typedef uint32_t SplitPacketIndexType;
00037 
00040 typedef uint24_t MessageNumberType;
00041 
00044 typedef MessageNumberType OrderingIndexType;
00045 
00046 typedef RakNet::TimeUS RemoteSystemTimeType;
00047 
00048 struct InternalPacketFixedSizeTransmissionHeader
00049 {
00051     MessageNumberType reliableMessageNumber;
00053     OrderingIndexType orderingIndex;
00054     // Used only with sequenced messages
00055     OrderingIndexType sequencingIndex;
00057     unsigned char orderingChannel;
00059     SplitPacketIdType splitPacketId;
00061     SplitPacketIndexType splitPacketIndex;
00063     SplitPacketIndexType splitPacketCount;;
00065     BitSize_t dataBitLength;
00067     PacketReliability reliability;
00068     // Not endian safe
00069     // unsigned char priority : 3;
00070     // unsigned char reliability : 5;
00071 };
00072 
00074 struct InternalPacketRefCountedData
00075 {
00076     unsigned char *sharedDataBlock;
00077     unsigned int refCount;
00078 };
00079 
00082 struct InternalPacket : public InternalPacketFixedSizeTransmissionHeader
00083 {
00085     MessageNumberType messageInternalOrder;
00089     bool messageNumberAssigned;
00091 //  bool allowWindowUpdate;
00093     RakNet::TimeUS creationTime;
00095     RakNet::TimeUS nextActionTime;
00096     // Size of the header when encoded into a bitstream
00097     BitSize_t headerLength;
00099     unsigned char *data;
00101     enum AllocationScheme
00102     {
00104         NORMAL,
00105 
00107         REF_COUNTED,
00108     
00111         STACK
00112     } allocationScheme;
00113     InternalPacketRefCountedData *refCountedData;
00115 //  unsigned char timesSent;
00117     PacketPriority priority;
00119     uint32_t sendReceiptSerial;
00120 
00121     // Used for the resend queue
00122     // Linked list implementation so I can remove from the list via a pointer, without finding it in the list
00123     InternalPacket *resendPrev, *resendNext,*unreliablePrev,*unreliableNext;
00124 
00125     unsigned char stackData[128];
00126 };
00127 
00128 } // namespace RakNet
00129 
00130 #endif
00131 

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net