From 4a679ba1be08e9302970cd7dc11fcc70e7fc4c91 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 28 Mar 2016 19:40:15 +0200 Subject: [PATCH] Core/Commands: Prevent creating accounts containing '@' character with .account create command --- sql/updates/world/2016_03_28_00_world.sql | 3 +++ src/server/game/Miscellaneous/Language.h | 3 ++- src/server/scripts/Commands/cs_account.cpp | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2016_03_28_00_world.sql diff --git a/sql/updates/world/2016_03_28_00_world.sql b/sql/updates/world/2016_03_28_00_world.sql new file mode 100644 index 0000000000000..868163c2be771 --- /dev/null +++ b/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'); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 4c3ce70fbeffc..58c9eada85c1d 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -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, diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 0edb571493492..b195d86422233 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -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: