Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Core/DB) - Correct the max length of a username #21183

Merged

Conversation

TheSCREWEDSoftware
Copy link
Contributor

@TheSCREWEDSoftware TheSCREWEDSoftware commented Jan 15, 2025

Warning

If any existing username have more than 17 characters after this PR or testing I don't know how SQL database reacts to that (when i had it active and tried lowering it didnt allow me until i changed or removed the username with more than 17 characters.

Client limitation on creating username is of 17 characters. (AC has it set to 20).
Tested on 2 clean clients.
3.3.5 (12340) enGB
3.3.5 (12340) enUS

Updated acore_world.acore_string 55 and 1005 (LANG_PASSWORD_TOO_LONG and LANG_ACCOUNT_TOO_LONG)

  • Adds French and Russian Locale to 55.
  • Adds French, Spain Spanish, Mexican Spanish and Russian Locale to 1005
  • German grammer was corrected for 1005.
  • Corrected all previous 20 character max in 1005 to 17.

Updated the acore_auth.account username field from 32 to 17 chracters length.
Note: I do not know if this size does or not changes for non-latin characters like russian.

No changes to the password in core as it set correctly (max of 16 chracters).

Thanks @r-o-b-o-t-o for the french translation and @55Honey for the correction on the grammar.

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).
  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

Issues Addressed:

  • Closes N/A

SOURCE:

The changes have been validated through:

  • Live research (checked on live servers, e.g Classic WotLK, Retail, etc.)
  • Sniffs (remember to share them with the open source community!)
  • Video evidence, knowledge databases or other public sources (e.g forums, Wowhead, etc.)
  • The changes promoted by this pull request come partially or entirely from another project (cherry-pick). Cherry-picks must be committed using the proper --author tag in order to be accepted, thus crediting the original authors, unless otherwise unable to be found
  • Used the client

Tests Performed:

This PR has been:

  • Tested in-game by the author.
  • Tested in-game by other community members/someone else other than the author/has been live on production servers.
  • This pull request requires further testing and may have edge cases to be tested.
  • .account create AccountWithEnough 123 // 17 chars
  • Join your client, no disconenct. (before and after pr)
  • .account create AccountWithEnoughs 123 // 18 chars
  • Join your client, disconnect (before pr), after PR you can't create an account with more than 17 chars.

How to Test the Changes:

  • This pull request can be tested by following the reproduction steps provided in the linked issue
  • This pull request requires further testing. Provide steps to test your changes. If it requires any specific setup e.g multiple players please specify it as well.

Known Issues and TODO List:

  • [ ]
  • [ ]

How to Test AzerothCore PRs

When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].

You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:

http://www.azerothcore.org/wiki/How-to-test-a-PR

REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).

For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.

Tested on 2 clean clients.
3.3.5 (12340) enGB
3.3.5 (12340) enUS
Upon creating a user with higher than 17 It's an auto disconnect. Password is unchanged from TC or Mangos which is 16, higher does the same error.
LANG_PASSWORD_TOO_LONG` gets addition to French and Russian.

`LANG_ACCOUNT_TOO_LONG` gets addition to French, Spain Spanish, Mexican Spanish and Russian.

Corrected german grammer and all from 20 to 17 (characters max)
Changed the max of a username length to match the client limit.
@github-actions github-actions bot added DB related to the SQL database CORE Related to the core file-cpp Used to trigger the matrix build labels Jan 15, 2025
@@ -0,0 +1,3 @@
--
-- Changes the Length of `username` from 32 to 17 characters as it the client limit.
ALTER TABLE `account` CHANGE COLUMN `username` `username` VARCHAR(17) NOT NULL DEFAULT '' COLLATE 'utf8mb4_unicode_ci' AFTER `id`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving it varchar(32) could have some benefits and save us from headaches.

  1. Changing it would error for everyone who for some reason has a username > 17
  2. It doesn't really matter as
    • The client would crash
    • Creating a new account/changing username through the console it would send AOR_NAME_TOO_LONG anyways

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you and sud suggested, i've removed changes to the column

@sudlud sudlud merged commit eb37cd8 into azerothcore:master Jan 19, 2025
18 checks passed
skelUA pushed a commit to skelUA/wotlk that referenced this pull request Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CORE Related to the core DB related to the SQL database file-cpp Used to trigger the matrix build Ready to be Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants