Core/Commands: Prevent creating accounts containing '@' character with .account create command

This commit is contained in:
Shauren
2016-03-28 19:40:15 +02:00
parent 335a1e495c
commit 4a679ba1be
3 changed files with 12 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `trinity_string` WHERE `entry`=1030;
INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES
(1030,'You are attempting to create a battle.net account with wrong command, use .bnetaccount create');

View File

@@ -896,7 +896,8 @@ enum TrinityStrings
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_USE_BNET_COMMANDS = 1030,
// Room for more level 4 1031-1099 not used
// Level 3 (continue)
LANG_ACCOUNT_SETADDON = 1100,

View File

@@ -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: