nsetzer / mpgameserver

Python Multiplayer UDP Game Server
GNU Lesser General Public License v2.1
43 stars 6 forks source link

repeated messages #10

Open joshms123 opened 4 months ago

joshms123 commented 4 months ago

Hello, I have created a game with this library; however, my users are reporting an odd issue. Sometimes, I'm guessing if the network is unreliable, the users are receiving some messages multiple times, until they are eventually disconnected. This also seems to cause the server some lag. Also some reliable messages are out of order, but that only seemed to start happening when I switched from 21 to 23. Is there any way I can debug this and figure out what is going on? Thanks in advance.

nsetzer commented 4 months ago

The reliable messaging only ensures that the message will be delivered. In situations with poor network connectivity this could increase the number of duplicate messages. For example if the round trip time is greater than the timeout for resending the un-ack'd message. The seqnum can be used to check the order of messages and whether it's a duplicate. Unfortunately I still haven't come up with a design I'm happy with to implement in the library itself. If you give me a link to the code maybe I can review it.

On Fri, Mar 1, 2024, 3:34 PM joshms123 @.***> wrote:

Hello, I have created a game with this library; however, my users are reporting an odd issue. Sometimes, I'm guessing if the network is unreliable, the users are receiving some messages multiple times, until they are eventually disconnected. This also seems to cause the server some lag. Also some reliable messages are out of order, but that only seemed to start happening when I switched from 21 to 23. Is there any way I can debug this and figure out what is going on? Thanks in advance.

— Reply to this email directly, view it on GitHub https://github.com/nsetzer/mpgameserver/issues/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACB7TC2ASF3IYNHU73V34GTYWDQ4ZAVCNFSM6AAAAABECLSHAKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3DIMJTGIYDKOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

joshms123 commented 4 months ago

Hi there, Thanks for the quick response! I figured it did have duplicate message provention; my bad. In the readme it says: Reject duplicate datagrams, and duplicate messages. Also in the docs: When using one of the retry modes, it is possible for the same message to be included in multiple datagrams. The protocol automatically detects and drops duplicate messages. I don't mind if it doesn't, I'm just not sure what this means otherwise. My server engine code is currently private, but can send parts somewhere if you'd like to take a look. Thanks for any help in advance.