#implementing a packet queue

9 messages · Page 1 of 1 (latest)

median torrent
#

Hello, I was trying to implement a packet queue in a primitive form, and while it should be working, I'm having issues with it. Could somebody help?

#

Whenever I receive a packet, I add it to my queue

#

Then, on every render tick, I iterate the entire packetQueue array, calling handlePacket on the packet if it's an S2C, or sendPacketSilently if its a C2S. (and removing the element from the array after sending it)

#

The debug logs show that the packets successfully get applied in the same order that they were originally sent

#

Yet the server will always disconnect the client very quickly after enabling this.

When trying to connect to a server with this queue, it will either say "Disconnected" or "Invalid move packet"

when enabling the queue while already on the server, it gets kicked with "Timed out" after a few seconds

#

what could I be doing wrong here?

median torrent
#

i am 100% sure it should work, i'm, using the correct functions