Accept player names that look right and cannot fake someone else
Players type names with invisible characters, text that flips direction, a hundred spaces, or the same name as a friend with a different capital letter. All of it ends up confusing the scoreboard and the chat. Here is a cleaner that handles the odd cases and a way to give duplicates a number.
Why this works
A name is something other people read and trust. Stripping what cannot be seen, and treating look-alikes as the same, makes the name on screen the name that was typed, so one person cannot pass as another.
When not to use it
Skip it in a closed game among friends who log in with real accounts, where the account already says who is who. Also, no cleaner can judge rude or hateful names; that needs a word list, a report button or a person.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 24 lines of example code with 3 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Accept player names that look right and cannot fake someone else" (read_entry online-clean-player-names-and-keep-them-unique) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP