Page 1 of 1

[Rseding91] Impossible to ban player.

Posted: Sat Dec 15, 2018 3:24 pm
by Cooldude2606
We had a griefer on our server, one of our moderators attempted to ban them via our custom webscript which failed; then their logged into the game and was still unable to, later that day one of our administators came online and found it was not possible to ban them via game.ban_player().

I then did some digging and found that even when using game.ban_player banning was not possible. Here are all inputs tried for PlayerSpecification:
  • "аграрный работяга" (the players name, after being copyied from the log file)
  • 120 (the players index at the time)
  • game.players[120] (the player userdata)
  • game.players[120].name (the player's name via userdata)
I belive that the error is due to there being a space in the name as this is what we get after attempting to ban the player:
Image
The second half of the players name as be prefixed to the reason and if no reason is included in the command then the second half becomes the reason:
Image

Re: [Rseding91] Impossible to ban player.

Posted: Sat Dec 15, 2018 5:33 pm
by Oktokolo
Another common pitfalls would be Unicode normalization differences between banlist, log and console input when doing binary comparisons. Wube should (and hopefully does already) normalize all the texts to Unicode Normal Form C as they enter the game.

Re: [Rseding91] Impossible to ban player.

Posted: Mon Dec 17, 2018 10:29 pm
by Cooldude2606
We have just encountered another player with spaces in the name; so this is not just one name and not just with non latin letters.
Name: "ministerio del lag"
This player did nothing wrong and I am just putting this here in case spaces are the problem. I should mention that our server has require user verification enabled in case this point is brought up.

Re: [Rseding91] Impossible to ban player.

Posted: Tue Dec 18, 2018 12:10 pm
by Tairon96
The handling of players by their names with Unicode characters is not a smart idea. For example there are several types of whitespace in Unicode. They all look the same. But for a comparison they are different.

It might be better to implement same kind of player ID. This number could be use to refer to a player if the reference by name failed.

The copy/paste of a player's name from a log is a sure method. But it is not very user-friendly : Since the first attempt without copy/paste might fail, the frustration is inevitably.

Re: [Rseding91] Impossible to ban player.

Posted: Tue Dec 18, 2018 8:48 pm
by Rseding91
I'll fix the inability to ban players with spaces in their names via console. Also, in 0.17 there's a GUI you can ban players without knowing how to spell their name (it's a button press) so it will be doubly-solved for 0.17.

Re: [Rseding91] Impossible to ban player.

Posted: Thu Dec 20, 2018 1:11 pm
by Sergeant_Steve
Tairon96 wrote:
Tue Dec 18, 2018 12:10 pm
It might be better to implement same kind of player ID. This number could be use to refer to a player if the reference by name failed.
There is already something like that built into the game, there is a "Player Index" which you can use to ban people without using the name, however even using that had the same problem as it only banned the name up to the first space between characters.

Re: [Rseding91] Impossible to ban player.

Posted: Wed Feb 27, 2019 11:14 pm
by grilledham
Rseding91 wrote:
Tue Dec 18, 2018 8:48 pm
I'll fix the inability to ban players with spaces in their names via console. Also, in 0.17 there's a GUI you can ban players without knowing how to spell their name (it's a button press) so it will be doubly-solved for 0.17.
This still isn't fixed as of 0.17.2 for /ban or game.ban_player

Banning via console is important for my use case as I automatically synchronise bans across all my servers.

Thanks.

Re: [Rseding91] Impossible to ban player.

Posted: Wed Feb 27, 2019 11:45 pm
by Rseding91
grilledham wrote:
Wed Feb 27, 2019 11:14 pm
Rseding91 wrote:
Tue Dec 18, 2018 8:48 pm
I'll fix the inability to ban players with spaces in their names via console. Also, in 0.17 there's a GUI you can ban players without knowing how to spell their name (it's a button press) so it will be doubly-solved for 0.17.
This still isn't fixed as of 0.17.2 for /ban or game.ban_player

Banning via console is important for my use case as I automatically synchronise bans across all my servers.

Thanks.
I know it isn't. Which is why it's still in assigned and not resolved problems and bugs :P

Re: [Rseding91] Impossible to ban player.

Posted: Thu Feb 28, 2019 12:08 pm
by grilledham
OK. It struck me as odd that players with spaces can be banned via /admin but not via game.ban_player.

But as long as this is known, I'm happy to keep waiting patiently. :)

Re: [Rseding91] Impossible to ban player.

Posted: Thu Apr 11, 2019 12:00 am
by Rseding91
So, after talking with the guy who manages the accounts he ended up finding that it wasn't meant to be allowing usernames with spaces/other invalid characters and forced all of the accounts to change their username.

Indirectly - I think that makes this obsolete?