From a1e8106622f2d8daadfbfb221f0b14d8e5eea014 Mon Sep 17 00:00:00 2001 From: Luth31 Date: Thu, 11 Aug 2016 23:57:41 +0300 Subject: [PATCH] Script/Commands: .account create will now grant the latest enabled expansion (Set in worldserver.conf --- .../acore/framework/Database/Implementation/LoginDatabase.cpp | 2 +- src/server/game/Accounts/AccountMgr.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/acore/framework/Database/Implementation/LoginDatabase.cpp b/modules/acore/framework/Database/Implementation/LoginDatabase.cpp index 739df7790..bbf71da88 100644 --- a/modules/acore/framework/Database/Implementation/LoginDatabase.cpp +++ b/modules/acore/framework/Database/Implementation/LoginDatabase.cpp @@ -55,7 +55,7 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_INS_REALM_CHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); - PrepareStatement(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_ASYNC); + PrepareStatement(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, expansion, joindate) VALUES(?, ?, ?, NOW())", CONNECTION_ASYNC); PrepareStatement(LOGIN_INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?", CONNECTION_ASYNC); diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 45af83d56..cef7eabd0 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -42,6 +42,7 @@ namespace AccountMgr stmt->setString(0, username); stmt->setString(1, CalculateShaPassHash(username, password)); + stmt->setInt8(2, uint8(sWorld->getIntConfig(CONFIG_EXPANSION))); LoginDatabase.Execute(stmt);