Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool Ghosting = true;
- int numberofpackets = 0;
- struct r3dNetPacketHeader
- {
- int EventID;
- //pseudo 2 stronk
- };
- struct PacketQueue
- {
- r3dNetPacketHeader *packetData;
- DWORD *PeerID;
- int PacketSize;
- };
- PacketQueue queue2stronk[512] = {0}; //Should not be more than 512 packets i guess.
- void QueuePackets(DWORD* PeerID, r3dNetPacketHeader* packetData, int packetSize)
- {
- if(Ghosting)
- {
- if(queue2stronk[numberofpackets].PacketSize == 0)
- {
- queue2stronk[numberofpackets].PacketSize = packetSize;
- queue2stronk[numberofpackets].PeerID = PeerID;
- queue2stronk[numberofpackets].packetData = packetData;
- numberofpackets ++;
- }
- else
- {
- queue2stronk[numberofpackets+1].PacketSize = packetSize;
- queue2stronk[numberofpackets+1].PeerID = PeerID;
- queue2stronk[numberofpackets+1].packetData = packetData;
- numberofpackets += 2;
- }
- }
- else
- {
- if(numberofpackets > 0)
- {
- numberofpackets = 0;
- for(int x; x < 512; x++)
- {
- if(queue2stronk[x].PacketSize > 0)
- {
- //SendThePacket
- //Set it to 0
- queue2stronk[x].PacketSize = 0;
- }
- }
- }
- //Send the packet that was passed on to the function
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement