Quote:
Originally Posted by Omdihar
You could hook the sendPacket function and simply compare if the timestamp is less than your last sent packet.
|
Which essentially is the main part of my first suggestion regarding this topic.
Recap what we got so far:
– Hooking send from WinSock2 and queuing all custom packets with a certain priority. Forces you to send your packets from the games main thread or to use mutual exclusion, which is bad. Also forces you to analyze every single packet in a hook before passing them to the original send function.
– Hooking timeGetTime to change the logical time order. Requires you to lock some pipelines.
– Hook send from WinSock2 and have a concurrent queue (with non-blocking pop_front/pop methods) filled with the custom packets from a new thread. Whenever a packet is sent, check for the queue not being empty; then after sending the games packet send the first packet in the queue with the timestamp being increased by one. Also hook timeGetTime and double the result to have at least one free timestamp in between every result of timeGetTime. Creates almost no lag at all, but does not properly work with chat packets as their timestamps need further adjustments.
What I'm doing so far is the following:
I'm mainly using the third way, but whenever I need to send a chat packet, I override my hook temporarily with the first. This only makes the game lag when I'm sending custom chat packets, which almost never happens. Almost lock-free. :-)