However it is now my opinion that this step was too little towards what needs to be done.
It is my belief that we need ALL packets to be a part of a single que. This que is populated by a call to a function that would look something like: QueuePacket( UI16 packetNum, void *extInfo, CSocket *sendTo );
My thoughts on how this would work are as follows.
Code: Select all
std::map< void *object, CPacketQueue > packetQueue;
class CPacketQueue
{
std::map< UI16 packet, CSocket *sendTo > sendList;
};
Code: Select all
std::map< void *object, CPacketQueue >::const_iterator pQIter = packetQueue.begin();
std::map< void *object, CPacketQueue >::const_iterator pQEnd = packetQueue.end();
while( pQIter != pQEnd )
{
std::map< UI16 packet, CSocket *sendTo >::const_iterator sLIter = pQIter->second.sendList.begin();
std::map< UI16 packet, CSocket *sendTo >::const_iterator sLEnd = pQIter->second.sendList.end();
while( sLIter != sLEnd )
{
CallPacket( pQIter->first, sLIter->first, sLIter->second );
++sLIter;
}
sendList.clear();
++pQIter;
}
packetQueue.clear();
This is still a VERY rough idea, and one that I only began thinking about last evening when working on the packet issues with the latest client. I have not done any testing and really don't know that this will even work. Mostly I would like feedback and criticism of this method of packet queueing, or thoughts on other ways to accomplish the same goal.
Thanks.