Page 2 of 2

Re: lua-enet only sending some messages

Posted: Thu Aug 05, 2021 2:59 pm
by mxmlnbndsmnn
zorg wrote: Thu Aug 05, 2021 2:22 pm effectively, i think you're discarding every other event (since, you know, the loop repeats and you lose an event by getting one both at the start and the end...)

Get rid of that last "event = self.host:service()" line from both client and server and test it out.
You're the hero! This is exactly where it went wrong. Thanks bunches ;)

In hindsight this double event = ... was suspicious from the start. However, I started from this tutorial: https://love2d.org/wiki/lua-enet and there the event is fetched twice. BUT only now I see that they used a while loop in this tutorial, while I used a repeat loop... (facepalm)
But you know, this happens. I guess :c

Re: lua-enet only sending some messages

Posted: Thu Aug 05, 2021 3:10 pm
by zorg
yeah, for some reason, the "example code" does an initial service call with a sizeable timeout; it's not actually part of a loop (since the outer infinite loop is actually akin to löve's own "game loop"... kinda? the event loop only calls it at the end, but it's fine if it's done in the beginning... i actually do prefer that version myself as well, what i suggested.