[1.1.88] Invalid LAN Player Names Are Accepted

Post your bugs and problems so we can fix them.
Post Reply
jackabomb
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Jul 24, 2023 2:20 pm
Contact:

[1.1.88] Invalid LAN Player Names Are Accepted

Post by jackabomb »

Summary:
It is possible to create (and use) an invalid LAN player name with spaces in it, if you enter it in a particular spot. (I haven't tested other kinds of invalid names)
If you change your name via Settings->Other->LAN Player Name, then it behaves as normal, rejecting names with spaces. But if you are a new player, and you go to join or host a multiplayer game without setting up your name first, you get a small pop-up box asking you to set your name. In this box, names with spaces are accepted.
The Story:
My friend accidentally joined our game with an invalid player name, specifically a name with spaces in it. Then, he logged in (changing his name) and all his stuff was gone. Now I (as the admin) can't /swap-players his stuff to his new (valid) player, because the space in his old name confuses swap-players.
Steps To Reproduce:
1. a) Open a fresh .zip copy of the game OR
b) Navigate to settings->other, log off (if logged in), and clear the LAN Player Name box (i.e. make it empty).
2. Return to the main menu.
3. Click multiplayer.
4. Click anything other than "Browse Public" (since you can't reproduce the bug when logged in).
5. Proceed through the appropriate UI for hosting or joining, whichever you clicked.
6. Eventually, the game pops up a box asking for your name.
7. Enter a name with spaces in it. This ought to be rejected, but it will be allowed instead.
8. Play the game. This shouldn't be possible, but it is.
Recommendations:
1. Give /swap-players the ability to target invalidly named players, so people who already have invalidly-named characters can recover their stuff.
2. Make all player name entry boxes use the same is_name_valid() code to prevent this happening in the future.
3. Or maybe auto-convert invalid names to a valid one upon joining the game?
Notes:
This bug is uniquely visible to new players. Established players likely play while logged in (since using the public server requires it) or they chose a valid name long ago and never change it. If they do change it, they do so through the Settings->Other menu where the rules are enforced. Nobody would think of first clearing the box on that menu, in order to get the pop-up box in the multiplayer to appear again.
It is possible to recover your stuff if you accidentally started as an invalid-named character. As long as you're still that name, you can leave and rejoin at will and nothing bad will happen. So you could just keep playing. You could also put all your stuff in a box, change your name, then come and get it. You could also launch a zip copy of the game alongside, join from that copy as your new intended name, then have your main (invalid) character /swap-players with the new valid name. (I haven't tested this, but it may work since it's being run by the invalid player, they don't have to type an invalid name into the console.)
If you started as invalid-named character, and you've already changed your name and now can't get back into that character (as happened to my friend), it's not too late.
1. Go into Settings->Other
2. Click on LAN Player Name
3. Backspace/delete everything in the box. It must be empty. Surprisingly, the game will allow an empty box here.
4. Click Confirm.
5. Go join or host your game where you have the invalid character.
6. You will again encounter the pop-up prompt asking for your name. Enter the invalid name exactly.
7. You're In! Do what you wish - keep playing, stash your stuff, etc.
Attachments
Admin is unable to do /swap-players even with various quoting styles.
Admin is unable to do /swap-players even with various quoting styles.
Screenshot 2023-07-29 071428.png (4.41 MiB) Viewed 323 times
Same game, from the perspective of the other player(s).
Same game, from the perspective of the other player(s).
Screenshot 2023-07-29 071323.png (4.25 MiB) Viewed 323 times
Successfully joined the game despite invalid name. Able to speak in chat and move and play.
Successfully joined the game despite invalid name. Able to speak in chat and move and play.
Screenshot 2023-07-29 071305.png (3.61 MiB) Viewed 323 times
Browse LAN accepts the invalid name and shows the list of LAN games.
Browse LAN accepts the invalid name and shows the list of LAN games.
Screenshot 2023-07-29 071121.png (2.36 MiB) Viewed 323 times
Invalid name being entered in player name prompt, upon entering browse LAN interface.
Invalid name being entered in player name prompt, upon entering browse LAN interface.
Screenshot 2023-07-29 071107.png (1.96 MiB) Viewed 323 times

Post Reply

Return to “Bug Reports”