HomeWildfire Games

Update the rules for new lobby usernames

Description

Update the rules for new lobby usernames

Right now usernames for the lobby can consist solely of numbers and
special characters. This can result in nonsensical usernames and is
prone to be abused. While we can't entirely prevent nonsensical
usernames, we can at least do a bit better.

Therefore, this adjusts the rules for the validation of new lobby
usernames in pyrogenesis. Previously these rules were:

  • length: between 1 and 20 characters
  • valid characters: lower- and uppercase letters, numbers, ".", "_", "-"

The new rules are:

  • length: between 3 and 20 characters
  • valid characters: lower- and uppercase letters, numbers, ".", "_", "-"
  • must contain at least one letter

These validation changes are relevant for new user registrations only
and don't affect existing users. As this also just adjusts the
client-side validation, users will also still be able to register
usernames according to the old rules, e.g. when using an older version
of 0 A.D., until the same change gets rolled out at a later point in
time server-side as well.

Event Timeline

Hi Dunedan,

I didn't understand what you meant by "nonsensical usernames" and I didn't see why it should be limited to 3-20 characters. If there are certain names that you don't want people to use, we can compare them against a list of banned strings in the gui page.

if (register && !username.match(/^(?=.*[a-z])[a-z0-9._-]{3,20}$/i) && username.match(bannedName))
return translate ("invalid username")

Also it would be good to allow more different characters, for example extended Latin, because many Europeans can't write the name they want due to ä Ü