[Rseding91] [1.1.88] Invalid LAN Player Names Are Accepted

This subforum contains all the issues which we already resolved.
jackabomb
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Jul 24, 2023 2:20 pm
Contact:

[Rseding91] [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 1360 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 1360 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 1360 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 1360 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 1360 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 14138
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] [1.1.88] Invalid LAN Player Names Are Accepted

Post by Rseding91 »

Thanks for the report. This is now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.

Xvlcw
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Oct 31, 2024 7:26 pm
Contact:

Re: [Rseding91] [1.1.88] Invalid LAN Player Names Are Accepted

Post by Xvlcw »

Noooo! I just accidentally changed my invalid username to a valid one and now I cannot get back my inventory by changing my name back to the invalid name as it was possible so far.. Please remove the input validation again or migrate the old username so that we can access our stuff :/

Post Reply

Return to “Resolved Problems and Bugs”