Skip to content

Commit

Permalink
Core/Commands: Prevent creating accounts containing '@' character wit…
Browse files Browse the repository at this point in the history
…h .account create command
  • Loading branch information
Shauren committed Mar 28, 2016
1 parent 335a1e4 commit 4a679ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions sql/updates/world/2016_03_28_00_world.sql
@@ -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');
3 changes: 2 additions & 1 deletion src/server/game/Miscellaneous/Language.h
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions src/server/scripts/Commands/cs_account.cpp
Expand Up @@ -121,6 +121,13 @@ class account_commandscript : public CommandScript
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:
Expand Down

0 comments on commit 4a679ba

Please sign in to comment.