bartbes / love-misc-libs

Just some random libs I have lying around, now with version control!
http://docs.bartbes.com
110 stars 28 forks source link

UDP client id management error #11

Closed meoiswa closed 11 years ago

meoiswa commented 11 years ago

When using udp protocol, if clients with id less than other clients disconnect, the server stops recognizing from which client each package come successfully. For example, if clients 1,2 and 3 are connected, and client 1 drops, all packages coming in from clients 2 and 3 come with id 0

This error is very easilly solved by changing "for i, v in ipairs(self.clients) do" to "for i, v in pairs(self.clients) do" in line 524ish since the function ipairs will stop iterating if it finds a missing index.

bartbes commented 11 years ago

You must be using an outdated version, there is no line 524, nor an occurrence of ipairs.

meoiswa commented 11 years ago

Oh, shame on me, I'm using a heavily outdated version!