Closed leegao closed 13 years ago
Example implementation of how to use a send queue for packet throttling and delayed packet sending is in the experimental branch, I'm testing it right now.
Tested and works in the latest version, a few sends not using SendPlayer will need to be added.
added and closed
We can use a queue to keep track of future events and whatever and check these event queues at the end of each main loop to determine if anything needs to be done (sort of like a timer). We should also be able to insert the items/data in arbitrary order (ie, we have an event in a few seconds and another in around an hour such as a map change in the queue, we then insert another event taking place in a few minutes such as a round change, these would all go into the right position)
I've already implemented this queue using a heap structure and tested it (naively).