smogon / pokemon-showdown

Pokémon battle simulator.
https://pokemonshowdown.com
MIT License
4.74k stars 2.78k forks source link

Unicode Pokémon nicknames are not appearing #1518

Closed msikma closed 9 years ago

msikma commented 9 years ago

See the following example replay.

Both of them appear as though they have no nickname. Other Pokémon use only characters in the standard ASCII range, and their names display like normal.

ascriptmaster commented 9 years ago

This is a name validator thing that is server-specific based on how we parse usernames, since Pokemon nicknames have the same constraints.

Tagging @Zarel since he built that and I'm unsure whether or not it actually needs fixing.

kotarou3 commented 9 years ago

Katakana is valid in Pokemon nicknames, so that certainly is a bug

Slayer95 commented 9 years ago

Certain Unicode ranges can probably be easily allowed; however, the issue is deeper than that.

I would say we may reserve our right to filter nicknames. We can't even have every English character though: commas are forbidden for protocol safety... Unless we use some sort of escaping?

What troubles me a bit is that the language of nicknames and their content may influence the perception that a player has about their opponent, meaning that nicknames have a psychological competitive value.

ascriptmaster commented 9 years ago

The problem itself can only be updated by Zarel because it relies on server-specific functions.

Validator#validateSet uses Config.namefilter as its nickname filter (which is also used to validate PS usernames) if it exists. It varies between servers and is not enabled by default.

Zarel commented 9 years ago

namefilter probably shouldn't be shared between Pokémon and user names.

msikma commented 9 years ago

It varies between servers and is not enabled by default.

If it's a setting, that explains why I seem to remember these names being usable some time ago (probably a couple of months up to half a year—haven't played in a while).

Of course, there's nothing wrong with filtering nicknames (you always need to get rid of trailing spaces or possible exploits such as Zargo-style glitch text), but of course it'd be nice for non-English players to be able to use their own script for their Pokémon names.

kotarou3 commented 9 years ago

Trivia: Zarel's own teams use Japanese nicknames

ascriptmaster commented 9 years ago

If it's a setting, that explains why I seem to remember these names being usable some time ago (probably a couple of months up to half a year—haven't played in a while).

When the Pokemon Showdown hard drive crashed a few months back, we lost the name filter, so we had to rebuild one from scratch as fast as possible to prevent usernames from using gimmicky characters like the Cyrillic A and Unicode control characters. The fastest way to do this was to write the name filter to block all characters but a select few.

ascriptmaster commented 9 years ago

de9c3847fd88e14284e53f286dd5cfc796ef6691 removes the namefilter from Pokemon names.

Zarel commented 9 years ago

It had already been fixed for a few weeks, I just left it uncommitted for a while since I was waffling on implementation details.

ascriptmaster commented 9 years ago

Well, yeah. But now we have a commit to prove it's been done :3