mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Commands: Prevent creating accounts containing '@' character with .account create command
This commit is contained in:
@@ -887,8 +887,9 @@ enum TrinityStrings
|
||||
LANG_CHARACTER_DELETED_LIST_LINE_CHAT = 1026,
|
||||
LANG_SQLDRIVER_QUERY_LOGGING_ENABLED = 1027,
|
||||
LANG_SQLDRIVER_QUERY_LOGGING_DISABLED = 1028,
|
||||
LANG_ACCOUNT_INVALID_BNET_NAME = 1029,
|
||||
// Room for more level 4 1030-1099 not used
|
||||
LANG_ACCOUNT_INVALID_BNET_NAME = 1029, // 6.x ONLY
|
||||
LANG_ACCOUNT_USE_BNET_COMMANDS = 1030, // 6.x enum value name but different text in DB
|
||||
// Room for more level 4 1031-1099 not used
|
||||
|
||||
// Level 3 (continue)
|
||||
LANG_ACCOUNT_SETADDON = 1100,
|
||||
|
||||
@@ -121,6 +121,13 @@ public:
|
||||
if (!accountName || !password)
|
||||
return false;
|
||||
|
||||
if (strchr(accountName, '@'))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_USE_BNET_COMMANDS);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (sAccountMgr->CreateAccount(std::string(accountName), std::string(password), email))
|
||||
{
|
||||
case AccountOpResult::AOR_OK:
|
||||
|
||||
Reference in New Issue
Block a user