TheHunterManX / GBA-PK-multiplayer

Other
169 stars 35 forks source link

[BUG]: Server script breaks with nickname longer than 4 characters, causing repeated 'connection timeout' when clients connect #41

Closed televisionia closed 2 weeks ago

televisionia commented 1 year ago

Is there an existing issue for this?

Description of the bug

After some talking through some issues, I have noticed a problem. There is a major bug inside the script causing a lot of users to not be able to connect to their friends. A large percentage of people who have used this script probably unknowingly run into this bug and just gave up straight away, it's a bit of a problem at the moment.

If the server script's nickname is LONGER than 4 characters, every time a client connects the server fails to send back to the client that it has successfully received the client's message mid-handshake. My theory is that this is because the server's name is too long for the packet being sent to the client, therefore failing to send a packet back to client then the server says the client connection is 'timing out' and the client is thinking it hasn't connected to the server because the server has failed to respond back to the client.
(P.S While this is not a cause of this bug but is related, I found that the client's nicknames do not use the string entered into the top of the script and always get randomized regardless)

I would say that there's really only two solutions to this, to either throw a error/warning at the user if a username is longer than 4 characters or just make it so the program supports longer names. Or you could just, only use the first 4 characters of the nickname entered as a quick fix, but I think the error idea would be better.

Here are a list of some of the issues that have most likely been caused by this bug or are related to this issue...

39

36

32

20

11

6

1 (Literally the first issue is caused by this very bug)

Steps To Reproduce

  1. Start the server with more than 4 characters set as the nickname
  2. Get a client to connect
  3. Just wait for a bit and... tada! image
Ol2gud commented 1 year ago

Ran into this exact same problem. amazing you found that the nickname was the error, tysm

TheHunterManX commented 2 weeks ago

This will be fixed in the Alpha 3.5 update coming out within 2 weeks. The reason is because nickname was tied to length, which needed to be 4.

Ol2gud commented 2 weeks ago

Yesss 🙏glad to see this mod being revived