This is the code I wrote:
http://pastebin.com/LYX6YzA5
My method
I assign a ID of the current packet that is being read on every address that is connected to the UDP packet manager
If I receive a packet whose ID is the current packet count + 1 then my code will read this packet, otherwise it will be added into a queue.
The general problem I'm having is that as there are more in coming packets from different IP addresses, the Lua script needs to make more tables for each address and I can't know when to remove each table (in other words, when they have disconnected).
Is there any better way to sort the received packets from different addresses?
1× editiert, zuletzt 08.12.14 01:11:37