Make PreparedStatements static for each database.
This commit is contained in:
@@ -72,7 +72,7 @@ namespace BNetServer.Networking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SelBnetAuthentication);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SelBnetAuthentication);
|
||||||
stmt.AddValue(0, login);
|
stmt.AddValue(0, login);
|
||||||
|
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
@@ -93,7 +93,7 @@ namespace BNetServer.Networking
|
|||||||
loginTicket = "TC-" + ticket.ToHexString();
|
loginTicket = "TC-" + ticket.ToHexString();
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UpdBnetAuthentication);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UpdBnetAuthentication);
|
||||||
stmt.AddValue(0, loginTicket);
|
stmt.AddValue(0, loginTicket);
|
||||||
stmt.AddValue(1, Time.UnixTime + 3600);
|
stmt.AddValue(1, Time.UnixTime + 3600);
|
||||||
stmt.AddValue(2, accountId);
|
stmt.AddValue(2, accountId);
|
||||||
@@ -111,7 +111,7 @@ namespace BNetServer.Networking
|
|||||||
if (maxWrongPassword != 0)
|
if (maxWrongPassword != 0)
|
||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UpdBnetFailedLogins);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UpdBnetFailedLogins);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -126,19 +126,19 @@ namespace BNetServer.Networking
|
|||||||
|
|
||||||
if (banType == BanMode.Account)
|
if (banType == BanMode.Account)
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.InsBnetAccountAutoBanned);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.InsBnetAccountAutoBanned);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.InsIpAutoBanned);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.InsIpAutoBanned);
|
||||||
stmt.AddValue(0, request.Host);
|
stmt.AddValue(0, request.Host);
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt.AddValue(1, banTime);
|
stmt.AddValue(1, banTime);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UpdBnetResetFailedLogins);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UpdBnetResetFailedLogins);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace BNetServer.Networking
|
|||||||
if (verifyWebCredentialsRequest.WebCredentials.IsEmpty)
|
if (verifyWebCredentialsRequest.WebCredentials.IsEmpty)
|
||||||
return BattlenetRpcErrorCode.Denied;
|
return BattlenetRpcErrorCode.Denied;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SelBnetAccountInfo);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SelBnetAccountInfo);
|
||||||
stmt.AddValue(0, verifyWebCredentialsRequest.WebCredentials.ToStringUtf8());
|
stmt.AddValue(0, verifyWebCredentialsRequest.WebCredentials.ToStringUtf8());
|
||||||
|
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
@@ -67,7 +67,7 @@ namespace BNetServer.Networking
|
|||||||
if (accountInfo.LoginTicketExpiry < Time.UnixTime)
|
if (accountInfo.LoginTicketExpiry < Time.UnixTime)
|
||||||
return BattlenetRpcErrorCode.TimedOut;
|
return BattlenetRpcErrorCode.TimedOut;
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_CHARACTER_COUNTS_BY_BNET_ID);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_CHARACTER_COUNTS_BY_BNET_ID);
|
||||||
stmt.AddValue(0, accountInfo.Id);
|
stmt.AddValue(0, accountInfo.Id);
|
||||||
|
|
||||||
SQLResult characterCountsResult = DB.Login.Query(stmt);
|
SQLResult characterCountsResult = DB.Login.Query(stmt);
|
||||||
@@ -81,7 +81,7 @@ namespace BNetServer.Networking
|
|||||||
} while (characterCountsResult.NextRow());
|
} while (characterCountsResult.NextRow());
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SelBnetLastPlayerCharacters);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SelBnetLastPlayerCharacters);
|
||||||
stmt.AddValue(0, accountInfo.Id);
|
stmt.AddValue(0, accountInfo.Id);
|
||||||
|
|
||||||
SQLResult lastPlayerCharactersResult = DB.Login.Query(stmt);
|
SQLResult lastPlayerCharactersResult = DB.Login.Query(stmt);
|
||||||
@@ -177,7 +177,7 @@ namespace BNetServer.Networking
|
|||||||
return BattlenetRpcErrorCode.BadProgram;
|
return BattlenetRpcErrorCode.BadProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_EXISTING_AUTHENTICATION_BY_ID);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_EXISTING_AUTHENTICATION_BY_ID);
|
||||||
stmt.AddValue(0, accountInfo.Id);
|
stmt.AddValue(0, accountInfo.Id);
|
||||||
|
|
||||||
queryProcessor.AddCallback(DB.Login.AsyncQuery(stmt).WithCallback(result =>
|
queryProcessor.AddCallback(DB.Login.AsyncQuery(stmt).WithCallback(result =>
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ namespace BNetServer.Networking
|
|||||||
if (!clientInfoOk)
|
if (!clientInfoOk)
|
||||||
return BattlenetRpcErrorCode.WowServicesDeniedRealmListTicket;
|
return BattlenetRpcErrorCode.WowServicesDeniedRealmListTicket;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UpdBnetLastLoginInfo);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UpdBnetLastLoginInfo);
|
||||||
stmt.AddValue(0, GetRemoteIpEndPoint().ToString());
|
stmt.AddValue(0, GetRemoteIpEndPoint().ToString());
|
||||||
stmt.AddValue(1, (byte)locale.ToEnum<Locale>());
|
stmt.AddValue(1, (byte)locale.ToEnum<Locale>());
|
||||||
stmt.AddValue(2, os);
|
stmt.AddValue(2, os);
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ namespace BNetServer.Networking
|
|||||||
Log.outInfo(LogFilter.Network, $"{GetClientInfo()} Connection Accepted.");
|
Log.outInfo(LogFilter.Network, $"{GetClientInfo()} Connection Accepted.");
|
||||||
|
|
||||||
// Verify that this IP is not in the ip_banned table
|
// Verify that this IP is not in the ip_banned table
|
||||||
DB.Login.Execute(DB.Login.GetPreparedStatement(LoginStatements.DelExpiredIpBans));
|
DB.Login.Execute(LoginDatabase.GetPreparedStatement(LoginStatements.DelExpiredIpBans));
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SelIpInfo);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SelIpInfo);
|
||||||
stmt.AddValue(0, ipAddress);
|
stmt.AddValue(0, ipAddress);
|
||||||
stmt.AddValue(1, BitConverter.ToUInt32(GetRemoteIpEndPoint().Address.GetAddressBytes(), 0));
|
stmt.AddValue(1, BitConverter.ToUInt32(GetRemoteIpEndPoint().Address.GetAddressBytes(), 0));
|
||||||
|
|
||||||
|
|||||||
@@ -89,9 +89,9 @@ namespace BNetServer
|
|||||||
|
|
||||||
static void BanExpiryCheckTimer_Elapsed(object sender, ElapsedEventArgs e)
|
static void BanExpiryCheckTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
DB.Login.Execute(DB.Login.GetPreparedStatement(LoginStatements.DelExpiredIpBans));
|
DB.Login.Execute(LoginDatabase.GetPreparedStatement(LoginStatements.DelExpiredIpBans));
|
||||||
DB.Login.Execute(DB.Login.GetPreparedStatement(LoginStatements.UpdExpiredAccountBans));
|
DB.Login.Execute(LoginDatabase.GetPreparedStatement(LoginStatements.UpdExpiredAccountBans));
|
||||||
DB.Login.Execute(DB.Login.GetPreparedStatement(LoginStatements.DelBnetExpiredAccountBanned));
|
DB.Login.Execute(LoginDatabase.GetPreparedStatement(LoginStatements.DelBnetExpiredAccountBanned));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Timer _banExpiryCheckTimer;
|
static Timer _banExpiryCheckTimer;
|
||||||
|
|||||||
@@ -80,13 +80,12 @@ namespace Framework.Database
|
|||||||
|
|
||||||
public abstract class MySqlBase<T>
|
public abstract class MySqlBase<T>
|
||||||
{
|
{
|
||||||
Dictionary<T, string> _preparedQueries = new();
|
static Dictionary<T, string> _preparedQueries = new();
|
||||||
ProducerConsumerQueue<ISqlOperation> _queue = new();
|
|
||||||
|
|
||||||
|
ProducerConsumerQueue<ISqlOperation> _queue = new();
|
||||||
MySqlConnectionInfo _connectionInfo;
|
MySqlConnectionInfo _connectionInfo;
|
||||||
DatabaseUpdater<T> _updater;
|
DatabaseUpdater<T> _updater;
|
||||||
DatabaseWorker<T> _worker;
|
DatabaseWorker<T> _worker;
|
||||||
|
|
||||||
DBVersion version;
|
DBVersion version;
|
||||||
|
|
||||||
public MySqlErrorCode Initialize(MySqlConnectionInfo connectionInfo)
|
public MySqlErrorCode Initialize(MySqlConnectionInfo connectionInfo)
|
||||||
@@ -225,7 +224,7 @@ namespace Framework.Database
|
|||||||
_preparedQueries[statement] = sb.ToString();
|
_preparedQueries[statement] = sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PreparedStatement GetPreparedStatement(T statement)
|
public static PreparedStatement GetPreparedStatement(T statement)
|
||||||
{
|
{
|
||||||
return new PreparedStatement(_preparedQueries[statement]);
|
return new PreparedStatement(_preparedQueries[statement]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class DBAppender : Appender
|
|||||||
if (!enabled || message.type == LogFilter.Sql)
|
if (!enabled || message.type == LogFilter.Sql)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_LOG);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_LOG);
|
||||||
stmt.AddValue(0, Time.DateTimeToUnixTime(message.mtime));
|
stmt.AddValue(0, Time.DateTimeToUnixTime(message.mtime));
|
||||||
stmt.AddValue(1, realmId);
|
stmt.AddValue(1, realmId);
|
||||||
stmt.AddValue(2, message.type.ToString());
|
stmt.AddValue(2, message.type.ToString());
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class RealmManager : Singleton<RealmManager>
|
|||||||
|
|
||||||
void UpdateRealms(object source, ElapsedEventArgs e)
|
void UpdateRealms(object source, ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_REALMLIST);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_REALMLIST);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
Dictionary<RealmId, string> existingRealms = new();
|
Dictionary<RealmId, string> existingRealms = new();
|
||||||
foreach (var p in _realms)
|
foreach (var p in _realms)
|
||||||
@@ -280,7 +280,7 @@ public class RealmManager : Singleton<RealmManager>
|
|||||||
byte[] serverSecret = new byte[0].GenerateRandomKey(32);
|
byte[] serverSecret = new byte[0].GenerateRandomKey(32);
|
||||||
byte[] keyData = clientSecret.ToArray().Combine(serverSecret);
|
byte[] keyData = clientSecret.ToArray().Combine(serverSecret);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BNET_GAME_ACCOUNT_LOGIN_INFO);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_BNET_GAME_ACCOUNT_LOGIN_INFO);
|
||||||
stmt.AddValue(0, keyData);
|
stmt.AddValue(0, keyData);
|
||||||
stmt.AddValue(1, clientAddress.ToString());
|
stmt.AddValue(1, clientAddress.ToString());
|
||||||
stmt.AddValue(2, (byte)locale);
|
stmt.AddValue(2, (byte)locale);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Game.AI
|
|||||||
for (byte i = 0; i < (int)SmartScriptType.Max; i++)
|
for (byte i = 0; i < (int)SmartScriptType.Max; i++)
|
||||||
_eventMap[i].Clear(); //Drop Existing SmartAI List
|
_eventMap[i].Clear(); //Drop Existing SmartAI List
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_SMART_SCRIPTS);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_SMART_SCRIPTS);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
@@ -318,7 +318,7 @@ namespace Game.AI
|
|||||||
|
|
||||||
_waypointStore.Clear();
|
_waypointStore.Clear();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_SMARTAI_WP);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_SMARTAI_WP);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace Game
|
|||||||
|
|
||||||
(byte[] salt, byte[] verifier) = SRP6.MakeRegistrationData(username, password);
|
(byte[] salt, byte[] verifier) = SRP6.MakeRegistrationData(username, password);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_ACCOUNT);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_ACCOUNT);
|
||||||
stmt.AddValue(0, username);
|
stmt.AddValue(0, username);
|
||||||
stmt.AddValue(1, salt);
|
stmt.AddValue(1, salt);
|
||||||
stmt.AddValue(2, verifier);
|
stmt.AddValue(2, verifier);
|
||||||
@@ -54,7 +54,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
DB.Login.DirectExecute(stmt); // Enforce saving, otherwise AddGroup can fail
|
DB.Login.DirectExecute(stmt); // Enforce saving, otherwise AddGroup can fail
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_REALM_CHARACTERS_INIT);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_REALM_CHARACTERS_INIT);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
|
|
||||||
return AccountOpResult.Ok;
|
return AccountOpResult.Ok;
|
||||||
@@ -63,14 +63,14 @@ namespace Game
|
|||||||
public AccountOpResult DeleteAccount(uint accountId)
|
public AccountOpResult DeleteAccount(uint accountId)
|
||||||
{
|
{
|
||||||
// Check if accounts exists
|
// Check if accounts exists
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BY_ID);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BY_ID);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
return AccountOpResult.NameNotExist;
|
return AccountOpResult.NameNotExist;
|
||||||
|
|
||||||
// Obtain accounts characters
|
// Obtain accounts characters
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARS_BY_ACCOUNT_ID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARS_BY_ACCOUNT_ID);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -93,37 +93,37 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
// table realm specific but common for all characters of account for realm
|
// table realm specific but common for all characters of account for realm
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_TUTORIALS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_TUTORIALS);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ACCOUNT_DATA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ACCOUNT_DATA);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHARACTER_BAN);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHARACTER_BAN);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_ACCOUNT);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_ACCOUNT);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_ACCOUNT_ACCESS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_ACCOUNT_ACCESS);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_REALM_CHARACTERS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_REALM_CHARACTERS);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_ACCOUNT_BANNED);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_ACCOUNT_BANNED);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_ACCOUNT_MUTED);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_ACCOUNT_MUTED);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ namespace Game
|
|||||||
public AccountOpResult ChangeUsername(uint accountId, string newUsername, string newPassword)
|
public AccountOpResult ChangeUsername(uint accountId, string newUsername, string newPassword)
|
||||||
{
|
{
|
||||||
// Check if accounts exists
|
// Check if accounts exists
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BY_ID);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BY_ID);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
@@ -147,13 +147,13 @@ namespace Game
|
|||||||
if (newPassword.Length > MaxAccountLength)
|
if (newPassword.Length > MaxAccountLength)
|
||||||
return AccountOpResult.PassTooLong;
|
return AccountOpResult.PassTooLong;
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_USERNAME);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_USERNAME);
|
||||||
stmt.AddValue(0, newUsername);
|
stmt.AddValue(0, newUsername);
|
||||||
stmt.AddValue(1, accountId);
|
stmt.AddValue(1, accountId);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
|
|
||||||
(byte[] salt, byte[] verifier) = SRP6.MakeRegistrationData(newUsername, newPassword);
|
(byte[] salt, byte[] verifier) = SRP6.MakeRegistrationData(newUsername, newPassword);
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_LOGON);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_LOGON);
|
||||||
stmt.AddValue(0, salt);
|
stmt.AddValue(0, salt);
|
||||||
stmt.AddValue(1, verifier);
|
stmt.AddValue(1, verifier);
|
||||||
stmt.AddValue(2, accountId);
|
stmt.AddValue(2, accountId);
|
||||||
@@ -174,7 +174,7 @@ namespace Game
|
|||||||
|
|
||||||
(byte[] salt, byte[] verifier) = SRP6.MakeRegistrationData(username, newPassword);
|
(byte[] salt, byte[] verifier) = SRP6.MakeRegistrationData(username, newPassword);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_LOGON);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_LOGON);
|
||||||
stmt.AddValue(0, salt);
|
stmt.AddValue(0, salt);
|
||||||
stmt.AddValue(1, verifier);
|
stmt.AddValue(1, verifier);
|
||||||
stmt.AddValue(2, accountId);
|
stmt.AddValue(2, accountId);
|
||||||
@@ -191,7 +191,7 @@ namespace Game
|
|||||||
if (newEmail.Length > MaxEmailLength)
|
if (newEmail.Length > MaxEmailLength)
|
||||||
return AccountOpResult.EmailTooLong;
|
return AccountOpResult.EmailTooLong;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_EMAIL);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_EMAIL);
|
||||||
stmt.AddValue(0, newEmail);
|
stmt.AddValue(0, newEmail);
|
||||||
stmt.AddValue(1, accountId);
|
stmt.AddValue(1, accountId);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -207,7 +207,7 @@ namespace Game
|
|||||||
if (newEmail.Length > MaxEmailLength)
|
if (newEmail.Length > MaxEmailLength)
|
||||||
return AccountOpResult.EmailTooLong;
|
return AccountOpResult.EmailTooLong;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_REG_EMAIL);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_REG_EMAIL);
|
||||||
stmt.AddValue(0, newEmail);
|
stmt.AddValue(0, newEmail);
|
||||||
stmt.AddValue(1, accountId);
|
stmt.AddValue(1, accountId);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -217,7 +217,7 @@ namespace Game
|
|||||||
|
|
||||||
public uint GetId(string username)
|
public uint GetId(string username)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.GET_ACCOUNT_ID_BY_USERNAME);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.GET_ACCOUNT_ID_BY_USERNAME);
|
||||||
stmt.AddValue(0, username);
|
stmt.AddValue(0, username);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
return !result.IsEmpty() ? result.Read<uint>(0) : 0;
|
return !result.IsEmpty() ? result.Read<uint>(0) : 0;
|
||||||
@@ -225,7 +225,7 @@ namespace Game
|
|||||||
|
|
||||||
public AccountTypes GetSecurity(uint accountId, int realmId)
|
public AccountTypes GetSecurity(uint accountId, int realmId)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.GET_GMLEVEL_BY_REALMID);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.GET_GMLEVEL_BY_REALMID);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
stmt.AddValue(1, realmId);
|
stmt.AddValue(1, realmId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
@@ -234,7 +234,7 @@ namespace Game
|
|||||||
|
|
||||||
public QueryCallback GetSecurityAsync(uint accountId, int realmId, Action<uint> callback)
|
public QueryCallback GetSecurityAsync(uint accountId, int realmId, Action<uint> callback)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.GET_GMLEVEL_BY_REALMID);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.GET_GMLEVEL_BY_REALMID);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
stmt.AddValue(1, realmId);
|
stmt.AddValue(1, realmId);
|
||||||
return DB.Login.AsyncQuery(stmt).WithCallback(result =>
|
return DB.Login.AsyncQuery(stmt).WithCallback(result =>
|
||||||
@@ -246,7 +246,7 @@ namespace Game
|
|||||||
public bool GetName(uint accountId, out string name)
|
public bool GetName(uint accountId, out string name)
|
||||||
{
|
{
|
||||||
name = "";
|
name = "";
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.GET_USERNAME_BY_ID);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.GET_USERNAME_BY_ID);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -261,7 +261,7 @@ namespace Game
|
|||||||
public bool GetEmail(uint accountId, out string email)
|
public bool GetEmail(uint accountId, out string email)
|
||||||
{
|
{
|
||||||
email = "";
|
email = "";
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.GET_EMAIL_BY_ID);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.GET_EMAIL_BY_ID);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -280,7 +280,7 @@ namespace Game
|
|||||||
if (!GetName(accountId, out username))
|
if (!GetName(accountId, out username))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_CHECK_PASSWORD);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_CHECK_PASSWORD);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -311,7 +311,7 @@ namespace Game
|
|||||||
public uint GetCharactersCount(uint accountId)
|
public uint GetCharactersCount(uint accountId)
|
||||||
{
|
{
|
||||||
// check character count
|
// check character count
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_SUM_CHARS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_SUM_CHARS);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
return result.IsEmpty() ? 0 : (uint)result.Read<ulong>(0);
|
return result.IsEmpty() ? 0 : (uint)result.Read<ulong>(0);
|
||||||
@@ -319,7 +319,7 @@ namespace Game
|
|||||||
|
|
||||||
public bool IsBannedAccount(string name)
|
public bool IsBannedAccount(string name)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BANNED_BY_USERNAME);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BANNED_BY_USERNAME);
|
||||||
stmt.AddValue(0, name);
|
stmt.AddValue(0, name);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
return !result.IsEmpty();
|
return !result.IsEmpty();
|
||||||
@@ -431,13 +431,13 @@ namespace Game
|
|||||||
// Delete old security level from DB
|
// Delete old security level from DB
|
||||||
if (realmId == -1)
|
if (realmId == -1)
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_ACCOUNT_ACCESS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_ACCOUNT_ACCESS);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_ACCOUNT_ACCESS_BY_REALM);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_ACCOUNT_ACCESS_BY_REALM);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
stmt.AddValue(1, realmId);
|
stmt.AddValue(1, realmId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -446,7 +446,7 @@ namespace Game
|
|||||||
// Add new security level
|
// Add new security level
|
||||||
if (securityLevel != 0)
|
if (securityLevel != 0)
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_ACCOUNT_ACCESS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_ACCOUNT_ACCESS);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
stmt.AddValue(1, securityLevel);
|
stmt.AddValue(1, securityLevel);
|
||||||
stmt.AddValue(2, realmId);
|
stmt.AddValue(2, realmId);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Game
|
|||||||
if (GetId(email) != 0)
|
if (GetId(email) != 0)
|
||||||
return AccountOpResult.NameAlreadyExist;
|
return AccountOpResult.NameAlreadyExist;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_BNET_ACCOUNT);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_BNET_ACCOUNT);
|
||||||
stmt.AddValue(0, email);
|
stmt.AddValue(0, email);
|
||||||
stmt.AddValue(1, CalculateShaPassHash(email.ToUpper(), password.ToUpper()));
|
stmt.AddValue(1, CalculateShaPassHash(email.ToUpper(), password.ToUpper()));
|
||||||
DB.Login.DirectExecute(stmt);
|
DB.Login.DirectExecute(stmt);
|
||||||
@@ -51,7 +51,7 @@ namespace Game
|
|||||||
if (newPassword.Length > 16)
|
if (newPassword.Length > 16)
|
||||||
return AccountOpResult.PassTooLong;
|
return AccountOpResult.PassTooLong;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BNET_PASSWORD);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_BNET_PASSWORD);
|
||||||
stmt.AddValue(0, CalculateShaPassHash(username, newPassword));
|
stmt.AddValue(0, CalculateShaPassHash(username, newPassword));
|
||||||
stmt.AddValue(1, accountId);
|
stmt.AddValue(1, accountId);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -65,7 +65,7 @@ namespace Game
|
|||||||
if (!GetName(accountId, out username))
|
if (!GetName(accountId, out username))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_CHECK_PASSWORD);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_CHECK_PASSWORD);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
stmt.AddValue(1, CalculateShaPassHash(username, password));
|
stmt.AddValue(1, CalculateShaPassHash(username, password));
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ namespace Game
|
|||||||
if (GetIdByGameAccount(gameAccountId) != 0)
|
if (GetIdByGameAccount(gameAccountId) != 0)
|
||||||
return AccountOpResult.BadLink;
|
return AccountOpResult.BadLink;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BNET_GAME_ACCOUNT_LINK);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_BNET_GAME_ACCOUNT_LINK);
|
||||||
stmt.AddValue(0, bnetAccountId);
|
stmt.AddValue(0, bnetAccountId);
|
||||||
stmt.AddValue(1, GetMaxIndex(bnetAccountId) + 1);
|
stmt.AddValue(1, GetMaxIndex(bnetAccountId) + 1);
|
||||||
stmt.AddValue(2, gameAccountId);
|
stmt.AddValue(2, gameAccountId);
|
||||||
@@ -102,7 +102,7 @@ namespace Game
|
|||||||
if (GetIdByGameAccount(gameAccountId) == 0)
|
if (GetIdByGameAccount(gameAccountId) == 0)
|
||||||
return AccountOpResult.BadLink;
|
return AccountOpResult.BadLink;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BNET_GAME_ACCOUNT_LINK);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_BNET_GAME_ACCOUNT_LINK);
|
||||||
stmt.AddNull(0);
|
stmt.AddNull(0);
|
||||||
stmt.AddNull(1);
|
stmt.AddNull(1);
|
||||||
stmt.AddValue(2, gameAccountId);
|
stmt.AddValue(2, gameAccountId);
|
||||||
@@ -112,7 +112,7 @@ namespace Game
|
|||||||
|
|
||||||
public uint GetId(string username)
|
public uint GetId(string username)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_ACCOUNT_ID_BY_EMAIL);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_ACCOUNT_ID_BY_EMAIL);
|
||||||
stmt.AddValue(0, username);
|
stmt.AddValue(0, username);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -124,7 +124,7 @@ namespace Game
|
|||||||
public bool GetName(uint accountId, out string name)
|
public bool GetName(uint accountId, out string name)
|
||||||
{
|
{
|
||||||
name = "";
|
name = "";
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_ACCOUNT_EMAIL_BY_ID);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_ACCOUNT_EMAIL_BY_ID);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -138,7 +138,7 @@ namespace Game
|
|||||||
|
|
||||||
public uint GetIdByGameAccount(uint gameAccountId)
|
public uint GetIdByGameAccount(uint gameAccountId)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT);
|
||||||
stmt.AddValue(0, gameAccountId);
|
stmt.AddValue(0, gameAccountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -149,14 +149,14 @@ namespace Game
|
|||||||
|
|
||||||
public QueryCallback GetIdByGameAccountAsync(uint gameAccountId)
|
public QueryCallback GetIdByGameAccountAsync(uint gameAccountId)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT);
|
||||||
stmt.AddValue(0, gameAccountId);
|
stmt.AddValue(0, gameAccountId);
|
||||||
return DB.Login.AsyncQuery(stmt);
|
return DB.Login.AsyncQuery(stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte GetMaxIndex(uint accountId)
|
public byte GetMaxIndex(uint accountId)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_MAX_ACCOUNT_INDEX);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_MAX_ACCOUNT_INDEX);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ namespace Game.Accounts
|
|||||||
|
|
||||||
void SavePermission(uint permission, bool granted, int realmId)
|
void SavePermission(uint permission, bool granted, int realmId)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_RBAC_ACCOUNT_PERMISSION);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_RBAC_ACCOUNT_PERMISSION);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, permission);
|
stmt.AddValue(1, permission);
|
||||||
stmt.AddValue(2, granted);
|
stmt.AddValue(2, granted);
|
||||||
@@ -142,7 +142,7 @@ namespace Game.Accounts
|
|||||||
{
|
{
|
||||||
Log.outDebug(LogFilter.Rbac, "RBACData.RevokePermission [Id: {0} Name: {1}] (Permission {2}, RealmId {3}). Ok and DB updated",
|
Log.outDebug(LogFilter.Rbac, "RBACData.RevokePermission [Id: {0} Name: {1}] (Permission {2}, RealmId {3}). Ok and DB updated",
|
||||||
GetId(), GetName(), permissionId, realmId);
|
GetId(), GetName(), permissionId, realmId);
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_RBAC_ACCOUNT_PERMISSION);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_RBAC_ACCOUNT_PERMISSION);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, permissionId);
|
stmt.AddValue(1, permissionId);
|
||||||
stmt.AddValue(2, realmId);
|
stmt.AddValue(2, realmId);
|
||||||
@@ -163,7 +163,7 @@ namespace Game.Accounts
|
|||||||
|
|
||||||
Log.outDebug(LogFilter.Rbac, "RBACData.LoadFromDB [Id: {0} Name: {1}]: Loading permissions", GetId(), GetName());
|
Log.outDebug(LogFilter.Rbac, "RBACData.LoadFromDB [Id: {0} Name: {1}]: Loading permissions", GetId(), GetName());
|
||||||
// Load account permissions (granted and denied) that affect current realm
|
// Load account permissions (granted and denied) that affect current realm
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_RBAC_ACCOUNT_PERMISSIONS);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_RBAC_ACCOUNT_PERMISSIONS);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, GetRealmId());
|
stmt.AddValue(1, GetRealmId());
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ namespace Game.Accounts
|
|||||||
|
|
||||||
Log.outDebug(LogFilter.Rbac, "RBACData.LoadFromDB [Id: {0} Name: {1}]: Loading permissions", GetId(), GetName());
|
Log.outDebug(LogFilter.Rbac, "RBACData.LoadFromDB [Id: {0} Name: {1}]: Loading permissions", GetId(), GetName());
|
||||||
// Load account permissions (granted and denied) that affect current realm
|
// Load account permissions (granted and denied) that affect current realm
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_RBAC_ACCOUNT_PERMISSIONS);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_RBAC_ACCOUNT_PERMISSIONS);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, GetRealmId());
|
stmt.AddValue(1, GetRealmId());
|
||||||
|
|
||||||
|
|||||||
@@ -226,11 +226,11 @@ namespace Game.Achievements
|
|||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_ACHIEVEMENT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_ACHIEVEMENT);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_ACHIEVEMENT_PROGRESS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_ACHIEVEMENT_PROGRESS);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ namespace Game.Achievements
|
|||||||
// Removing non-existing criteria data for all characters
|
// Removing non-existing criteria data for all characters
|
||||||
Log.outError(LogFilter.Achievement, "Non-existing achievement criteria {0} data removed from table `character_achievement_progress`.", id);
|
Log.outError(LogFilter.Achievement, "Non-existing achievement criteria {0} data removed from table `character_achievement_progress`.", id);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_INVALID_ACHIEV_PROGRESS_CRITERIA);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_INVALID_ACHIEV_PROGRESS_CRITERIA);
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
continue;
|
continue;
|
||||||
@@ -318,12 +318,12 @@ namespace Game.Achievements
|
|||||||
if (!pair.Value.Changed)
|
if (!pair.Value.Changed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT);
|
||||||
stmt.AddValue(0, pair.Key);
|
stmt.AddValue(0, pair.Key);
|
||||||
stmt.AddValue(1, _owner.GetGUID().GetCounter());
|
stmt.AddValue(1, _owner.GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_ACHIEVEMENT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_ACHIEVEMENT);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
stmt.AddValue(2, pair.Value.Date);
|
stmt.AddValue(2, pair.Value.Date);
|
||||||
@@ -340,14 +340,14 @@ namespace Game.Achievements
|
|||||||
if (!pair.Value.Changed)
|
if (!pair.Value.Changed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_ACHIEVEMENT_PROGRESS_BY_CRITERIA);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_ACHIEVEMENT_PROGRESS_BY_CRITERIA);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
if (pair.Value.Counter != 0)
|
if (pair.Value.Counter != 0)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_ACHIEVEMENT_PROGRESS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_ACHIEVEMENT_PROGRESS);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
stmt.AddValue(2, pair.Value.Counter);
|
stmt.AddValue(2, pair.Value.Counter);
|
||||||
@@ -741,11 +741,11 @@ namespace Game.Achievements
|
|||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ALL_GUILD_ACHIEVEMENTS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ALL_GUILD_ACHIEVEMENTS);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ALL_GUILD_ACHIEVEMENT_CRITERIA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ALL_GUILD_ACHIEVEMENT_CRITERIA);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -799,7 +799,7 @@ namespace Game.Achievements
|
|||||||
// we will remove not existed criteria for all guilds
|
// we will remove not existed criteria for all guilds
|
||||||
Log.outError(LogFilter.Achievement, "Non-existing achievement criteria {0} data removed from table `guild_achievement_progress`.", id);
|
Log.outError(LogFilter.Achievement, "Non-existing achievement criteria {0} data removed from table `guild_achievement_progress`.", id);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_INVALID_ACHIEV_PROGRESS_CRITERIA_GUILD);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_INVALID_ACHIEV_PROGRESS_CRITERIA_GUILD);
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
continue;
|
continue;
|
||||||
@@ -829,12 +829,12 @@ namespace Game.Achievements
|
|||||||
if (!pair.Value.Changed)
|
if (!pair.Value.Changed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_ACHIEVEMENT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_ACHIEVEMENT);
|
||||||
stmt.AddValue(0, _owner.GetId());
|
stmt.AddValue(0, _owner.GetId());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_ACHIEVEMENT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_ACHIEVEMENT);
|
||||||
stmt.AddValue(0, _owner.GetId());
|
stmt.AddValue(0, _owner.GetId());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
stmt.AddValue(2, pair.Value.Date);
|
stmt.AddValue(2, pair.Value.Date);
|
||||||
@@ -852,12 +852,12 @@ namespace Game.Achievements
|
|||||||
if (!pair.Value.Changed)
|
if (!pair.Value.Changed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_ACHIEVEMENT_CRITERIA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_ACHIEVEMENT_CRITERIA);
|
||||||
stmt.AddValue(0, _owner.GetId());
|
stmt.AddValue(0, _owner.GetId());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_ACHIEVEMENT_CRITERIA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_ACHIEVEMENT_CRITERIA);
|
||||||
stmt.AddValue(0, _owner.GetId());
|
stmt.AddValue(0, _owner.GetId());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
stmt.AddValue(2, pair.Value.Counter);
|
stmt.AddValue(2, pair.Value.Counter);
|
||||||
@@ -1220,7 +1220,7 @@ namespace Game.Achievements
|
|||||||
// Remove non-existing achievements from all characters
|
// Remove non-existing achievements from all characters
|
||||||
Log.outError(LogFilter.Achievement, "Non-existing achievement {0} data has been removed from the table `character_achievement`.", achievementId);
|
Log.outError(LogFilter.Achievement, "Non-existing achievement {0} data has been removed from the table `character_achievement`.", achievementId);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_INVALID_ACHIEVMENT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_INVALID_ACHIEVMENT);
|
||||||
stmt.AddValue(0, achievementId);
|
stmt.AddValue(0, achievementId);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace Game.Arenas
|
|||||||
ulong captainLowGuid = captainGuid.GetCounter();
|
ulong captainLowGuid = captainGuid.GetCounter();
|
||||||
|
|
||||||
// Save arena team to db
|
// Save arena team to db
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ARENA_TEAM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ARENA_TEAM);
|
||||||
stmt.AddValue(0, teamId);
|
stmt.AddValue(0, teamId);
|
||||||
stmt.AddValue(1, TeamName);
|
stmt.AddValue(1, TeamName);
|
||||||
stmt.AddValue(2, captainLowGuid);
|
stmt.AddValue(2, captainLowGuid);
|
||||||
@@ -106,7 +106,7 @@ namespace Game.Arenas
|
|||||||
personalRating = 1000;
|
personalRating = 1000;
|
||||||
|
|
||||||
// Try to get player's match maker rating from db and fall back to config setting if not found
|
// Try to get player's match maker rating from db and fall back to config setting if not found
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MATCH_MAKER_RATING);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MATCH_MAKER_RATING);
|
||||||
stmt.AddValue(0, playerGuid.GetCounter());
|
stmt.AddValue(0, playerGuid.GetCounter());
|
||||||
stmt.AddValue(1, GetSlot());
|
stmt.AddValue(1, GetSlot());
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
@@ -137,7 +137,7 @@ namespace Game.Arenas
|
|||||||
Global.CharacterCacheStorage.UpdateCharacterArenaTeamId(playerGuid, GetSlot(), GetId());
|
Global.CharacterCacheStorage.UpdateCharacterArenaTeamId(playerGuid, GetSlot(), GetId());
|
||||||
|
|
||||||
// Save player's arena team membership to db
|
// Save player's arena team membership to db
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ARENA_TEAM_MEMBER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ARENA_TEAM_MEMBER);
|
||||||
stmt.AddValue(0, teamId);
|
stmt.AddValue(0, teamId);
|
||||||
stmt.AddValue(1, playerGuid.GetCounter());
|
stmt.AddValue(1, playerGuid.GetCounter());
|
||||||
stmt.AddValue(2, (ushort)personalRating);
|
stmt.AddValue(2, (ushort)personalRating);
|
||||||
@@ -243,7 +243,7 @@ namespace Game.Arenas
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
TeamName = name;
|
TeamName = name;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_NAME);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_NAME);
|
||||||
stmt.AddValue(0, TeamName);
|
stmt.AddValue(0, TeamName);
|
||||||
stmt.AddValue(1, GetId());
|
stmt.AddValue(1, GetId());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -261,7 +261,7 @@ namespace Game.Arenas
|
|||||||
CaptainGuid = guid;
|
CaptainGuid = guid;
|
||||||
|
|
||||||
// Update database
|
// Update database
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_CAPTAIN);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_CAPTAIN);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
stmt.AddValue(1, GetId());
|
stmt.AddValue(1, GetId());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -306,7 +306,7 @@ namespace Game.Arenas
|
|||||||
// Only used for single member deletion, for arena team disband we use a single query for more efficiency
|
// Only used for single member deletion, for arena team disband we use a single query for more efficiency
|
||||||
if (cleanDb)
|
if (cleanDb)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM_MEMBER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM_MEMBER);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, guid.GetCounter());
|
stmt.AddValue(1, guid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -330,11 +330,11 @@ namespace Game.Arenas
|
|||||||
// Update database
|
// Update database
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM);
|
||||||
stmt.AddValue(0, teamId);
|
stmt.AddValue(0, teamId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM_MEMBERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM_MEMBERS);
|
||||||
stmt.AddValue(0, teamId);
|
stmt.AddValue(0, teamId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -353,11 +353,11 @@ namespace Game.Arenas
|
|||||||
// Update database
|
// Update database
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM);
|
||||||
stmt.AddValue(0, teamId);
|
stmt.AddValue(0, teamId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM_MEMBERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM_MEMBERS);
|
||||||
stmt.AddValue(0, teamId);
|
stmt.AddValue(0, teamId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -679,7 +679,7 @@ namespace Game.Arenas
|
|||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_STATS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_STATS);
|
||||||
stmt.AddValue(0, stats.Rating);
|
stmt.AddValue(0, stats.Rating);
|
||||||
stmt.AddValue(1, stats.WeekGames);
|
stmt.AddValue(1, stats.WeekGames);
|
||||||
stmt.AddValue(2, stats.WeekWins);
|
stmt.AddValue(2, stats.WeekWins);
|
||||||
@@ -695,7 +695,7 @@ namespace Game.Arenas
|
|||||||
if (member.WeekGames == 0)
|
if (member.WeekGames == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_MEMBER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_MEMBER);
|
||||||
stmt.AddValue(0, member.PersonalRating);
|
stmt.AddValue(0, member.PersonalRating);
|
||||||
stmt.AddValue(1, member.WeekGames);
|
stmt.AddValue(1, member.WeekGames);
|
||||||
stmt.AddValue(2, member.WeekWins);
|
stmt.AddValue(2, member.WeekWins);
|
||||||
@@ -705,7 +705,7 @@ namespace Game.Arenas
|
|||||||
stmt.AddValue(6, member.Guid.GetCounter());
|
stmt.AddValue(6, member.Guid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_CHARACTER_ARENA_STATS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_CHARACTER_ARENA_STATS);
|
||||||
stmt.AddValue(0, member.Guid.GetCounter());
|
stmt.AddValue(0, member.Guid.GetCounter());
|
||||||
stmt.AddValue(1, GetSlot());
|
stmt.AddValue(1, GetSlot());
|
||||||
stmt.AddValue(2, member.MatchMakerRating);
|
stmt.AddValue(2, member.MatchMakerRating);
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ namespace Game
|
|||||||
// need to clear in case we are reloading
|
// need to clear in case we are reloading
|
||||||
_itemsByGuid.Clear();
|
_itemsByGuid.Clear();
|
||||||
|
|
||||||
SQLResult result = DB.Characters.Query(DB.Characters.GetPreparedStatement(CharStatements.SEL_AUCTION_ITEMS));
|
SQLResult result = DB.Characters.Query(CharacterDatabase.GetPreparedStatement(CharStatements.SEL_AUCTION_ITEMS));
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 auctions. DB table `auctionhouse` is empty.");
|
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 auctions. DB table `auctionhouse` is empty.");
|
||||||
@@ -181,7 +181,7 @@ namespace Game
|
|||||||
oldMSTime = Time.GetMSTime();
|
oldMSTime = Time.GetMSTime();
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
result = DB.Characters.Query(DB.Characters.GetPreparedStatement(CharStatements.SEL_AUCTION_BIDDERS));
|
result = DB.Characters.Query(CharacterDatabase.GetPreparedStatement(CharStatements.SEL_AUCTION_BIDDERS));
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
@@ -196,7 +196,7 @@ namespace Game
|
|||||||
oldMSTime = Time.GetMSTime();
|
oldMSTime = Time.GetMSTime();
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
result = DB.Characters.Query(DB.Characters.GetPreparedStatement(CharStatements.SEL_AUCTIONS));
|
result = DB.Characters.Query(CharacterDatabase.GetPreparedStatement(CharStatements.SEL_AUCTIONS));
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
@@ -210,7 +210,7 @@ namespace Game
|
|||||||
if (auctionHouse == null)
|
if (auctionHouse == null)
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Misc, $"Auction {auction.Id} has wrong auctionHouseId {auctionHouseId}");
|
Log.outError(LogFilter.Misc, $"Auction {auction.Id} has wrong auctionHouseId {auctionHouseId}");
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_AUCTION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_AUCTION);
|
||||||
stmt.AddValue(0, auction.Id);
|
stmt.AddValue(0, auction.Id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
continue;
|
continue;
|
||||||
@@ -219,7 +219,7 @@ namespace Game
|
|||||||
if (!itemsByAuction.ContainsKey(auction.Id))
|
if (!itemsByAuction.ContainsKey(auction.Id))
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Misc, $"Auction {auction.Id} has no items");
|
Log.outError(LogFilter.Misc, $"Auction {auction.Id} has no items");
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_AUCTION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_AUCTION);
|
||||||
stmt.AddValue(0, auction.Id);
|
stmt.AddValue(0, auction.Id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
continue;
|
continue;
|
||||||
@@ -337,7 +337,7 @@ namespace Game
|
|||||||
if (auction != null)
|
if (auction != null)
|
||||||
auction.EndTime = GameTime.GetSystemTime();
|
auction.EndTime = GameTime.GetSystemTime();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_AUCTION_EXPIRATION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_AUCTION_EXPIRATION);
|
||||||
stmt.AddValue(0, (uint)GameTime.GetGameTime());
|
stmt.AddValue(0, (uint)GameTime.GetGameTime());
|
||||||
stmt.AddValue(1, pendingAuction.AuctionId);
|
stmt.AddValue(1, pendingAuction.AuctionId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -377,7 +377,7 @@ namespace Game
|
|||||||
if (auction != null)
|
if (auction != null)
|
||||||
auction.EndTime = GameTime.GetSystemTime();
|
auction.EndTime = GameTime.GetSystemTime();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_AUCTION_EXPIRATION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_AUCTION_EXPIRATION);
|
||||||
stmt.AddValue(0, (uint)GameTime.GetGameTime());
|
stmt.AddValue(0, (uint)GameTime.GetGameTime());
|
||||||
stmt.AddValue(1, pendingAuction.AuctionId);
|
stmt.AddValue(1, pendingAuction.AuctionId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -630,7 +630,7 @@ namespace Game
|
|||||||
|
|
||||||
if (trans != null)
|
if (trans != null)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_AUCTION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_AUCTION);
|
||||||
stmt.AddValue(0, auction.Id);
|
stmt.AddValue(0, auction.Id);
|
||||||
stmt.AddValue(1, _auctionHouse.Id);
|
stmt.AddValue(1, _auctionHouse.Id);
|
||||||
stmt.AddValue(2, auction.Owner.GetCounter());
|
stmt.AddValue(2, auction.Owner.GetCounter());
|
||||||
@@ -646,7 +646,7 @@ namespace Game
|
|||||||
|
|
||||||
foreach (Item item in auction.Items)
|
foreach (Item item in auction.Items)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_AUCTION_ITEMS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_AUCTION_ITEMS);
|
||||||
stmt.AddValue(0, auction.Id);
|
stmt.AddValue(0, auction.Id);
|
||||||
stmt.AddValue(1, item.GetGUID().GetCounter());
|
stmt.AddValue(1, item.GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -738,7 +738,7 @@ namespace Game
|
|||||||
else
|
else
|
||||||
_buckets.Remove(bucket.Key);
|
_buckets.Remove(bucket.Key);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_AUCTION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_AUCTION);
|
||||||
stmt.AddValue(0, auction.Id);
|
stmt.AddValue(0, auction.Id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -1325,7 +1325,7 @@ namespace Game
|
|||||||
|
|
||||||
for (int i = 0; i < batch.ItemsCount; ++i)
|
for (int i = 0; i < batch.ItemsCount; ++i)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_AUCTION_ITEMS_BY_ITEM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_AUCTION_ITEMS_BY_ITEM);
|
||||||
stmt.AddValue(0, batch.Items[i].GetGUID().GetCounter());
|
stmt.AddValue(0, batch.Items[i].GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -1429,7 +1429,7 @@ namespace Game
|
|||||||
// owner in `data` will set at mail receive and item extracting
|
// owner in `data` will set at mail receive and item extracting
|
||||||
foreach (Item item in auction.Items)
|
foreach (Item item in auction.Items)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ITEM_OWNER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ITEM_OWNER);
|
||||||
stmt.AddValue(0, auction.Bidder.GetCounter());
|
stmt.AddValue(0, auction.Bidder.GetCounter());
|
||||||
stmt.AddValue(1, item.GetGUID().GetCounter());
|
stmt.AddValue(1, item.GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|||||||
@@ -669,13 +669,13 @@ namespace Game.BattleGrounds
|
|||||||
ulong battlegroundId = 1;
|
ulong battlegroundId = 1;
|
||||||
if (IsBattleground() && WorldConfig.GetBoolValue(WorldCfg.BattlegroundStoreStatisticsEnable))
|
if (IsBattleground() && WorldConfig.GetBoolValue(WorldCfg.BattlegroundStoreStatisticsEnable))
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PVPSTATS_MAXID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PVPSTATS_MAXID);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
battlegroundId = result.Read<ulong>(0) + 1;
|
battlegroundId = result.Read<ulong>(0) + 1;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PVPSTATS_BATTLEGROUND);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PVPSTATS_BATTLEGROUND);
|
||||||
stmt.AddValue(0, battlegroundId);
|
stmt.AddValue(0, battlegroundId);
|
||||||
stmt.AddValue(1, (byte)GetWinner());
|
stmt.AddValue(1, (byte)GetWinner());
|
||||||
stmt.AddValue(2, GetUniqueBracketId());
|
stmt.AddValue(2, GetUniqueBracketId());
|
||||||
@@ -725,7 +725,7 @@ namespace Game.BattleGrounds
|
|||||||
|
|
||||||
if (IsBattleground() && WorldConfig.GetBoolValue(WorldCfg.BattlegroundStoreStatisticsEnable))
|
if (IsBattleground() && WorldConfig.GetBoolValue(WorldCfg.BattlegroundStoreStatisticsEnable))
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PVPSTATS_PLAYER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PVPSTATS_PLAYER);
|
||||||
var score = PlayerScores.LookupByKey(player.GetGUID());
|
var score = PlayerScores.LookupByKey(player.GetGUID());
|
||||||
|
|
||||||
stmt.AddValue(0, battlegroundId);
|
stmt.AddValue(0, battlegroundId);
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ namespace Game.BattlePets
|
|||||||
switch (pair.Value.SaveInfo)
|
switch (pair.Value.SaveInfo)
|
||||||
{
|
{
|
||||||
case BattlePetSaveInfo.New:
|
case BattlePetSaveInfo.New:
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_BATTLE_PETS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_BATTLE_PETS);
|
||||||
stmt.AddValue(0, pair.Key);
|
stmt.AddValue(0, pair.Key);
|
||||||
stmt.AddValue(1, _owner.GetBattlenetAccountId());
|
stmt.AddValue(1, _owner.GetBattlenetAccountId());
|
||||||
stmt.AddValue(2, pair.Value.PacketInfo.Species);
|
stmt.AddValue(2, pair.Value.PacketInfo.Species);
|
||||||
@@ -305,7 +305,7 @@ namespace Game.BattlePets
|
|||||||
|
|
||||||
if (pair.Value.DeclinedName != null)
|
if (pair.Value.DeclinedName != null)
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_BATTLE_PET_DECLINED_NAME);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_BATTLE_PET_DECLINED_NAME);
|
||||||
stmt.AddValue(0, pair.Key);
|
stmt.AddValue(0, pair.Key);
|
||||||
|
|
||||||
for (byte i = 0; i < SharedConst.MaxDeclinedNameCases; i++)
|
for (byte i = 0; i < SharedConst.MaxDeclinedNameCases; i++)
|
||||||
@@ -318,7 +318,7 @@ namespace Game.BattlePets
|
|||||||
pair.Value.SaveInfo = BattlePetSaveInfo.Unchanged;
|
pair.Value.SaveInfo = BattlePetSaveInfo.Unchanged;
|
||||||
break;
|
break;
|
||||||
case BattlePetSaveInfo.Changed:
|
case BattlePetSaveInfo.Changed:
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BATTLE_PETS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_BATTLE_PETS);
|
||||||
stmt.AddValue(0, pair.Value.PacketInfo.Level);
|
stmt.AddValue(0, pair.Value.PacketInfo.Level);
|
||||||
stmt.AddValue(1, pair.Value.PacketInfo.Exp);
|
stmt.AddValue(1, pair.Value.PacketInfo.Exp);
|
||||||
stmt.AddValue(2, pair.Value.PacketInfo.Health);
|
stmt.AddValue(2, pair.Value.PacketInfo.Health);
|
||||||
@@ -330,13 +330,13 @@ namespace Game.BattlePets
|
|||||||
stmt.AddValue(8, pair.Key);
|
stmt.AddValue(8, pair.Key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_BATTLE_PET_DECLINED_NAME);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_BATTLE_PET_DECLINED_NAME);
|
||||||
stmt.AddValue(0, pair.Key);
|
stmt.AddValue(0, pair.Key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
if (pair.Value.DeclinedName != null)
|
if (pair.Value.DeclinedName != null)
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_BATTLE_PET_DECLINED_NAME);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_BATTLE_PET_DECLINED_NAME);
|
||||||
stmt.AddValue(0, pair.Key);
|
stmt.AddValue(0, pair.Key);
|
||||||
|
|
||||||
for (byte i = 0; i < SharedConst.MaxDeclinedNameCases; i++)
|
for (byte i = 0; i < SharedConst.MaxDeclinedNameCases; i++)
|
||||||
@@ -348,11 +348,11 @@ namespace Game.BattlePets
|
|||||||
pair.Value.SaveInfo = BattlePetSaveInfo.Unchanged;
|
pair.Value.SaveInfo = BattlePetSaveInfo.Unchanged;
|
||||||
break;
|
break;
|
||||||
case BattlePetSaveInfo.Removed:
|
case BattlePetSaveInfo.Removed:
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_BATTLE_PET_DECLINED_NAME);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_BATTLE_PET_DECLINED_NAME);
|
||||||
stmt.AddValue(0, pair.Key);
|
stmt.AddValue(0, pair.Key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_BATTLE_PETS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_BATTLE_PETS);
|
||||||
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -361,13 +361,13 @@ namespace Game.BattlePets
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_BATTLE_PET_SLOTS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_BATTLE_PET_SLOTS);
|
||||||
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
foreach (var slot in _slots)
|
foreach (var slot in _slots)
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_BATTLE_PET_SLOTS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_BATTLE_PET_SLOTS);
|
||||||
stmt.AddValue(0, slot.Index);
|
stmt.AddValue(0, slot.Index);
|
||||||
stmt.AddValue(1, _owner.GetBattlenetAccountId());
|
stmt.AddValue(1, _owner.GetBattlenetAccountId());
|
||||||
stmt.AddValue(2, slot.Pet.Guid.GetCounter());
|
stmt.AddValue(2, slot.Pet.Guid.GetCounter());
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ namespace Game.BlackMarket
|
|||||||
|
|
||||||
public void SaveToDB(SQLTransaction trans)
|
public void SaveToDB(SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_BLACKMARKET_AUCTIONS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_BLACKMARKET_AUCTIONS);
|
||||||
|
|
||||||
stmt.AddValue(0, _marketId);
|
stmt.AddValue(0, _marketId);
|
||||||
stmt.AddValue(1, _currentBid);
|
stmt.AddValue(1, _currentBid);
|
||||||
@@ -139,7 +139,7 @@ namespace Game.BlackMarket
|
|||||||
|
|
||||||
public void DeleteFromDB(SQLTransaction trans)
|
public void DeleteFromDB(SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_BLACKMARKET_AUCTIONS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_BLACKMARKET_AUCTIONS);
|
||||||
stmt.AddValue(0, _marketId);
|
stmt.AddValue(0, _marketId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ namespace Game.BlackMarket
|
|||||||
player.ModifyMoney(-(long)bid);
|
player.ModifyMoney(-(long)bid);
|
||||||
|
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_BLACKMARKET_AUCTIONS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_BLACKMARKET_AUCTIONS);
|
||||||
|
|
||||||
stmt.AddValue(0, _currentBid);
|
stmt.AddValue(0, _currentBid);
|
||||||
stmt.AddValue(1, GetExpirationTime());
|
stmt.AddValue(1, GetExpirationTime());
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace Game.BlackMarket
|
|||||||
// Clear in case we are reloading
|
// Clear in case we are reloading
|
||||||
_auctions.Clear();
|
_auctions.Clear();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_BLACKMARKET_AUCTIONS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_BLACKMARKET_AUCTIONS);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ namespace Game
|
|||||||
for (int i = 0; i < eventInvites.Count; ++i)
|
for (int i = 0; i < eventInvites.Count; ++i)
|
||||||
{
|
{
|
||||||
CalendarInvite invite = eventInvites[i];
|
CalendarInvite invite = eventInvites[i];
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CALENDAR_INVITE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CALENDAR_INVITE);
|
||||||
stmt.AddValue(0, invite.InviteId);
|
stmt.AddValue(0, invite.InviteId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ namespace Game
|
|||||||
|
|
||||||
_invites.Remove(calendarEvent.EventId);
|
_invites.Remove(calendarEvent.EventId);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CALENDAR_EVENT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CALENDAR_EVENT);
|
||||||
stmt.AddValue(0, calendarEvent.EventId);
|
stmt.AddValue(0, calendarEvent.EventId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
DB.Characters.CommitTransaction(trans);
|
DB.Characters.CommitTransaction(trans);
|
||||||
@@ -194,7 +194,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CALENDAR_INVITE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CALENDAR_INVITE);
|
||||||
stmt.AddValue(0, calendarInvite.InviteId);
|
stmt.AddValue(0, calendarInvite.InviteId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
DB.Characters.CommitTransaction(trans);
|
DB.Characters.CommitTransaction(trans);
|
||||||
@@ -215,7 +215,7 @@ namespace Game
|
|||||||
public void UpdateEvent(CalendarEvent calendarEvent)
|
public void UpdateEvent(CalendarEvent calendarEvent)
|
||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_CALENDAR_EVENT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_CALENDAR_EVENT);
|
||||||
stmt.AddValue(0, calendarEvent.EventId);
|
stmt.AddValue(0, calendarEvent.EventId);
|
||||||
stmt.AddValue(1, calendarEvent.OwnerGuid.GetCounter());
|
stmt.AddValue(1, calendarEvent.OwnerGuid.GetCounter());
|
||||||
stmt.AddValue(2, calendarEvent.Title);
|
stmt.AddValue(2, calendarEvent.Title);
|
||||||
@@ -231,7 +231,7 @@ namespace Game
|
|||||||
|
|
||||||
public void UpdateInvite(CalendarInvite invite, SQLTransaction trans = null)
|
public void UpdateInvite(CalendarInvite invite, SQLTransaction trans = null)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_CALENDAR_INVITE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_CALENDAR_INVITE);
|
||||||
stmt.AddValue(0, invite.InviteId);
|
stmt.AddValue(0, invite.InviteId);
|
||||||
stmt.AddValue(1, invite.EventId);
|
stmt.AddValue(1, invite.EventId);
|
||||||
stmt.AddValue(2, invite.InviteeGuid.GetCounter());
|
stmt.AddValue(2, invite.InviteeGuid.GetCounter());
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace Game.Chat
|
|||||||
foreach (var iter in _bannedStore)
|
foreach (var iter in _bannedStore)
|
||||||
banlist += iter.GetRawValue().ToHexString() + ' ';
|
banlist += iter.GetRawValue().ToHexString() + ' ';
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHANNEL);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHANNEL);
|
||||||
stmt.AddValue(0, _channelName);
|
stmt.AddValue(0, _channelName);
|
||||||
stmt.AddValue(1, (uint)_channelTeam);
|
stmt.AddValue(1, (uint)_channelTeam);
|
||||||
stmt.AddValue(2, _announceEnabled);
|
stmt.AddValue(2, _announceEnabled);
|
||||||
@@ -108,7 +108,7 @@ namespace Game.Chat
|
|||||||
{
|
{
|
||||||
if (!_playersStore.Empty())
|
if (!_playersStore.Empty())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHANNEL_USAGE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHANNEL_USAGE);
|
||||||
stmt.AddValue(0, _channelName);
|
stmt.AddValue(0, _channelName);
|
||||||
stmt.AddValue(1, (uint)_channelTeam);
|
stmt.AddValue(1, (uint)_channelTeam);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Game.Chat
|
|||||||
uint days = WorldConfig.GetUIntValue(WorldCfg.PreserveCustomChannelDuration);
|
uint days = WorldConfig.GetUIntValue(WorldCfg.PreserveCustomChannelDuration);
|
||||||
if (days != 0)
|
if (days != 0)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_OLD_CHANNELS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_OLD_CHANNELS);
|
||||||
stmt.AddValue(0, days * Time.Day);
|
stmt.AddValue(0, days * Time.Day);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ namespace Game.Chat
|
|||||||
|
|
||||||
foreach (var (name, team) in toDelete)
|
foreach (var (name, team) in toDelete)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHANNEL);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHANNEL);
|
||||||
stmt.AddValue(0, name);
|
stmt.AddValue(0, name);
|
||||||
stmt.AddValue(1, (uint)team);
|
stmt.AddValue(1, (uint)team);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_COMMANDS);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_COMMANDS);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Game.Chat
|
|||||||
string emailoutput;
|
string emailoutput;
|
||||||
uint accountId = session.GetAccountId();
|
uint accountId = session.GetAccountId();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.GET_EMAIL_BY_ID);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.GET_EMAIL_BY_ID);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ namespace Game.Chat
|
|||||||
uint accountId = handler.GetSession().GetAccountId();
|
uint accountId = handler.GetSession().GetAccountId();
|
||||||
byte[] secret;
|
byte[] secret;
|
||||||
{ // get current TOTP secret
|
{ // get current TOTP secret
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_TOTP_SECRET);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_TOTP_SECRET);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ namespace Game.Chat
|
|||||||
|
|
||||||
if (TOTP.ValidateToken(secret, token.Value))
|
if (TOTP.ValidateToken(secret, token.Value))
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_TOTP_SECRET);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_TOTP_SECRET);
|
||||||
stmt.AddNull(0);
|
stmt.AddNull(0);
|
||||||
stmt.AddValue(1, accountId);
|
stmt.AddValue(1, accountId);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -130,7 +130,7 @@ namespace Game.Chat
|
|||||||
uint accountId = handler.GetSession().GetAccountId();
|
uint accountId = handler.GetSession().GetAccountId();
|
||||||
|
|
||||||
{ // check if 2FA already enabled
|
{ // check if 2FA already enabled
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_TOTP_SECRET);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_TOTP_SECRET);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ namespace Game.Chat
|
|||||||
if (masterKey.IsValid())
|
if (masterKey.IsValid())
|
||||||
AES.Encrypt(suggestions[accountId], masterKey.GetValue());
|
AES.Encrypt(suggestions[accountId], masterKey.GetValue());
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_TOTP_SECRET);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_TOTP_SECRET);
|
||||||
stmt.AddValue(0, suggestions[accountId]);
|
stmt.AddValue(0, suggestions[accountId]);
|
||||||
stmt.AddValue(1, accountId);
|
stmt.AddValue(1, accountId);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -187,7 +187,7 @@ namespace Game.Chat
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_EXPANSION);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_EXPANSION);
|
||||||
stmt.AddValue(0, expansion);
|
stmt.AddValue(0, expansion);
|
||||||
stmt.AddValue(1, handler.GetSession().GetAccountId());
|
stmt.AddValue(1, handler.GetSession().GetAccountId());
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -398,14 +398,14 @@ namespace Game.Chat
|
|||||||
/*var ipBytes = System.Net.IPAddress.Parse(handler.GetSession().GetRemoteAddress()).GetAddressBytes();
|
/*var ipBytes = System.Net.IPAddress.Parse(handler.GetSession().GetRemoteAddress()).GetAddressBytes();
|
||||||
Array.Reverse(ipBytes);
|
Array.Reverse(ipBytes);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_LOGON_COUNTRY);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_LOGON_COUNTRY);
|
||||||
stmt.AddValue(0, BitConverter.ToUInt32(ipBytes, 0));
|
stmt.AddValue(0, BitConverter.ToUInt32(ipBytes, 0));
|
||||||
|
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
string country = result.Read<string>(0);
|
string country = result.Read<string>(0);
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_COUNTRY);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_COUNTRY);
|
||||||
stmt.AddValue(0, country);
|
stmt.AddValue(0, country);
|
||||||
stmt.AddValue(1, handler.GetSession().GetAccountId());
|
stmt.AddValue(1, handler.GetSession().GetAccountId());
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -419,7 +419,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_COUNTRY);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_COUNTRY);
|
||||||
stmt.AddValue(0, "00");
|
stmt.AddValue(0, "00");
|
||||||
stmt.AddValue(1, handler.GetSession().GetAccountId());
|
stmt.AddValue(1, handler.GetSession().GetAccountId());
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -431,7 +431,7 @@ namespace Game.Chat
|
|||||||
[Command("ip", CypherStrings.CommandAccLockIpHelp, RBACPermissions.CommandAccountLockIp)]
|
[Command("ip", CypherStrings.CommandAccLockIpHelp, RBACPermissions.CommandAccountLockIp)]
|
||||||
static bool HandleAccountLockIpCommand(CommandHandler handler, bool state)
|
static bool HandleAccountLockIpCommand(CommandHandler handler, bool state)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK);
|
||||||
|
|
||||||
if (state)
|
if (state)
|
||||||
{
|
{
|
||||||
@@ -566,7 +566,7 @@ namespace Game.Chat
|
|||||||
PreparedStatement stmt;
|
PreparedStatement stmt;
|
||||||
if (secret == "off")
|
if (secret == "off")
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_TOTP_SECRET);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_TOTP_SECRET);
|
||||||
stmt.AddNull(0);
|
stmt.AddNull(0);
|
||||||
stmt.AddValue(1, targetAccountId);
|
stmt.AddValue(1, targetAccountId);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -596,7 +596,7 @@ namespace Game.Chat
|
|||||||
if (masterKey.IsValid())
|
if (masterKey.IsValid())
|
||||||
AES.Encrypt(decoded, masterKey.GetValue());
|
AES.Encrypt(decoded, masterKey.GetValue());
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_TOTP_SECRET);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_TOTP_SECRET);
|
||||||
stmt.AddValue(0, decoded);
|
stmt.AddValue(0, decoded);
|
||||||
stmt.AddValue(1, targetAccountId);
|
stmt.AddValue(1, targetAccountId);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -639,7 +639,7 @@ namespace Game.Chat
|
|||||||
if (expansion > WorldConfig.GetIntValue(WorldCfg.Expansion))
|
if (expansion > WorldConfig.GetIntValue(WorldCfg.Expansion))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_EXPANSION);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_EXPANSION);
|
||||||
|
|
||||||
stmt.AddValue(0, expansion);
|
stmt.AddValue(0, expansion);
|
||||||
stmt.AddValue(1, accountId);
|
stmt.AddValue(1, accountId);
|
||||||
@@ -743,7 +743,7 @@ namespace Game.Chat
|
|||||||
// Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1
|
// Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1
|
||||||
if (realmID == -1 && !Global.AccountMgr.IsConsoleAccount(playerSecurity))
|
if (realmID == -1 && !Global.AccountMgr.IsConsoleAccount(playerSecurity))
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_ACCESS_SECLEVEL_TEST);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_ACCESS_SECLEVEL_TEST);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
stmt.AddValue(1, securityLevel);
|
stmt.AddValue(1, securityLevel);
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ namespace Game.Chat.Commands
|
|||||||
[Command("listgameaccounts", RBACPermissions.CommandBnetAccountListGameAccounts, true)]
|
[Command("listgameaccounts", RBACPermissions.CommandBnetAccountListGameAccounts, true)]
|
||||||
static bool HandleListGameAccountsCommand(CommandHandler handler, string battlenetAccountName)
|
static bool HandleListGameAccountsCommand(CommandHandler handler, string battlenetAccountName)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_GAME_ACCOUNT_LIST);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_GAME_ACCOUNT_LIST);
|
||||||
stmt.AddValue(0, battlenetAccountName);
|
stmt.AddValue(0, battlenetAccountName);
|
||||||
|
|
||||||
SQLResult accountList = DB.Login.Query(stmt);
|
SQLResult accountList = DB.Login.Query(stmt);
|
||||||
@@ -250,7 +250,7 @@ namespace Game.Chat.Commands
|
|||||||
[Command("ip", RBACPermissions.CommandBnetAccountLockIp, true)]
|
[Command("ip", RBACPermissions.CommandBnetAccountLockIp, true)]
|
||||||
static bool HandleAccountLockIpCommand(CommandHandler handler, bool state)
|
static bool HandleAccountLockIpCommand(CommandHandler handler, bool state)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BNET_ACCOUNT_LOCK);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_BNET_ACCOUNT_LOCK);
|
||||||
|
|
||||||
if (state)
|
if (state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ namespace Game.Chat.Commands
|
|||||||
else
|
else
|
||||||
targetGuid = target.GetGUID();
|
targetGuid = target.GetGUID();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_BANINFO);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_BANINFO);
|
||||||
stmt.AddValue(0, targetGuid.GetCounter());
|
stmt.AddValue(0, targetGuid.GetCounter());
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
@@ -271,18 +271,18 @@ namespace Game.Chat.Commands
|
|||||||
[Command("account", RBACPermissions.CommandBanlistAccount, true)]
|
[Command("account", RBACPermissions.CommandBanlistAccount, true)]
|
||||||
static bool HandleBanListAccountCommand(CommandHandler handler, [OptionalArg] string filter)
|
static bool HandleBanListAccountCommand(CommandHandler handler, [OptionalArg] string filter)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.DelExpiredIpBans);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DelExpiredIpBans);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
|
|
||||||
SQLResult result;
|
SQLResult result;
|
||||||
if (filter.IsEmpty())
|
if (filter.IsEmpty())
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BANNED_ALL);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BANNED_ALL);
|
||||||
result = DB.Login.Query(stmt);
|
result = DB.Login.Query(stmt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BANNED_BY_FILTER);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BANNED_BY_FILTER);
|
||||||
stmt.AddValue(0, filter);
|
stmt.AddValue(0, filter);
|
||||||
result = DB.Login.Query(stmt);
|
result = DB.Login.Query(stmt);
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ namespace Game.Chat.Commands
|
|||||||
if (filter.IsEmpty())
|
if (filter.IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GUID_BY_NAME_FILTER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GUID_BY_NAME_FILTER);
|
||||||
stmt.AddValue(0, filter);
|
stmt.AddValue(0, filter);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
@@ -319,7 +319,7 @@ namespace Game.Chat.Commands
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
||||||
PreparedStatement stmt2 = DB.Characters.GetPreparedStatement(CharStatements.SEL_BANNED_NAME);
|
PreparedStatement stmt2 = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_BANNED_NAME);
|
||||||
stmt2.AddValue(0, result.Read<ulong>(0));
|
stmt2.AddValue(0, result.Read<ulong>(0));
|
||||||
SQLResult banResult = DB.Characters.Query(stmt2);
|
SQLResult banResult = DB.Characters.Query(stmt2);
|
||||||
if (!banResult.IsEmpty())
|
if (!banResult.IsEmpty())
|
||||||
@@ -339,7 +339,7 @@ namespace Game.Chat.Commands
|
|||||||
|
|
||||||
string char_name = result.Read<string>(1);
|
string char_name = result.Read<string>(1);
|
||||||
|
|
||||||
PreparedStatement stmt2 = DB.Characters.GetPreparedStatement(CharStatements.SEL_BANINFO_LIST);
|
PreparedStatement stmt2 = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_BANINFO_LIST);
|
||||||
stmt2.AddValue(0, result.Read<ulong>(0));
|
stmt2.AddValue(0, result.Read<ulong>(0));
|
||||||
SQLResult banInfo = DB.Characters.Query(stmt2);
|
SQLResult banInfo = DB.Characters.Query(stmt2);
|
||||||
if (!banInfo.IsEmpty())
|
if (!banInfo.IsEmpty())
|
||||||
@@ -380,19 +380,19 @@ namespace Game.Chat.Commands
|
|||||||
[Command("ip", RBACPermissions.CommandBanlistIp, true)]
|
[Command("ip", RBACPermissions.CommandBanlistIp, true)]
|
||||||
static bool HandleBanListIPCommand(CommandHandler handler, [OptionalArg] string filter)
|
static bool HandleBanListIPCommand(CommandHandler handler, [OptionalArg] string filter)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.DelExpiredIpBans);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DelExpiredIpBans);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
|
|
||||||
SQLResult result;
|
SQLResult result;
|
||||||
|
|
||||||
if (filter.IsEmpty())
|
if (filter.IsEmpty())
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_IP_BANNED_ALL);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_IP_BANNED_ALL);
|
||||||
result = DB.Login.Query(stmt);
|
result = DB.Login.Query(stmt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_IP_BANNED_BY_IP);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_IP_BANNED_BY_IP);
|
||||||
stmt.AddValue(0, filter);
|
stmt.AddValue(0, filter);
|
||||||
result = DB.Login.Query(stmt);
|
result = DB.Login.Query(stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
||||||
stmt.AddValue(0, newName);
|
stmt.AddValue(0, newName);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -111,7 +111,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove declined name from db
|
// Remove declined name from db
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
|
||||||
stmt.AddValue(0, player.GetGUID().GetCounter());
|
stmt.AddValue(0, player.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_NAME_BY_GUID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_NAME_BY_GUID);
|
||||||
stmt.AddValue(0, newName);
|
stmt.AddValue(0, newName);
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -160,7 +160,7 @@ namespace Game.Chat
|
|||||||
|
|
||||||
handler.SendSysMessage(CypherStrings.RenamePlayerGuid, handler.PlayerLink(player.GetName()), player.GetGUID().ToString());
|
handler.SendSysMessage(CypherStrings.RenamePlayerGuid, handler.PlayerLink(player.GetName()), player.GetGUID().ToString());
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||||
stmt.AddValue(0, (ushort)AtLoginFlags.Rename);
|
stmt.AddValue(0, (ushort)AtLoginFlags.Rename);
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -206,7 +206,7 @@ namespace Game.Chat
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Update level and reset XP, everything else will be updated at login
|
// Update level and reset XP, everything else will be updated at login
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_LEVEL);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_LEVEL);
|
||||||
stmt.AddValue(0, (byte)newlevel);
|
stmt.AddValue(0, (byte)newlevel);
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -235,7 +235,7 @@ namespace Game.Chat
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, handler.PlayerLink(player.GetName()), player.GetGUID().GetCounter());
|
handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, handler.PlayerLink(player.GetName()), player.GetGUID().GetCounter());
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||||
stmt.AddValue(0, (ushort)AtLoginFlags.Customize);
|
stmt.AddValue(0, (ushort)AtLoginFlags.Customize);
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -279,7 +279,7 @@ namespace Game.Chat
|
|||||||
if (onlinePlayer != null)
|
if (onlinePlayer != null)
|
||||||
onlinePlayer.GetSession().KickPlayer("HandleCharacterChangeAccountCommand GM Command transferring character to another account");
|
onlinePlayer.GetSession().KickPlayer("HandleCharacterChangeAccountCommand GM Command transferring character to another account");
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ACCOUNT_BY_GUID);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ACCOUNT_BY_GUID);
|
||||||
stmt.AddValue(0, newAccount.GetID());
|
stmt.AddValue(0, newAccount.GetID());
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
DB.Characters.DirectExecute(stmt);
|
DB.Characters.DirectExecute(stmt);
|
||||||
@@ -321,7 +321,7 @@ namespace Game.Chat
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, handler.PlayerLink(player.GetName()), player.GetGUID().GetCounter());
|
handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, handler.PlayerLink(player.GetName()), player.GetGUID().GetCounter());
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||||
stmt.AddValue(0, (ushort)AtLoginFlags.ChangeFaction);
|
stmt.AddValue(0, (ushort)AtLoginFlags.ChangeFaction);
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -347,7 +347,7 @@ namespace Game.Chat
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, handler.PlayerLink(player.GetName()), player.GetGUID().GetCounter());
|
handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, handler.PlayerLink(player.GetName()), player.GetGUID().GetCounter());
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||||
stmt.AddValue(0, (ushort)AtLoginFlags.ChangeRace);
|
stmt.AddValue(0, (ushort)AtLoginFlags.ChangeRace);
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -547,7 +547,7 @@ namespace Game.Chat
|
|||||||
if (!ulong.TryParse(searchString, out ulong guid))
|
if (!ulong.TryParse(searchString, out ulong guid))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_DEL_INFO_BY_GUID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_DEL_INFO_BY_GUID);
|
||||||
stmt.AddValue(0, guid);
|
stmt.AddValue(0, guid);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
}
|
}
|
||||||
@@ -557,14 +557,14 @@ namespace Game.Chat
|
|||||||
if (!ObjectManager.NormalizePlayerName(ref searchString))
|
if (!ObjectManager.NormalizePlayerName(ref searchString))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_DEL_INFO_BY_NAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_DEL_INFO_BY_NAME);
|
||||||
stmt.AddValue(0, searchString);
|
stmt.AddValue(0, searchString);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_DEL_INFO);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_DEL_INFO);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -638,7 +638,7 @@ namespace Game.Chat
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_RESTORE_DELETE_INFO);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_RESTORE_DELETE_INFO);
|
||||||
stmt.AddValue(0, delInfo.name);
|
stmt.AddValue(0, delInfo.name);
|
||||||
stmt.AddValue(1, delInfo.accountId);
|
stmt.AddValue(1, delInfo.accountId);
|
||||||
stmt.AddValue(2, delInfo.guid.GetCounter());
|
stmt.AddValue(2, delInfo.guid.GetCounter());
|
||||||
@@ -694,7 +694,7 @@ namespace Game.Chat
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Update level and reset XP, everything else will be updated at login
|
// Update level and reset XP, everything else will be updated at login
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_LEVEL);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_LEVEL);
|
||||||
stmt.AddValue(0, newlevel);
|
stmt.AddValue(0, newlevel);
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ namespace Game.Chat.Commands
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_DISABLES);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_DISABLES);
|
||||||
stmt.AddValue(0, entry);
|
stmt.AddValue(0, entry);
|
||||||
stmt.AddValue(1, (byte)disableType);
|
stmt.AddValue(1, (byte)disableType);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
@@ -110,7 +110,7 @@ namespace Game.Chat.Commands
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.INS_DISABLES);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_DISABLES);
|
||||||
stmt.AddValue(0, entry);
|
stmt.AddValue(0, entry);
|
||||||
stmt.AddValue(1, (byte)disableType);
|
stmt.AddValue(1, (byte)disableType);
|
||||||
stmt.AddValue(2, flags);
|
stmt.AddValue(2, flags);
|
||||||
@@ -178,7 +178,7 @@ namespace Game.Chat.Commands
|
|||||||
if (entry == 0)
|
if (entry == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_DISABLES);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_DISABLES);
|
||||||
stmt.AddValue(0, entry);
|
stmt.AddValue(0, entry);
|
||||||
stmt.AddValue(1, (byte)disableType);
|
stmt.AddValue(1, (byte)disableType);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
@@ -188,7 +188,7 @@ namespace Game.Chat.Commands
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_DISABLES);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_DISABLES);
|
||||||
stmt.AddValue(0, entry);
|
stmt.AddValue(0, entry);
|
||||||
stmt.AddValue(1, (byte)disableType);
|
stmt.AddValue(1, (byte)disableType);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ namespace Game.Chat
|
|||||||
static bool HandleGMListFullCommand(CommandHandler handler)
|
static bool HandleGMListFullCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
// Get the accounts with GM Level >0
|
// Get the accounts with GM Level >0
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_GM_ACCOUNTS);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_GM_ACCOUNTS);
|
||||||
stmt.AddValue(0, (byte)AccountTypes.Moderator);
|
stmt.AddValue(0, (byte)AccountTypes.Moderator);
|
||||||
stmt.AddValue(1, Global.WorldMgr.GetRealm().Id.Index);
|
stmt.AddValue(1, Global.WorldMgr.GetRealm().Id.Index);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ namespace Game.Chat
|
|||||||
|
|
||||||
Player player = handler.GetPlayer();
|
Player player = handler.GetPlayer();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_GAMEOBJECT_NEAREST);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_GAMEOBJECT_NEAREST);
|
||||||
stmt.AddValue(0, player.GetPositionX());
|
stmt.AddValue(0, player.GetPositionX());
|
||||||
stmt.AddValue(1, player.GetPositionY());
|
stmt.AddValue(1, player.GetPositionY());
|
||||||
stmt.AddValue(2, player.GetPositionZ());
|
stmt.AddValue(2, player.GetPositionZ());
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ namespace Game.Chat
|
|||||||
// If not, we extract it from the SQL.
|
// If not, we extract it from the SQL.
|
||||||
if (!groupTarget)
|
if (!groupTarget)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GROUP_MEMBER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GROUP_MEMBER);
|
||||||
stmt.AddValue(0, guidTarget.GetCounter());
|
stmt.AddValue(0, guidTarget.GetCounter());
|
||||||
SQLResult resultGroup = DB.Characters.Query(stmt);
|
SQLResult resultGroup = DB.Characters.Query(stmt);
|
||||||
if (!resultGroup.IsEmpty())
|
if (!resultGroup.IsEmpty())
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace Game.Chat
|
|||||||
groupTarget = target.GetGroup();
|
groupTarget = target.GetGroup();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GROUP_MEMBER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GROUP_MEMBER);
|
||||||
stmt.AddValue(0, player.GetGUID().GetCounter());
|
stmt.AddValue(0, player.GetGUID().GetCounter());
|
||||||
SQLResult resultGroup = DB.Characters.Query(stmt);
|
SQLResult resultGroup = DB.Characters.Query(stmt);
|
||||||
if (!resultGroup.IsEmpty())
|
if (!resultGroup.IsEmpty())
|
||||||
|
|||||||
@@ -98,14 +98,14 @@ namespace Game.Chat.Commands
|
|||||||
// inventory case
|
// inventory case
|
||||||
uint inventoryCount = 0;
|
uint inventoryCount = 0;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_INVENTORY_COUNT_ITEM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_INVENTORY_COUNT_ITEM);
|
||||||
stmt.AddValue(0, itemId);
|
stmt.AddValue(0, itemId);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
inventoryCount = result.Read<uint>(0);
|
inventoryCount = result.Read<uint>(0);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_INVENTORY_ITEM_BY_ENTRY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_INVENTORY_ITEM_BY_ENTRY);
|
||||||
stmt.AddValue(0, itemId);
|
stmt.AddValue(0, itemId);
|
||||||
stmt.AddValue(1, count);
|
stmt.AddValue(1, count);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
@@ -143,7 +143,7 @@ namespace Game.Chat.Commands
|
|||||||
// mail case
|
// mail case
|
||||||
uint mailCount = 0;
|
uint mailCount = 0;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAIL_COUNT_ITEM);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAIL_COUNT_ITEM);
|
||||||
stmt.AddValue(0, itemId);
|
stmt.AddValue(0, itemId);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ namespace Game.Chat.Commands
|
|||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAIL_ITEMS_BY_ENTRY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAIL_ITEMS_BY_ENTRY);
|
||||||
stmt.AddValue(0, itemId);
|
stmt.AddValue(0, itemId);
|
||||||
stmt.AddValue(1, count);
|
stmt.AddValue(1, count);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
@@ -184,7 +184,7 @@ namespace Game.Chat.Commands
|
|||||||
// auction case
|
// auction case
|
||||||
uint auctionCount = 0;
|
uint auctionCount = 0;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_AUCTIONHOUSE_COUNT_ITEM);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_AUCTIONHOUSE_COUNT_ITEM);
|
||||||
stmt.AddValue(0, itemId);
|
stmt.AddValue(0, itemId);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ namespace Game.Chat.Commands
|
|||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_AUCTIONHOUSE_ITEM_BY_ENTRY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_AUCTIONHOUSE_ITEM_BY_ENTRY);
|
||||||
stmt.AddValue(0, itemId);
|
stmt.AddValue(0, itemId);
|
||||||
stmt.AddValue(1, count);
|
stmt.AddValue(1, count);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
@@ -220,14 +220,14 @@ namespace Game.Chat.Commands
|
|||||||
// guild bank case
|
// guild bank case
|
||||||
uint guildCount = 0;
|
uint guildCount = 0;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GUILD_BANK_COUNT_ITEM);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GUILD_BANK_COUNT_ITEM);
|
||||||
stmt.AddValue(0, itemId);
|
stmt.AddValue(0, itemId);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
guildCount = result.Read<uint>(0);
|
guildCount = result.Read<uint>(0);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GUILD_BANK_ITEM_BY_ENTRY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GUILD_BANK_ITEM_BY_ENTRY);
|
||||||
stmt.AddValue(0, itemId);
|
stmt.AddValue(0, itemId);
|
||||||
stmt.AddValue(1, count);
|
stmt.AddValue(1, count);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
@@ -267,7 +267,7 @@ namespace Game.Chat.Commands
|
|||||||
if (player == null)
|
if (player == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAIL_LIST_COUNT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAIL_LIST_COUNT);
|
||||||
stmt.AddValue(0, player.GetGUID().GetCounter());
|
stmt.AddValue(0, player.GetGUID().GetCounter());
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -278,7 +278,7 @@ namespace Game.Chat.Commands
|
|||||||
handler.SendSysMessage(CypherStrings.ListMailHeader, countMail, nameLink, player.GetGUID().ToString());
|
handler.SendSysMessage(CypherStrings.ListMailHeader, countMail, nameLink, player.GetGUID().ToString());
|
||||||
handler.SendSysMessage(CypherStrings.AccountListBar);
|
handler.SendSysMessage(CypherStrings.AccountListBar);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAIL_LIST_INFO);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAIL_LIST_INFO);
|
||||||
stmt.AddValue(0, player.GetGUID().GetCounter());
|
stmt.AddValue(0, player.GetGUID().GetCounter());
|
||||||
SQLResult result1 = DB.Characters.Query(stmt);
|
SQLResult result1 = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ namespace Game.Chat.Commands
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
uint item_guid = result2.Read<uint>(0);
|
uint item_guid = result2.Read<uint>(0);
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAIL_LIST_ITEMS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAIL_LIST_ITEMS);
|
||||||
stmt.AddValue(0, item_guid);
|
stmt.AddValue(0, item_guid);
|
||||||
SQLResult result3 = DB.Characters.Query(stmt);
|
SQLResult result3 = DB.Characters.Query(stmt);
|
||||||
if (!result3.IsEmpty())
|
if (!result3.IsEmpty())
|
||||||
|
|||||||
@@ -897,7 +897,7 @@ namespace Game.Chat
|
|||||||
ip = target.GetSession().GetRemoteAddress();
|
ip = target.GetSession().GetRemoteAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BY_IP);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BY_IP);
|
||||||
stmt.AddValue(0, ip);
|
stmt.AddValue(0, ip);
|
||||||
return LookupPlayerSearchCommand(DB.Login.Query(stmt), limit, handler);
|
return LookupPlayerSearchCommand(DB.Login.Query(stmt), limit, handler);
|
||||||
}
|
}
|
||||||
@@ -905,7 +905,7 @@ namespace Game.Chat
|
|||||||
[Command("account", RBACPermissions.CommandLookupPlayerAccount)]
|
[Command("account", RBACPermissions.CommandLookupPlayerAccount)]
|
||||||
static bool HandleLookupPlayerAccountCommand(CommandHandler handler, string account, int limit = -1)
|
static bool HandleLookupPlayerAccountCommand(CommandHandler handler, string account, int limit = -1)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_LIST_BY_NAME);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_LIST_BY_NAME);
|
||||||
stmt.AddValue(0, account);
|
stmt.AddValue(0, account);
|
||||||
return LookupPlayerSearchCommand(DB.Login.Query(stmt), limit, handler);
|
return LookupPlayerSearchCommand(DB.Login.Query(stmt), limit, handler);
|
||||||
}
|
}
|
||||||
@@ -913,7 +913,7 @@ namespace Game.Chat
|
|||||||
[Command("email", RBACPermissions.CommandLookupPlayerEmail)]
|
[Command("email", RBACPermissions.CommandLookupPlayerEmail)]
|
||||||
static bool HandleLookupPlayerEmailCommand(CommandHandler handler, string email, int limit = -1)
|
static bool HandleLookupPlayerEmailCommand(CommandHandler handler, string email, int limit = -1)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_LIST_BY_EMAIL);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_LIST_BY_EMAIL);
|
||||||
stmt.AddValue(0, email);
|
stmt.AddValue(0, email);
|
||||||
return LookupPlayerSearchCommand(DB.Login.Query(stmt), limit, handler);
|
return LookupPlayerSearchCommand(DB.Login.Query(stmt), limit, handler);
|
||||||
}
|
}
|
||||||
@@ -938,7 +938,7 @@ namespace Game.Chat
|
|||||||
uint accountId = result.Read<uint>(0);
|
uint accountId = result.Read<uint>(0);
|
||||||
string accountName = result.Read<string>(1);
|
string accountName = result.Read<string>(1);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_GUID_NAME_BY_ACC);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_GUID_NAME_BY_ACC);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SQLResult result2 = DB.Characters.Query(stmt);
|
SQLResult result2 = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ namespace Game.Chat
|
|||||||
{
|
{
|
||||||
if (channel != null)
|
if (channel != null)
|
||||||
channel.SetOwnership(true);
|
channel.SetOwnership(true);
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHANNEL_OWNERSHIP);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHANNEL_OWNERSHIP);
|
||||||
stmt.AddValue(0, 1);
|
stmt.AddValue(0, 1);
|
||||||
stmt.AddValue(1, channelName);
|
stmt.AddValue(1, channelName);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -192,7 +192,7 @@ namespace Game.Chat
|
|||||||
{
|
{
|
||||||
if (channel != null)
|
if (channel != null)
|
||||||
channel.SetOwnership(false);
|
channel.SetOwnership(false);
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHANNEL_OWNERSHIP);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHANNEL_OWNERSHIP);
|
||||||
stmt.AddValue(0, 0);
|
stmt.AddValue(0, 0);
|
||||||
stmt.AddValue(1, channelName);
|
stmt.AddValue(1, channelName);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|||||||
@@ -847,7 +847,7 @@ namespace Game.Chat
|
|||||||
static bool HandleListFreezeCommand(CommandHandler handler)
|
static bool HandleListFreezeCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
// Get names from DB
|
// Get names from DB
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_AURA_FROZEN);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_AURA_FROZEN);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
@@ -1004,7 +1004,7 @@ namespace Game.Chat
|
|||||||
if (handler.HasLowerSecurity(target, player.GetGUID(), true))
|
if (handler.HasLowerSecurity(target, player.GetGUID(), true))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_MUTE_TIME);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_MUTE_TIME);
|
||||||
string muteBy;
|
string muteBy;
|
||||||
Player gmPlayer = handler.GetPlayer();
|
Player gmPlayer = handler.GetPlayer();
|
||||||
if (gmPlayer != null)
|
if (gmPlayer != null)
|
||||||
@@ -1029,7 +1029,7 @@ namespace Game.Chat
|
|||||||
stmt.AddValue(3, accountId);
|
stmt.AddValue(3, accountId);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_ACCOUNT_MUTE);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_ACCOUNT_MUTE);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
stmt.AddValue(1, muteTime);
|
stmt.AddValue(1, muteTime);
|
||||||
stmt.AddValue(2, muteBy);
|
stmt.AddValue(2, muteBy);
|
||||||
@@ -1064,7 +1064,7 @@ namespace Game.Chat
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_MUTE_INFO);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_MUTE_INFO);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
|
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
@@ -1282,7 +1282,7 @@ namespace Game.Chat
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Query informations from the DB
|
// Query informations from the DB
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_PINFO);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_PINFO);
|
||||||
stmt.AddValue(0, lowguid);
|
stmt.AddValue(0, lowguid);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
@@ -1308,7 +1308,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Query the prepared statement for login data
|
// Query the prepared statement for login data
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_PINFO);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_PINFO);
|
||||||
stmt.AddValue(0, Global.WorldMgr.GetRealm().Id.Index);
|
stmt.AddValue(0, Global.WorldMgr.GetRealm().Id.Index);
|
||||||
stmt.AddValue(1, accId);
|
stmt.AddValue(1, accId);
|
||||||
SQLResult result0 = DB.Login.Query(stmt);
|
SQLResult result0 = DB.Login.Query(stmt);
|
||||||
@@ -1346,13 +1346,13 @@ namespace Game.Chat
|
|||||||
string nameLink = handler.PlayerLink(targetName);
|
string nameLink = handler.PlayerLink(targetName);
|
||||||
|
|
||||||
// Returns banType, banTime, bannedBy, banreason
|
// Returns banType, banTime, bannedBy, banreason
|
||||||
PreparedStatement stmt2 = DB.Login.GetPreparedStatement(LoginStatements.SEL_PINFO_BANS);
|
PreparedStatement stmt2 = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_PINFO_BANS);
|
||||||
stmt2.AddValue(0, accId);
|
stmt2.AddValue(0, accId);
|
||||||
SQLResult result2 = DB.Login.Query(stmt2);
|
SQLResult result2 = DB.Login.Query(stmt2);
|
||||||
if (result2.IsEmpty())
|
if (result2.IsEmpty())
|
||||||
{
|
{
|
||||||
banType = handler.GetCypherString(CypherStrings.Character);
|
banType = handler.GetCypherString(CypherStrings.Character);
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PINFO_BANS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PINFO_BANS);
|
||||||
stmt.AddValue(0, lowguid);
|
stmt.AddValue(0, lowguid);
|
||||||
result2 = DB.Characters.Query(stmt);
|
result2 = DB.Characters.Query(stmt);
|
||||||
}
|
}
|
||||||
@@ -1368,7 +1368,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Can be used to query data from Characters database
|
// Can be used to query data from Characters database
|
||||||
stmt2 = DB.Characters.GetPreparedStatement(CharStatements.SEL_PINFO_XP);
|
stmt2 = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PINFO_XP);
|
||||||
stmt2.AddValue(0, lowguid);
|
stmt2.AddValue(0, lowguid);
|
||||||
SQLResult result4 = DB.Characters.Query(stmt2);
|
SQLResult result4 = DB.Characters.Query(stmt2);
|
||||||
|
|
||||||
@@ -1381,7 +1381,7 @@ namespace Game.Chat
|
|||||||
if (gguid != 0)
|
if (gguid != 0)
|
||||||
{
|
{
|
||||||
// Guild Data - an own query, because it may not happen.
|
// Guild Data - an own query, because it may not happen.
|
||||||
PreparedStatement stmt3 = DB.Characters.GetPreparedStatement(CharStatements.SEL_GUILD_MEMBER_EXTENDED);
|
PreparedStatement stmt3 = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GUILD_MEMBER_EXTENDED);
|
||||||
stmt3.AddValue(0, lowguid);
|
stmt3.AddValue(0, lowguid);
|
||||||
SQLResult result5 = DB.Characters.Query(stmt3);
|
SQLResult result5 = DB.Characters.Query(stmt3);
|
||||||
if (!result5.IsEmpty())
|
if (!result5.IsEmpty())
|
||||||
@@ -1489,7 +1489,7 @@ namespace Game.Chat
|
|||||||
|
|
||||||
// Mail Data - an own query, because it may or may not be useful.
|
// Mail Data - an own query, because it may or may not be useful.
|
||||||
// SQL: "SELECT SUM(CASE WHEN (checked & 1) THEN 1 ELSE 0 END) AS 'readmail', COUNT(*) AS 'totalmail' FROM mail WHERE `receiver` = ?"
|
// SQL: "SELECT SUM(CASE WHEN (checked & 1) THEN 1 ELSE 0 END) AS 'readmail', COUNT(*) AS 'totalmail' FROM mail WHERE `receiver` = ?"
|
||||||
PreparedStatement stmt4 = DB.Characters.GetPreparedStatement(CharStatements.SEL_PINFO_MAILS);
|
PreparedStatement stmt4 = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PINFO_MAILS);
|
||||||
stmt4.AddValue(0, lowguid);
|
stmt4.AddValue(0, lowguid);
|
||||||
SQLResult result6 = DB.Characters.Query(stmt4);
|
SQLResult result6 = DB.Characters.Query(stmt4);
|
||||||
if (!result6.IsEmpty())
|
if (!result6.IsEmpty())
|
||||||
@@ -1536,7 +1536,7 @@ namespace Game.Chat
|
|||||||
{
|
{
|
||||||
if (WorldConfig.GetBoolValue(WorldCfg.BattlegroundStoreStatisticsEnable))
|
if (WorldConfig.GetBoolValue(WorldCfg.BattlegroundStoreStatisticsEnable))
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PVPSTATS_FACTIONS_OVERALL);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PVPSTATS_FACTIONS_OVERALL);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -1901,7 +1901,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If player found: delete his freeze aura
|
// If player found: delete his freeze aura
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_AURA_FROZEN);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_AURA_FROZEN);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
@@ -1953,7 +1953,7 @@ namespace Game.Chat
|
|||||||
target.GetSession().m_muteTime = 0;
|
target.GetSession().m_muteTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_MUTE_TIME);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_MUTE_TIME);
|
||||||
stmt.AddValue(0, 0);
|
stmt.AddValue(0, 0);
|
||||||
stmt.AddValue(1, "");
|
stmt.AddValue(1, "");
|
||||||
stmt.AddValue(2, "");
|
stmt.AddValue(2, "");
|
||||||
@@ -2013,7 +2013,7 @@ namespace Game.Chat
|
|||||||
|
|
||||||
if (!player)
|
if (!player)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_HOMEBIND);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_HOMEBIND);
|
||||||
stmt.AddValue(0, targetGUID.GetCounter());
|
stmt.AddValue(0, targetGUID.GetCounter());
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ namespace Game.Chat
|
|||||||
Global.ObjectMgr.AddCreatureToGrid(data);
|
Global.ObjectMgr.AddCreatureToGrid(data);
|
||||||
|
|
||||||
// update position in DB
|
// update position in DB
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_POSITION);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_CREATURE_POSITION);
|
||||||
stmt.AddValue(0, player.GetPositionX());
|
stmt.AddValue(0, player.GetPositionX());
|
||||||
stmt.AddValue(1, player.GetPositionY());
|
stmt.AddValue(1, player.GetPositionY());
|
||||||
stmt.AddValue(2, player.GetPositionZ());
|
stmt.AddValue(2, player.GetPositionZ());
|
||||||
@@ -216,7 +216,7 @@ namespace Game.Chat
|
|||||||
|
|
||||||
Player player = handler.GetPlayer();
|
Player player = handler.GetPlayer();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_CREATURE_NEAREST);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_CREATURE_NEAREST);
|
||||||
stmt.AddValue(0, player.GetPositionX());
|
stmt.AddValue(0, player.GetPositionX());
|
||||||
stmt.AddValue(1, player.GetPositionY());
|
stmt.AddValue(1, player.GetPositionY());
|
||||||
stmt.AddValue(2, player.GetPositionZ());
|
stmt.AddValue(2, player.GetPositionZ());
|
||||||
@@ -658,7 +658,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update movement type
|
// Update movement type
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_MOVEMENT_TYPE);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_CREATURE_MOVEMENT_TYPE);
|
||||||
stmt.AddValue(0, (byte)MovementGeneratorType.Waypoint);
|
stmt.AddValue(0, (byte)MovementGeneratorType.Waypoint);
|
||||||
stmt.AddValue(1, lowGuid);
|
stmt.AddValue(1, lowGuid);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
@@ -695,7 +695,7 @@ namespace Game.Chat
|
|||||||
FormationMgr.AddFormationMember(lowguid, followAngle, followDist, leaderGUID, groupAI);
|
FormationMgr.AddFormationMember(lowguid, followAngle, followDist, leaderGUID, groupAI);
|
||||||
creature.SearchFormation();
|
creature.SearchFormation();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.INS_CREATURE_FORMATION);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_CREATURE_FORMATION);
|
||||||
stmt.AddValue(0, leaderGUID);
|
stmt.AddValue(0, leaderGUID);
|
||||||
stmt.AddValue(1, lowguid);
|
stmt.AddValue(1, lowguid);
|
||||||
stmt.AddValue(2, followAngle);
|
stmt.AddValue(2, followAngle);
|
||||||
@@ -936,7 +936,7 @@ namespace Game.Chat
|
|||||||
cinfo.Faction = factionId;
|
cinfo.Faction = factionId;
|
||||||
|
|
||||||
// ..and DB
|
// ..and DB
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_FACTION);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_CREATURE_FACTION);
|
||||||
|
|
||||||
stmt.AddValue(0, factionId);
|
stmt.AddValue(0, factionId);
|
||||||
stmt.AddValue(1, factionId);
|
stmt.AddValue(1, factionId);
|
||||||
@@ -960,7 +960,7 @@ namespace Game.Chat
|
|||||||
creature.ReplaceAllNpcFlags(npcFlags);
|
creature.ReplaceAllNpcFlags(npcFlags);
|
||||||
creature.ReplaceAllNpcFlags2(npcFlags2);
|
creature.ReplaceAllNpcFlags2(npcFlags2);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_NPCFLAG);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_CREATURE_NPCFLAG);
|
||||||
stmt.AddValue(0, (ulong)npcFlags | ((ulong)npcFlags2 << 32));
|
stmt.AddValue(0, (ulong)npcFlags | ((ulong)npcFlags2 << 32));
|
||||||
stmt.AddValue(1, creature.GetEntry());
|
stmt.AddValue(1, creature.GetEntry());
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
@@ -1216,7 +1216,7 @@ namespace Game.Chat
|
|||||||
creature.Respawn();
|
creature.Respawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_WANDER_DISTANCE);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_CREATURE_WANDER_DISTANCE);
|
||||||
stmt.AddValue(0, option);
|
stmt.AddValue(0, option);
|
||||||
stmt.AddValue(1, (byte)mtype);
|
stmt.AddValue(1, (byte)mtype);
|
||||||
stmt.AddValue(2, guidLow);
|
stmt.AddValue(2, guidLow);
|
||||||
@@ -1234,7 +1234,7 @@ namespace Game.Chat
|
|||||||
if (!creature)
|
if (!creature)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_SPAWN_TIME_SECS);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_CREATURE_SPAWN_TIME_SECS);
|
||||||
stmt.AddValue(0, spawnTime);
|
stmt.AddValue(0, spawnTime);
|
||||||
stmt.AddValue(1, creature.GetSpawnId());
|
stmt.AddValue(1, creature.GetSpawnId());
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ namespace Game.Chat
|
|||||||
uint entry;
|
uint entry;
|
||||||
while ((entry = args.NextUInt32()) != 0)
|
while ((entry = args.NextUInt32()) != 0)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_CREATURE_TEMPLATE);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_CREATURE_TEMPLATE);
|
||||||
stmt.AddValue(0, entry);
|
stmt.AddValue(0, entry);
|
||||||
stmt.AddValue(1, 0);
|
stmt.AddValue(1, 0);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||||
stmt.AddValue(0, (ushort)AtLoginFlags.ResetSpells);
|
stmt.AddValue(0, (ushort)AtLoginFlags.ResetSpells);
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -192,7 +192,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
else if (!player.GetGUID().IsEmpty())
|
else if (!player.GetGUID().IsEmpty())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||||
stmt.AddValue(0, (ushort)(AtLoginFlags.None | AtLoginFlags.ResetPetTalents));
|
stmt.AddValue(0, (ushort)(AtLoginFlags.None | AtLoginFlags.ResetPetTalents));
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -232,7 +232,7 @@ namespace Game.Chat
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ALL_AT_LOGIN_FLAGS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ALL_AT_LOGIN_FLAGS);
|
||||||
stmt.AddValue(0, (ushort)atLogin);
|
stmt.AddValue(0, (ushort)atLogin);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ namespace Game.Chat
|
|||||||
target.TeleportTo(target.GetHomebind());
|
target.TeleportTo(target.GetHomebind());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_HOMEBIND);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_HOMEBIND);
|
||||||
stmt.AddValue(0, player.GetGUID().GetCounter());
|
stmt.AddValue(0, player.GetGUID().GetCounter());
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace Game.Chat.Commands
|
|||||||
pathId = target.GetWaypointPath();
|
pathId = target.GetWaypointPath();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_MAX_ID);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_MAX_ID);
|
||||||
SQLResult result1 = DB.World.Query(stmt);
|
SQLResult result1 = DB.World.Query(stmt);
|
||||||
|
|
||||||
uint maxpathid = result1.Read<uint>(0);
|
uint maxpathid = result1.Read<uint>(0);
|
||||||
@@ -49,7 +49,7 @@ namespace Game.Chat.Commands
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_MAX_POINT);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_MAX_POINT);
|
||||||
stmt.AddValue(0, pathId);
|
stmt.AddValue(0, pathId);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ namespace Game.Chat.Commands
|
|||||||
|
|
||||||
Player player = handler.GetSession().GetPlayer();
|
Player player = handler.GetSession().GetPlayer();
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.INS_WAYPOINT_DATA);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_WAYPOINT_DATA);
|
||||||
stmt.AddValue(0, pathId);
|
stmt.AddValue(0, pathId);
|
||||||
stmt.AddValue(1, point + 1);
|
stmt.AddValue(1, point + 1);
|
||||||
stmt.AddValue(2, player.GetPositionX());
|
stmt.AddValue(2, player.GetPositionX());
|
||||||
@@ -85,13 +85,13 @@ namespace Game.Chat.Commands
|
|||||||
{
|
{
|
||||||
if (id != 0)
|
if (id != 0)
|
||||||
{
|
{
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_SCRIPT_ID_BY_GUID);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_SCRIPT_ID_BY_GUID);
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.INS_WAYPOINT_SCRIPT);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_WAYPOINT_SCRIPT);
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|
||||||
@@ -102,11 +102,11 @@ namespace Game.Chat.Commands
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_SCRIPTS_MAX_ID);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_SCRIPTS_MAX_ID);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
id = result.Read<uint>(0);
|
id = result.Read<uint>(0);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.INS_WAYPOINT_SCRIPT);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_WAYPOINT_SCRIPT);
|
||||||
stmt.AddValue(0, id + 1);
|
stmt.AddValue(0, id + 1);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ namespace Game.Chat.Commands
|
|||||||
float a8, a9, a10, a11;
|
float a8, a9, a10, a11;
|
||||||
string a7;
|
string a7;
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_SCRIPT_BY_ID);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_SCRIPT_BY_ID);
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -166,13 +166,13 @@ namespace Game.Chat.Commands
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_SCRIPT_ID_BY_GUID);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_SCRIPT_ID_BY_GUID);
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_WAYPOINT_SCRIPT);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_WAYPOINT_SCRIPT);
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ namespace Game.Chat.Commands
|
|||||||
return false;
|
return false;
|
||||||
handler.SendSysMessage("|cff00ff00Wp Event: Waypoint script guid: {0}|r|cff00ffff id changed: |r|cff00ff00{1}|r", newid, id);
|
handler.SendSysMessage("|cff00ff00Wp Event: Waypoint script guid: {0}|r|cff00ffff id changed: |r|cff00ff00{1}|r", newid, id);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_ID);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_ID);
|
||||||
stmt.AddValue(0, newid);
|
stmt.AddValue(0, newid);
|
||||||
stmt.AddValue(1, id);
|
stmt.AddValue(1, id);
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ namespace Game.Chat.Commands
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_SCRIPT_ID_BY_GUID);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_SCRIPT_ID_BY_GUID);
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -243,7 +243,7 @@ namespace Game.Chat.Commands
|
|||||||
if (!float.TryParse(arg2, out float arg3))
|
if (!float.TryParse(arg2, out float arg3))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_X);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_X);
|
||||||
stmt.AddValue(0, arg3);
|
stmt.AddValue(0, arg3);
|
||||||
stmt.AddValue(1, id);
|
stmt.AddValue(1, id);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
@@ -256,7 +256,7 @@ namespace Game.Chat.Commands
|
|||||||
if (!float.TryParse(arg2, out float arg3))
|
if (!float.TryParse(arg2, out float arg3))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_Y);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_Y);
|
||||||
stmt.AddValue(0, arg3);
|
stmt.AddValue(0, arg3);
|
||||||
stmt.AddValue(1, id);
|
stmt.AddValue(1, id);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
@@ -269,7 +269,7 @@ namespace Game.Chat.Commands
|
|||||||
if (!float.TryParse(arg2, out float arg3))
|
if (!float.TryParse(arg2, out float arg3))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_Z);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_Z);
|
||||||
stmt.AddValue(0, arg3);
|
stmt.AddValue(0, arg3);
|
||||||
stmt.AddValue(1, id);
|
stmt.AddValue(1, id);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
@@ -282,7 +282,7 @@ namespace Game.Chat.Commands
|
|||||||
if (!float.TryParse(arg2, out float arg3))
|
if (!float.TryParse(arg2, out float arg3))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_O);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_O);
|
||||||
stmt.AddValue(0, arg3);
|
stmt.AddValue(0, arg3);
|
||||||
stmt.AddValue(1, id);
|
stmt.AddValue(1, id);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
@@ -341,26 +341,26 @@ namespace Game.Chat.Commands
|
|||||||
|
|
||||||
ulong guidLow = target.GetSpawnId();
|
ulong guidLow = target.GetSpawnId();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_CREATURE_ADDON_BY_GUID);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_CREATURE_ADDON_BY_GUID);
|
||||||
stmt.AddValue(0, guidLow);
|
stmt.AddValue(0, guidLow);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_ADDON_PATH);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_CREATURE_ADDON_PATH);
|
||||||
stmt.AddValue(0, pathId);
|
stmt.AddValue(0, pathId);
|
||||||
stmt.AddValue(1, guidLow);
|
stmt.AddValue(1, guidLow);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.INS_CREATURE_ADDON);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_CREATURE_ADDON);
|
||||||
stmt.AddValue(0, guidLow);
|
stmt.AddValue(0, guidLow);
|
||||||
stmt.AddValue(1, pathId);
|
stmt.AddValue(1, pathId);
|
||||||
}
|
}
|
||||||
|
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_MOVEMENT_TYPE);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_CREATURE_MOVEMENT_TYPE);
|
||||||
stmt.AddValue(0, (byte)MovementGeneratorType.Waypoint);
|
stmt.AddValue(0, (byte)MovementGeneratorType.Waypoint);
|
||||||
stmt.AddValue(1, guidLow);
|
stmt.AddValue(1, guidLow);
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ namespace Game.Chat.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check the creature
|
// Check the creature
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_BY_WPGUID);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_BY_WPGUID);
|
||||||
stmt.AddValue(0, target.GetSpawnId());
|
stmt.AddValue(0, target.GetSpawnId());
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -418,7 +418,7 @@ namespace Game.Chat.Commands
|
|||||||
// See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html
|
// See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html
|
||||||
string maxDiff = "0.01";
|
string maxDiff = "0.01";
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_BY_POS);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_BY_POS);
|
||||||
stmt.AddValue(0, target.GetPositionX());
|
stmt.AddValue(0, target.GetPositionX());
|
||||||
stmt.AddValue(1, maxDiff);
|
stmt.AddValue(1, maxDiff);
|
||||||
stmt.AddValue(2, target.GetPositionY());
|
stmt.AddValue(2, target.GetPositionY());
|
||||||
@@ -458,12 +458,12 @@ namespace Game.Chat.Commands
|
|||||||
if (Creature.DeleteFromDB(target.GetSpawnId()))
|
if (Creature.DeleteFromDB(target.GetSpawnId()))
|
||||||
{
|
{
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_WAYPOINT_DATA);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_WAYPOINT_DATA);
|
||||||
stmt.AddValue(0, pathid);
|
stmt.AddValue(0, pathid);
|
||||||
stmt.AddValue(1, point);
|
stmt.AddValue(1, point);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_DATA_POINT);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_DATA_POINT);
|
||||||
stmt.AddValue(0, pathid);
|
stmt.AddValue(0, pathid);
|
||||||
stmt.AddValue(1, point);
|
stmt.AddValue(1, point);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
@@ -518,7 +518,7 @@ namespace Game.Chat.Commands
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_DATA_POSITION);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_DATA_POSITION);
|
||||||
stmt.AddValue(0, chr.GetPositionX());
|
stmt.AddValue(0, chr.GetPositionX());
|
||||||
stmt.AddValue(1, chr.GetPositionY());
|
stmt.AddValue(1, chr.GetPositionY());
|
||||||
stmt.AddValue(2, chr.GetPositionZ());
|
stmt.AddValue(2, chr.GetPositionZ());
|
||||||
@@ -604,7 +604,7 @@ namespace Game.Chat.Commands
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_ALL_BY_WPGUID);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_ALL_BY_WPGUID);
|
||||||
stmt.AddValue(0, target.GetSpawnId());
|
stmt.AddValue(0, target.GetSpawnId());
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -637,7 +637,7 @@ namespace Game.Chat.Commands
|
|||||||
|
|
||||||
if (subCommand == "on")
|
if (subCommand == "on")
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_POS_BY_ID);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_POS_BY_ID);
|
||||||
stmt.AddValue(0, pathId);
|
stmt.AddValue(0, pathId);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -650,7 +650,7 @@ namespace Game.Chat.Commands
|
|||||||
handler.SendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff{0}|r", pathId);
|
handler.SendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff{0}|r", pathId);
|
||||||
|
|
||||||
// Delete all visuals for this NPC
|
// Delete all visuals for this NPC
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_WPGUID_BY_ID);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_WPGUID_BY_ID);
|
||||||
stmt.AddValue(0, pathId);
|
stmt.AddValue(0, pathId);
|
||||||
SQLResult result2 = DB.World.Query(stmt);
|
SQLResult result2 = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -723,7 +723,7 @@ namespace Game.Chat.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set "wpguid" column to the visual waypoint
|
// Set "wpguid" column to the visual waypoint
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_DATA_WPGUID);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_DATA_WPGUID);
|
||||||
stmt.AddValue(0, creature.GetSpawnId());
|
stmt.AddValue(0, creature.GetSpawnId());
|
||||||
stmt.AddValue(1, pathId);
|
stmt.AddValue(1, pathId);
|
||||||
stmt.AddValue(2, point);
|
stmt.AddValue(2, point);
|
||||||
@@ -739,7 +739,7 @@ namespace Game.Chat.Commands
|
|||||||
{
|
{
|
||||||
handler.SendSysMessage("|cff00ff00DEBUG: wp first, pathid: {0}|r", pathId);
|
handler.SendSysMessage("|cff00ff00DEBUG: wp first, pathid: {0}|r", pathId);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_POS_FIRST_BY_ID);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_POS_FIRST_BY_ID);
|
||||||
stmt.AddValue(0, pathId);
|
stmt.AddValue(0, pathId);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -793,7 +793,7 @@ namespace Game.Chat.Commands
|
|||||||
{
|
{
|
||||||
handler.SendSysMessage("|cff00ff00DEBUG: wp last, PathID: |r|cff00ffff{0}|r", pathId);
|
handler.SendSysMessage("|cff00ff00DEBUG: wp last, PathID: |r|cff00ffff{0}|r", pathId);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_POS_LAST_BY_ID);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_POS_LAST_BY_ID);
|
||||||
stmt.AddValue(0, pathId);
|
stmt.AddValue(0, pathId);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -846,7 +846,7 @@ namespace Game.Chat.Commands
|
|||||||
|
|
||||||
if (subCommand == "off")
|
if (subCommand == "off")
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_CREATURE_BY_ID);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_CREATURE_BY_ID);
|
||||||
stmt.AddValue(0, 1);
|
stmt.AddValue(0, 1);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -868,7 +868,7 @@ namespace Game.Chat.Commands
|
|||||||
}
|
}
|
||||||
while (result.NextRow());
|
while (result.NextRow());
|
||||||
// set "wpguid" column to "empty" - no visual waypoint spawned
|
// set "wpguid" column to "empty" - no visual waypoint spawned
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_DATA_ALL_WPGUID);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_DATA_ALL_WPGUID);
|
||||||
|
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
//DB.World.PExecute("UPDATE creature_movement SET wpguid = '0' WHERE wpguid <> '0'");
|
//DB.World.PExecute("UPDATE creature_movement SET wpguid = '0' WHERE wpguid <> '0'");
|
||||||
@@ -912,13 +912,13 @@ namespace Game.Chat.Commands
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_CREATURE_ADDON);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_CREATURE_ADDON);
|
||||||
stmt.AddValue(0, guidLow);
|
stmt.AddValue(0, guidLow);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|
||||||
target.UpdateCurrentWaypointInfo(0, 0);
|
target.UpdateCurrentWaypointInfo(0, 0);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_MOVEMENT_TYPE);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_CREATURE_MOVEMENT_TYPE);
|
||||||
stmt.AddValue(0, (byte)MovementGeneratorType.Idle);
|
stmt.AddValue(0, (byte)MovementGeneratorType.Idle);
|
||||||
stmt.AddValue(1, guidLow);
|
stmt.AddValue(1, guidLow);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace Game.DataStorage
|
|||||||
void LoadFromDB(bool custom, HotfixStatements preparedStatement)
|
void LoadFromDB(bool custom, HotfixStatements preparedStatement)
|
||||||
{
|
{
|
||||||
// Even though this query is executed only once, prepared statement is used to send data from mysql server in binary format
|
// Even though this query is executed only once, prepared statement is used to send data from mysql server in binary format
|
||||||
PreparedStatement stmt = DB.Hotfix.GetPreparedStatement(preparedStatement);
|
PreparedStatement stmt = HotfixDatabase.GetPreparedStatement(preparedStatement);
|
||||||
stmt.AddValue(0, !custom);
|
stmt.AddValue(0, !custom);
|
||||||
SQLResult result = DB.Hotfix.Query(stmt);
|
SQLResult result = DB.Hotfix.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
@@ -230,7 +230,7 @@ namespace Game.DataStorage
|
|||||||
|
|
||||||
void LoadStringsFromDB(bool custom, Locale locale, HotfixStatements preparedStatement)
|
void LoadStringsFromDB(bool custom, Locale locale, HotfixStatements preparedStatement)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Hotfix.GetPreparedStatement(preparedStatement);
|
PreparedStatement stmt = HotfixDatabase.GetPreparedStatement(preparedStatement);
|
||||||
stmt.AddValue(0, !custom);
|
stmt.AddValue(0, !custom);
|
||||||
stmt.AddValue(1, locale.ToString());
|
stmt.AddValue(1, locale.ToString());
|
||||||
SQLResult result = DB.Hotfix.Query(stmt);
|
SQLResult result = DB.Hotfix.Query(stmt);
|
||||||
|
|||||||
@@ -79,11 +79,11 @@ namespace Game.DungeonFinding
|
|||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_LFG_DATA);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_LFG_DATA);
|
||||||
stmt.AddValue(0, db_guid);
|
stmt.AddValue(0, db_guid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_LFG_DATA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_LFG_DATA);
|
||||||
stmt.AddValue(0, db_guid);
|
stmt.AddValue(0, db_guid);
|
||||||
stmt.AddValue(1, GetDungeon(guid));
|
stmt.AddValue(1, GetDungeon(guid));
|
||||||
stmt.AddValue(2, (uint)GetState(guid));
|
stmt.AddValue(2, (uint)GetState(guid));
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace Game.Entities
|
|||||||
items.Append($"{m_corpseData.Items[i]} ");
|
items.Append($"{m_corpseData.Items[i]} ");
|
||||||
|
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CORPSE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CORPSE);
|
||||||
stmt.AddValue(index++, GetOwnerGUID().GetCounter()); // guid
|
stmt.AddValue(index++, GetOwnerGUID().GetCounter()); // guid
|
||||||
stmt.AddValue(index++, GetPositionX()); // posX
|
stmt.AddValue(index++, GetPositionX()); // posX
|
||||||
stmt.AddValue(index++, GetPositionY()); // posY
|
stmt.AddValue(index++, GetPositionY()); // posY
|
||||||
@@ -118,7 +118,7 @@ namespace Game.Entities
|
|||||||
foreach (var phaseId in GetPhaseShift().GetPhases().Keys)
|
foreach (var phaseId in GetPhaseShift().GetPhases().Keys)
|
||||||
{
|
{
|
||||||
index = 0;
|
index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CORPSE_PHASES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CORPSE_PHASES);
|
||||||
stmt.AddValue(index++, GetOwnerGUID().GetCounter()); // OwnerGuid
|
stmt.AddValue(index++, GetOwnerGUID().GetCounter()); // OwnerGuid
|
||||||
stmt.AddValue(index++, phaseId); // PhaseId
|
stmt.AddValue(index++, phaseId); // PhaseId
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -127,7 +127,7 @@ namespace Game.Entities
|
|||||||
foreach (var customization in m_corpseData.Customizations)
|
foreach (var customization in m_corpseData.Customizations)
|
||||||
{
|
{
|
||||||
index = 0;
|
index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CORPSE_CUSTOMIZATIONS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CORPSE_CUSTOMIZATIONS);
|
||||||
stmt.AddValue(index++, GetOwnerGUID().GetCounter()); // OwnerGuid
|
stmt.AddValue(index++, GetOwnerGUID().GetCounter()); // OwnerGuid
|
||||||
stmt.AddValue(index++, customization.ChrCustomizationOptionID);
|
stmt.AddValue(index++, customization.ChrCustomizationOptionID);
|
||||||
stmt.AddValue(index++, customization.ChrCustomizationChoiceID);
|
stmt.AddValue(index++, customization.ChrCustomizationChoiceID);
|
||||||
@@ -144,15 +144,15 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public static void DeleteFromDB(ObjectGuid ownerGuid, SQLTransaction trans)
|
public static void DeleteFromDB(ObjectGuid ownerGuid, SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CORPSE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CORPSE);
|
||||||
stmt.AddValue(0, ownerGuid.GetCounter());
|
stmt.AddValue(0, ownerGuid.GetCounter());
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CORPSE_PHASES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CORPSE_PHASES);
|
||||||
stmt.AddValue(0, ownerGuid.GetCounter());
|
stmt.AddValue(0, ownerGuid.GetCounter());
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CORPSE_CUSTOMIZATIONS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CORPSE_CUSTOMIZATIONS);
|
||||||
stmt.AddValue(0, ownerGuid.GetCounter());
|
stmt.AddValue(0, ownerGuid.GetCounter());
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1337,13 +1337,13 @@ namespace Game.Entities
|
|||||||
// update in DB
|
// update in DB
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_CREATURE);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_CREATURE);
|
||||||
stmt.AddValue(0, m_spawnId);
|
stmt.AddValue(0, m_spawnId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.INS_CREATURE);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_CREATURE);
|
||||||
stmt.AddValue(index++, m_spawnId);
|
stmt.AddValue(index++, m_spawnId);
|
||||||
stmt.AddValue(index++, GetEntry());
|
stmt.AddValue(index++, GetEntry());
|
||||||
stmt.AddValue(index++, mapid);
|
stmt.AddValue(index++, mapid);
|
||||||
@@ -1672,43 +1672,43 @@ namespace Game.Entities
|
|||||||
// ... and the database
|
// ... and the database
|
||||||
trans = new();
|
trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_CREATURE);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_CREATURE);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_SPAWNGROUP_MEMBER);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_SPAWNGROUP_MEMBER);
|
||||||
stmt.AddValue(0, (byte)SpawnObjectType.Creature);
|
stmt.AddValue(0, (byte)SpawnObjectType.Creature);
|
||||||
stmt.AddValue(1, spawnId);
|
stmt.AddValue(1, spawnId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_CREATURE_ADDON);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_CREATURE_ADDON);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_GAME_EVENT_CREATURE);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_GAME_EVENT_CREATURE);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_GAME_EVENT_MODEL_EQUIP);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_GAME_EVENT_MODEL_EQUIP);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.CreatureToCreature);
|
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.CreatureToCreature);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.CreatureToGO);
|
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.CreatureToGO);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN_MASTER);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN_MASTER);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.CreatureToCreature);
|
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.CreatureToCreature);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN_MASTER);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN_MASTER);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.GOToCreature);
|
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.GOToCreature);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|||||||
@@ -1075,11 +1075,11 @@ namespace Game.Entities
|
|||||||
|
|
||||||
// Update in DB
|
// Update in DB
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_GAMEOBJECT);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_GAMEOBJECT);
|
||||||
stmt.AddValue(0, m_spawnId);
|
stmt.AddValue(0, m_spawnId);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.INS_GAMEOBJECT);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_GAMEOBJECT);
|
||||||
stmt.AddValue(index++, m_spawnId);
|
stmt.AddValue(index++, m_spawnId);
|
||||||
stmt.AddValue(index++, GetEntry());
|
stmt.AddValue(index++, GetEntry());
|
||||||
stmt.AddValue(index++, mapid);
|
stmt.AddValue(index++, mapid);
|
||||||
@@ -1194,35 +1194,35 @@ namespace Game.Entities
|
|||||||
trans = new();
|
trans = new();
|
||||||
|
|
||||||
// ... and the database
|
// ... and the database
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_GAMEOBJECT);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_GAMEOBJECT);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_EVENT_GAMEOBJECT);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_EVENT_GAMEOBJECT);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.GOToGO);
|
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.GOToGO);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.GOToCreature);
|
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.GOToCreature);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN_MASTER);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN_MASTER);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.GOToGO);
|
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.GOToGO);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN_MASTER);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN_MASTER);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.CreatureToGO);
|
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.CreatureToGO);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_GAMEOBJECT_ADDON);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_GAMEOBJECT_ADDON);
|
||||||
stmt.AddValue(0, spawnId);
|
stmt.AddValue(0, spawnId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public override void SaveToDB(SQLTransaction trans)
|
public override void SaveToDB(SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_EMPOWERED);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_EMPOWERED);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
case ItemUpdateState.New:
|
case ItemUpdateState.New:
|
||||||
case ItemUpdateState.Changed:
|
case ItemUpdateState.Changed:
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_AZERITE_EMPOWERED);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_AZERITE_EMPOWERED);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
for (int i = 0; i < SharedConst.MaxAzeriteEmpoweredTier; ++i)
|
for (int i = 0; i < SharedConst.MaxAzeriteEmpoweredTier; ++i)
|
||||||
stmt.AddValue(1 + i, m_azeriteEmpoweredItemData.Selections[i]);
|
stmt.AddValue(1 + i, m_azeriteEmpoweredItemData.Selections[i]);
|
||||||
@@ -79,7 +79,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (needSave)
|
if (needSave)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ITEM_INSTANCE_AZERITE_EMPOWERED);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ITEM_INSTANCE_AZERITE_EMPOWERED);
|
||||||
for (int i = 0; i < SharedConst.MaxAzeriteEmpoweredTier; ++i)
|
for (int i = 0; i < SharedConst.MaxAzeriteEmpoweredTier; ++i)
|
||||||
stmt.AddValue(i, m_azeriteEmpoweredItemData.Selections[i]);
|
stmt.AddValue(i, m_azeriteEmpoweredItemData.Selections[i]);
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public static new void DeleteFromDB(SQLTransaction trans, ulong itemGuid)
|
public static new void DeleteFromDB(SQLTransaction trans, ulong itemGuid)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_EMPOWERED);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_EMPOWERED);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,15 +38,15 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public override void SaveToDB(SQLTransaction trans)
|
public override void SaveToDB(SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_MILESTONE_POWER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_MILESTONE_POWER);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_UNLOCKED_ESSENCE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_UNLOCKED_ESSENCE);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
case ItemUpdateState.New:
|
case ItemUpdateState.New:
|
||||||
case ItemUpdateState.Changed:
|
case ItemUpdateState.Changed:
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_AZERITE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_AZERITE);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, m_azeriteItemData.Xp);
|
stmt.AddValue(1, m_azeriteItemData.Xp);
|
||||||
stmt.AddValue(2, m_azeriteItemData.Level);
|
stmt.AddValue(2, m_azeriteItemData.Level);
|
||||||
@@ -78,7 +78,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
foreach (uint azeriteItemMilestonePowerId in m_azeriteItemData.UnlockedEssenceMilestones)
|
foreach (uint azeriteItemMilestonePowerId in m_azeriteItemData.UnlockedEssenceMilestones)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_AZERITE_MILESTONE_POWER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_AZERITE_MILESTONE_POWER);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, azeriteItemMilestonePowerId);
|
stmt.AddValue(1, azeriteItemMilestonePowerId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -86,7 +86,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
foreach (var azeriteEssence in m_azeriteItemData.UnlockedEssences)
|
foreach (var azeriteEssence in m_azeriteItemData.UnlockedEssences)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_AZERITE_UNLOCKED_ESSENCE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_AZERITE_UNLOCKED_ESSENCE);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, azeriteEssence.AzeriteEssenceID);
|
stmt.AddValue(1, azeriteEssence.AzeriteEssenceID);
|
||||||
stmt.AddValue(2, azeriteEssence.Rank);
|
stmt.AddValue(2, azeriteEssence.Rank);
|
||||||
@@ -171,7 +171,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (needSave)
|
if (needSave)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ITEM_INSTANCE_AZERITE_ON_LOAD);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ITEM_INSTANCE_AZERITE_ON_LOAD);
|
||||||
stmt.AddValue(0, azeriteData.Xp);
|
stmt.AddValue(0, azeriteData.Xp);
|
||||||
stmt.AddValue(1, azeriteData.KnowledgeLevel);
|
stmt.AddValue(1, azeriteData.KnowledgeLevel);
|
||||||
stmt.AddValue(2, GetGUID().GetCounter());
|
stmt.AddValue(2, GetGUID().GetCounter());
|
||||||
@@ -187,15 +187,15 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public new static void DeleteFromDB(SQLTransaction trans, ulong itemGuid)
|
public new static void DeleteFromDB(SQLTransaction trans, ulong itemGuid)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_MILESTONE_POWER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_MILESTONE_POWER);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_UNLOCKED_ESSENCE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_AZERITE_UNLOCKED_ESSENCE);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ namespace Game.Entities
|
|||||||
case ItemUpdateState.Changed:
|
case ItemUpdateState.Changed:
|
||||||
{
|
{
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(uState == ItemUpdateState.New ? CharStatements.REP_ITEM_INSTANCE : CharStatements.UPD_ITEM_INSTANCE);
|
stmt = CharacterDatabase.GetPreparedStatement(uState == ItemUpdateState.New ? CharStatements.REP_ITEM_INSTANCE : CharStatements.UPD_ITEM_INSTANCE);
|
||||||
stmt.AddValue(index, GetEntry());
|
stmt.AddValue(index, GetEntry());
|
||||||
stmt.AddValue(++index, GetOwnerGUID().GetCounter());
|
stmt.AddValue(++index, GetOwnerGUID().GetCounter());
|
||||||
stmt.AddValue(++index, GetCreator().GetCounter());
|
stmt.AddValue(++index, GetCreator().GetCounter());
|
||||||
@@ -183,19 +183,19 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if ((uState == ItemUpdateState.Changed) && IsWrapped())
|
if ((uState == ItemUpdateState.Changed) && IsWrapped())
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GIFT_OWNER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GIFT_OWNER);
|
||||||
stmt.AddValue(0, GetOwnerGUID().GetCounter());
|
stmt.AddValue(0, GetOwnerGUID().GetCounter());
|
||||||
stmt.AddValue(1, GetGUID().GetCounter());
|
stmt.AddValue(1, GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_GEMS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_GEMS);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
if (m_itemData.Gems.Size() != 0)
|
if (m_itemData.Gems.Size() != 0)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_GEMS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_GEMS);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int gemFields = 4;
|
int gemFields = 4;
|
||||||
@@ -260,13 +260,13 @@ namespace Game.Entities
|
|||||||
ItemModifier.TransmogSecondaryAppearanceSpec5
|
ItemModifier.TransmogSecondaryAppearanceSpec5
|
||||||
};
|
};
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_TRANSMOG);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_TRANSMOG);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
if (transmogMods.Any(modifier => GetModifier(modifier) != 0))
|
if (transmogMods.Any(modifier => GetModifier(modifier) != 0))
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_TRANSMOG);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_TRANSMOG);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, GetModifier(ItemModifier.TransmogAppearanceAllSpecs));
|
stmt.AddValue(1, GetModifier(ItemModifier.TransmogAppearanceAllSpecs));
|
||||||
stmt.AddValue(2, GetModifier(ItemModifier.TransmogAppearanceSpec1));
|
stmt.AddValue(2, GetModifier(ItemModifier.TransmogAppearanceSpec1));
|
||||||
@@ -289,17 +289,17 @@ namespace Game.Entities
|
|||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT_POWERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT_POWERS);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
if (GetTemplate().GetArtifactID() != 0)
|
if (GetTemplate().GetArtifactID() != 0)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_ARTIFACT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_ARTIFACT);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, (ulong)m_itemData.ArtifactXP);
|
stmt.AddValue(1, (ulong)m_itemData.ArtifactXP);
|
||||||
stmt.AddValue(2, GetModifier(ItemModifier.ArtifactAppearanceId));
|
stmt.AddValue(2, GetModifier(ItemModifier.ArtifactAppearanceId));
|
||||||
@@ -308,7 +308,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
foreach (ArtifactPower artifactPower in m_itemData.ArtifactPowers)
|
foreach (ArtifactPower artifactPower in m_itemData.ArtifactPowers)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_ARTIFACT_POWERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_ARTIFACT_POWERS);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, artifactPower.ArtifactPowerId);
|
stmt.AddValue(1, artifactPower.ArtifactPowerId);
|
||||||
stmt.AddValue(2, artifactPower.PurchasedRank);
|
stmt.AddValue(2, artifactPower.PurchasedRank);
|
||||||
@@ -322,13 +322,13 @@ namespace Game.Entities
|
|||||||
ItemModifier.ArtifactKnowledgeLevel
|
ItemModifier.ArtifactKnowledgeLevel
|
||||||
};
|
};
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_MODIFIERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_MODIFIERS);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
if (modifiersTable.Any(modifier => GetModifier(modifier) != 0))
|
if (modifiersTable.Any(modifier => GetModifier(modifier) != 0))
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_MODIFIERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_MODIFIERS);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, GetModifier(ItemModifier.TimewalkerLevel));
|
stmt.AddValue(1, GetModifier(ItemModifier.TimewalkerLevel));
|
||||||
stmt.AddValue(2, GetModifier(ItemModifier.ArtifactKnowledgeLevel));
|
stmt.AddValue(2, GetModifier(ItemModifier.ArtifactKnowledgeLevel));
|
||||||
@@ -338,33 +338,33 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
case ItemUpdateState.Removed:
|
case ItemUpdateState.Removed:
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_GEMS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_GEMS);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_TRANSMOG);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_TRANSMOG);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT_POWERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT_POWERS);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_MODIFIERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_MODIFIERS);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
if (IsWrapped())
|
if (IsWrapped())
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GIFT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GIFT);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
}
|
}
|
||||||
@@ -540,7 +540,7 @@ namespace Game.Entities
|
|||||||
if (need_save) // normal item changed state set not work at loading
|
if (need_save) // normal item changed state set not work at loading
|
||||||
{
|
{
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ITEM_INSTANCE_ON_LOAD);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ITEM_INSTANCE_ON_LOAD);
|
||||||
stmt.AddValue(index++, (uint)m_itemData.Expiration);
|
stmt.AddValue(index++, (uint)m_itemData.Expiration);
|
||||||
stmt.AddValue(index++, (uint)m_itemData.DynamicFlags);
|
stmt.AddValue(index++, (uint)m_itemData.DynamicFlags);
|
||||||
stmt.AddValue(index++, (uint)m_itemData.Durability);
|
stmt.AddValue(index++, (uint)m_itemData.Durability);
|
||||||
@@ -639,31 +639,31 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public static void DeleteFromDB(SQLTransaction trans, ulong itemGuid)
|
public static void DeleteFromDB(SQLTransaction trans, ulong itemGuid)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_GEMS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_GEMS);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_TRANSMOG);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_TRANSMOG);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT_POWERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT_POWERS);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_MODIFIERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_INSTANCE_MODIFIERS);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GIFT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GIFT);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
}
|
}
|
||||||
@@ -679,7 +679,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public static void DeleteFromInventoryDB(SQLTransaction trans, ulong itemGuid)
|
public static void DeleteFromInventoryDB(SQLTransaction trans, ulong itemGuid)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_INVENTORY_BY_ITEM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_INVENTORY_BY_ITEM);
|
||||||
stmt.AddValue(0, itemGuid);
|
stmt.AddValue(0, itemGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
}
|
}
|
||||||
@@ -1374,7 +1374,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
DeleteRefundDataFromDB();
|
DeleteRefundDataFromDB();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_REFUND_INSTANCE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_REFUND_INSTANCE);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, GetRefundRecipient().GetCounter());
|
stmt.AddValue(1, GetRefundRecipient().GetCounter());
|
||||||
stmt.AddValue(2, GetPaidMoney());
|
stmt.AddValue(2, GetPaidMoney());
|
||||||
@@ -1384,7 +1384,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public void DeleteRefundDataFromDB(SQLTransaction trans = null)
|
public void DeleteRefundDataFromDB(SQLTransaction trans = null)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_REFUND_INSTANCE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_REFUND_INSTANCE);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
if (trans != null)
|
if (trans != null)
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -1467,7 +1467,7 @@ namespace Game.Entities
|
|||||||
currentOwner.GetSession().GetCollectionMgr().AddItemAppearance(this);
|
currentOwner.GetSession().GetCollectionMgr().AddItemAppearance(this);
|
||||||
allowedGUIDs.Clear();
|
allowedGUIDs.Clear();
|
||||||
SetState(ItemUpdateState.Changed, currentOwner);
|
SetState(ItemUpdateState.Changed, currentOwner);
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEM_BOP_TRADE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEM_BOP_TRADE);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-24
@@ -447,7 +447,7 @@ namespace Game.Entities
|
|||||||
trans = new SQLTransaction();
|
trans = new SQLTransaction();
|
||||||
|
|
||||||
// remove current data
|
// remove current data
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_PET_BY_ID);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_PET_BY_ID);
|
||||||
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -457,7 +457,7 @@ namespace Game.Entities
|
|||||||
Cypher.Assert(owner.GetPetStable().GetCurrentPet() != null && owner.GetPetStable().GetCurrentPet().PetNumber == GetCharmInfo().GetPetNumber());
|
Cypher.Assert(owner.GetPetStable().GetCurrentPet() != null && owner.GetPetStable().GetCurrentPet().PetNumber == GetCharmInfo().GetPetNumber());
|
||||||
FillPetInfo(owner.GetPetStable().GetCurrentPet());
|
FillPetInfo(owner.GetPetStable().GetCurrentPet());
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PET);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PET);
|
||||||
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
||||||
stmt.AddValue(1, GetEntry());
|
stmt.AddValue(1, GetEntry());
|
||||||
stmt.AddValue(2, ownerLowGUID);
|
stmt.AddValue(2, ownerLowGUID);
|
||||||
@@ -512,31 +512,31 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_PET_BY_ID);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_PET_BY_ID);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_PET_DECLINEDNAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_PET_DECLINEDNAME);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_AURA_EFFECTS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_AURA_EFFECTS);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_AURAS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_AURAS);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_SPELLS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_SPELLS);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_SPELL_COOLDOWNS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_SPELL_COOLDOWNS);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_SPELL_CHARGES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_SPELL_CHARGES);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -815,7 +815,7 @@ namespace Game.Entities
|
|||||||
switch (pair.Value.state)
|
switch (pair.Value.state)
|
||||||
{
|
{
|
||||||
case PetSpellState.Removed:
|
case PetSpellState.Removed:
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_SPELL_BY_SPELL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_SPELL_BY_SPELL);
|
||||||
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -823,19 +823,19 @@ namespace Game.Entities
|
|||||||
m_spells.Remove(pair.Key);
|
m_spells.Remove(pair.Key);
|
||||||
continue;
|
continue;
|
||||||
case PetSpellState.Changed:
|
case PetSpellState.Changed:
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_SPELL_BY_SPELL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_SPELL_BY_SPELL);
|
||||||
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PET_SPELL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PET_SPELL);
|
||||||
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
stmt.AddValue(2, (byte)pair.Value.active);
|
stmt.AddValue(2, (byte)pair.Value.active);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
break;
|
break;
|
||||||
case PetSpellState.New:
|
case PetSpellState.New:
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PET_SPELL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PET_SPELL);
|
||||||
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
stmt.AddValue(2, (byte)pair.Value.active);
|
stmt.AddValue(2, (byte)pair.Value.active);
|
||||||
@@ -952,11 +952,11 @@ namespace Game.Entities
|
|||||||
|
|
||||||
void _SaveAuras(SQLTransaction trans)
|
void _SaveAuras(SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_AURA_EFFECTS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_AURA_EFFECTS);
|
||||||
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_AURAS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_AURAS);
|
||||||
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -977,7 +977,7 @@ namespace Game.Entities
|
|||||||
key.Caster.Clear();
|
key.Caster.Clear();
|
||||||
|
|
||||||
index = 0;
|
index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PET_AURA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PET_AURA);
|
||||||
stmt.AddValue(index++, GetCharmInfo().GetPetNumber());
|
stmt.AddValue(index++, GetCharmInfo().GetPetNumber());
|
||||||
stmt.AddValue(index++, key.Caster.GetRawValue());
|
stmt.AddValue(index++, key.Caster.GetRawValue());
|
||||||
stmt.AddValue(index++, key.SpellId);
|
stmt.AddValue(index++, key.SpellId);
|
||||||
@@ -995,7 +995,7 @@ namespace Game.Entities
|
|||||||
if (effect != null)
|
if (effect != null)
|
||||||
{
|
{
|
||||||
index = 0;
|
index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PET_AURA_EFFECT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PET_AURA_EFFECT);
|
||||||
stmt.AddValue(index++, GetCharmInfo().GetPetNumber());
|
stmt.AddValue(index++, GetCharmInfo().GetPetNumber());
|
||||||
stmt.AddValue(index++, key.Caster.GetRawValue());
|
stmt.AddValue(index++, key.Caster.GetRawValue());
|
||||||
stmt.AddValue(index++, key.SpellId);
|
stmt.AddValue(index++, key.SpellId);
|
||||||
@@ -1019,7 +1019,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
Log.outError(LogFilter.Pet, "addSpell: Non-existed in SpellStore spell #{0} request, deleting for all pets in `pet_spell`.", spellId);
|
Log.outError(LogFilter.Pet, "addSpell: Non-existed in SpellStore spell #{0} request, deleting for all pets in `pet_spell`.", spellId);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_INVALID_PET_SPELL);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_INVALID_PET_SPELL);
|
||||||
|
|
||||||
stmt.AddValue(0, spellId);
|
stmt.AddValue(0, spellId);
|
||||||
|
|
||||||
@@ -1733,28 +1733,28 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
public PetLoadQueryHolder(ulong ownerGuid, uint petNumber)
|
public PetLoadQueryHolder(ulong ownerGuid, uint petNumber)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PET_DECLINED_NAME);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PET_DECLINED_NAME);
|
||||||
stmt.AddValue(0, ownerGuid);
|
stmt.AddValue(0, ownerGuid);
|
||||||
stmt.AddValue(1, petNumber);
|
stmt.AddValue(1, petNumber);
|
||||||
SetQuery(PetLoginQueryLoad.DeclinedNames, stmt);
|
SetQuery(PetLoginQueryLoad.DeclinedNames, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PET_AURA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PET_AURA);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
SetQuery(PetLoginQueryLoad.Auras, stmt);
|
SetQuery(PetLoginQueryLoad.Auras, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PET_AURA_EFFECT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PET_AURA_EFFECT);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
SetQuery(PetLoginQueryLoad.AuraEffects, stmt);
|
SetQuery(PetLoginQueryLoad.AuraEffects, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PET_SPELL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PET_SPELL);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
SetQuery(PetLoginQueryLoad.Spells, stmt);
|
SetQuery(PetLoginQueryLoad.Spells, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PET_SPELL_COOLDOWN);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PET_SPELL_COOLDOWN);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
SetQuery(PetLoginQueryLoad.Cooldowns, stmt);
|
SetQuery(PetLoginQueryLoad.Cooldowns, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PET_SPELL_CHARGES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PET_SPELL_CHARGES);
|
||||||
stmt.AddValue(0, petNumber);
|
stmt.AddValue(0, petNumber);
|
||||||
SetQuery(PetLoginQueryLoad.Charges, stmt);
|
SetQuery(PetLoginQueryLoad.Charges, stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ namespace Game.Entities
|
|||||||
PreparedStatement stmt;
|
PreparedStatement stmt;
|
||||||
foreach (var pair in _toys)
|
foreach (var pair in _toys)
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_ACCOUNT_TOYS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.REP_ACCOUNT_TOYS);
|
||||||
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
stmt.AddValue(2, pair.Value.HasAnyFlag(ToyFlags.Favorite));
|
stmt.AddValue(2, pair.Value.HasAnyFlag(ToyFlags.Favorite));
|
||||||
@@ -191,7 +191,7 @@ namespace Game.Entities
|
|||||||
PreparedStatement stmt;
|
PreparedStatement stmt;
|
||||||
foreach (var heirloom in _heirlooms)
|
foreach (var heirloom in _heirlooms)
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_ACCOUNT_HEIRLOOMS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.REP_ACCOUNT_HEIRLOOMS);
|
||||||
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
||||||
stmt.AddValue(1, heirloom.Key);
|
stmt.AddValue(1, heirloom.Key);
|
||||||
stmt.AddValue(2, (uint)heirloom.Value.flags);
|
stmt.AddValue(2, (uint)heirloom.Value.flags);
|
||||||
@@ -356,7 +356,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
foreach (var mount in _mounts)
|
foreach (var mount in _mounts)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_ACCOUNT_MOUNTS);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.REP_ACCOUNT_MOUNTS);
|
||||||
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
||||||
stmt.AddValue(1, mount.Key);
|
stmt.AddValue(1, mount.Key);
|
||||||
stmt.AddValue(2, (byte)mount.Value);
|
stmt.AddValue(2, (byte)mount.Value);
|
||||||
@@ -494,7 +494,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
if (blockValue != 0) // this table is only appended/bits are set (never cleared) so don't save empty blocks
|
if (blockValue != 0) // this table is only appended/bits are set (never cleared) so don't save empty blocks
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_BNET_ITEM_APPEARANCES);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_BNET_ITEM_APPEARANCES);
|
||||||
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
||||||
stmt.AddValue(1, blockIndex);
|
stmt.AddValue(1, blockIndex);
|
||||||
stmt.AddValue(2, blockValue);
|
stmt.AddValue(2, blockValue);
|
||||||
@@ -510,14 +510,14 @@ namespace Game.Entities
|
|||||||
switch (appearanceState)
|
switch (appearanceState)
|
||||||
{
|
{
|
||||||
case FavoriteAppearanceState.New:
|
case FavoriteAppearanceState.New:
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_BNET_ITEM_FAVORITE_APPEARANCE);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_BNET_ITEM_FAVORITE_APPEARANCE);
|
||||||
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
||||||
stmt.AddValue(1, key);
|
stmt.AddValue(1, key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
appearanceState = FavoriteAppearanceState.Unchanged;
|
appearanceState = FavoriteAppearanceState.Unchanged;
|
||||||
break;
|
break;
|
||||||
case FavoriteAppearanceState.Removed:
|
case FavoriteAppearanceState.Removed:
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_BNET_ITEM_FAVORITE_APPEARANCE);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_BNET_ITEM_FAVORITE_APPEARANCE);
|
||||||
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
||||||
stmt.AddValue(1, key);
|
stmt.AddValue(1, key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -885,7 +885,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
if (blockValue != 0) // this table is only appended/bits are set (never cleared) so don't save empty blocks
|
if (blockValue != 0) // this table is only appended/bits are set (never cleared) so don't save empty blocks
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_BNET_TRANSMOG_ILLUSIONS);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_BNET_TRANSMOG_ILLUSIONS);
|
||||||
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
||||||
stmt.AddValue(1, blockIndex);
|
stmt.AddValue(1, blockIndex);
|
||||||
stmt.AddValue(2, blockValue);
|
stmt.AddValue(2, blockValue);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace Game.Entities
|
|||||||
if (isLoading)
|
if (isLoading)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PETITION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PETITION);
|
||||||
stmt.AddValue(0, ownerGuid.GetCounter());
|
stmt.AddValue(0, ownerGuid.GetCounter());
|
||||||
stmt.AddValue(1, petitionGuid.GetCounter());
|
stmt.AddValue(1, petitionGuid.GetCounter());
|
||||||
stmt.AddValue(2, name);
|
stmt.AddValue(2, name);
|
||||||
@@ -88,11 +88,11 @@ namespace Game.Entities
|
|||||||
// Delete From DB
|
// Delete From DB
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PETITION_BY_GUID);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PETITION_BY_GUID);
|
||||||
stmt.AddValue(0, petitionGuid.GetCounter());
|
stmt.AddValue(0, petitionGuid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PETITION_SIGNATURE_BY_GUID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PETITION_SIGNATURE_BY_GUID);
|
||||||
stmt.AddValue(0, petitionGuid.GetCounter());
|
stmt.AddValue(0, petitionGuid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -121,11 +121,11 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PETITION_BY_OWNER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PETITION_BY_OWNER);
|
||||||
stmt.AddValue(0, ownerGuid.GetCounter());
|
stmt.AddValue(0, ownerGuid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PETITION_SIGNATURE_BY_OWNER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PETITION_SIGNATURE_BY_OWNER);
|
||||||
stmt.AddValue(0, ownerGuid.GetCounter());
|
stmt.AddValue(0, ownerGuid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
DB.Characters.CommitTransaction(trans);
|
DB.Characters.CommitTransaction(trans);
|
||||||
@@ -136,7 +136,7 @@ namespace Game.Entities
|
|||||||
foreach (var petitionPair in _petitionStorage)
|
foreach (var petitionPair in _petitionStorage)
|
||||||
petitionPair.Value.RemoveSignatureBySigner(signerGuid);
|
petitionPair.Value.RemoveSignatureBySigner(signerGuid);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ALL_PETITION_SIGNATURES);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ALL_PETITION_SIGNATURES);
|
||||||
stmt.AddValue(0, signerGuid.GetCounter());
|
stmt.AddValue(0, signerGuid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ namespace Game.Entities
|
|||||||
if (isLoading)
|
if (isLoading)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PETITION_SIGNATURE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PETITION_SIGNATURE);
|
||||||
stmt.AddValue(0, ownerGuid.GetCounter());
|
stmt.AddValue(0, ownerGuid.GetCounter());
|
||||||
stmt.AddValue(1, PetitionGuid.GetCounter());
|
stmt.AddValue(1, PetitionGuid.GetCounter());
|
||||||
stmt.AddValue(2, playerGuid.GetCounter());
|
stmt.AddValue(2, playerGuid.GetCounter());
|
||||||
@@ -178,7 +178,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
PetitionName = newName;
|
PetitionName = newName;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_PETITION_NAME);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_PETITION_NAME);
|
||||||
stmt.AddValue(0, newName);
|
stmt.AddValue(0, newName);
|
||||||
stmt.AddValue(1, PetitionGuid.GetCounter());
|
stmt.AddValue(1, PetitionGuid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1275,7 +1275,7 @@ namespace Game.Entities
|
|||||||
foreach (var guid in allowedLooters)
|
foreach (var guid in allowedLooters)
|
||||||
ss.AppendFormat("{0} ", guid);
|
ss.AppendFormat("{0} ", guid);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_BOP_TRADE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEM_BOP_TRADE);
|
||||||
stmt.AddValue(0, item.GetGUID().GetCounter());
|
stmt.AddValue(0, item.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, ss.ToString());
|
stmt.AddValue(1, ss.ToString());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -5524,7 +5524,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (pItem.IsWrapped())
|
if (pItem.IsWrapped())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GIFT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GIFT);
|
||||||
stmt.AddValue(0, pItem.GetGUID().GetCounter());
|
stmt.AddValue(0, pItem.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -678,7 +678,7 @@ namespace Game.Entities
|
|||||||
m_IsBGRandomWinner = isWinner;
|
m_IsBGRandomWinner = isWinner;
|
||||||
if (m_IsBGRandomWinner)
|
if (m_IsBGRandomWinner)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_BATTLEGROUND_RANDOM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_BATTLEGROUND_RANDOM);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
// load them asynchronously
|
// load them asynchronously
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_ACTIONS_SPEC);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_ACTIONS_SPEC);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, GetActiveTalentGroup());
|
stmt.AddValue(1, GetActiveTalentGroup());
|
||||||
stmt.AddValue(2, traitConfigId);
|
stmt.AddValue(2, traitConfigId);
|
||||||
@@ -1166,7 +1166,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
SetUpdateFieldFlagValue(traitConfig.ModifyValue(traitConfig.CombatConfigFlags), (int)TraitCombatConfigFlags.SharedActionBars);
|
SetUpdateFieldFlagValue(traitConfig.ModifyValue(traitConfig.CombatConfigFlags), (int)TraitCombatConfigFlags.SharedActionBars);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_ACTION_BY_TRAIT_CONFIG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_ACTION_BY_TRAIT_CONFIG);
|
||||||
stmt.AddValue(0, GetGUID().GetCounter());
|
stmt.AddValue(0, GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, traitConfigId);
|
stmt.AddValue(1, traitConfigId);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ namespace Game.Entities
|
|||||||
if (GetSession().m_muteTime != 0 && GetSession().m_muteTime < now)
|
if (GetSession().m_muteTime != 0 && GetSession().m_muteTime < now)
|
||||||
{
|
{
|
||||||
GetSession().m_muteTime = 0;
|
GetSession().m_muteTime = 0;
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_MUTE_TIME);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_MUTE_TIME);
|
||||||
stmt.AddValue(0, 0); // Set the mute time to 0
|
stmt.AddValue(0, 0); // Set the mute time to 0
|
||||||
stmt.AddValue(1, "");
|
stmt.AddValue(1, "");
|
||||||
stmt.AddValue(2, "");
|
stmt.AddValue(2, "");
|
||||||
@@ -2886,7 +2886,7 @@ namespace Game.Entities
|
|||||||
homebindAreaId = areaId;
|
homebindAreaId = areaId;
|
||||||
|
|
||||||
// update sql homebind
|
// update sql homebind
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_PLAYER_HOMEBIND);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_PLAYER_HOMEBIND);
|
||||||
stmt.AddValue(0, homebind.GetMapId());
|
stmt.AddValue(0, homebind.GetMapId());
|
||||||
stmt.AddValue(1, homebindAreaId);
|
stmt.AddValue(1, homebindAreaId);
|
||||||
stmt.AddValue(2, homebind.GetPositionX());
|
stmt.AddValue(2, homebind.GetPositionX());
|
||||||
@@ -3971,7 +3971,7 @@ namespace Game.Entities
|
|||||||
public static void OfflineResurrect(ObjectGuid guid, SQLTransaction trans)
|
public static void OfflineResurrect(ObjectGuid guid, SQLTransaction trans)
|
||||||
{
|
{
|
||||||
Corpse.DeleteFromDB(guid, trans);
|
Corpse.DeleteFromDB(guid, trans);
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||||
stmt.AddValue(0, (ushort)AtLoginFlags.Resurrect);
|
stmt.AddValue(0, (ushort)AtLoginFlags.Resurrect);
|
||||||
stmt.AddValue(1, guid.GetCounter());
|
stmt.AddValue(1, guid.GetCounter());
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
@@ -4797,7 +4797,7 @@ namespace Game.Entities
|
|||||||
atLoginFlags &= ~flags;
|
atLoginFlags &= ~flags;
|
||||||
if (persist)
|
if (persist)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_REM_AT_LOGIN_FLAG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_REM_AT_LOGIN_FLAG);
|
||||||
stmt.AddValue(0, (ushort)flags);
|
stmt.AddValue(0, (ushort)flags);
|
||||||
stmt.AddValue(1, GetGUID().GetCounter());
|
stmt.AddValue(1, GetGUID().GetCounter());
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ namespace Game.Entities
|
|||||||
friendInfo.Flags |= flag;
|
friendInfo.Flags |= flag;
|
||||||
friendInfo.WowAccountGuid = accountGuid;
|
friendInfo.WowAccountGuid = accountGuid;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHARACTER_SOCIAL_FLAGS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHARACTER_SOCIAL_FLAGS);
|
||||||
stmt.AddValue(0, (byte)friendInfo.Flags);
|
stmt.AddValue(0, (byte)friendInfo.Flags);
|
||||||
stmt.AddValue(1, GetPlayerGUID().GetCounter());
|
stmt.AddValue(1, GetPlayerGUID().GetCounter());
|
||||||
stmt.AddValue(2, friendGuid.GetCounter());
|
stmt.AddValue(2, friendGuid.GetCounter());
|
||||||
@@ -179,7 +179,7 @@ namespace Game.Entities
|
|||||||
fi.WowAccountGuid = accountGuid;
|
fi.WowAccountGuid = accountGuid;
|
||||||
PlayerSocialMap[friendGuid] = fi;
|
PlayerSocialMap[friendGuid] = fi;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_SOCIAL);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHARACTER_SOCIAL);
|
||||||
stmt.AddValue(0, GetPlayerGUID().GetCounter());
|
stmt.AddValue(0, GetPlayerGUID().GetCounter());
|
||||||
stmt.AddValue(1, friendGuid.GetCounter());
|
stmt.AddValue(1, friendGuid.GetCounter());
|
||||||
stmt.AddValue(2, (byte)flag);
|
stmt.AddValue(2, (byte)flag);
|
||||||
@@ -202,7 +202,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (friendInfo.Flags == 0)
|
if (friendInfo.Flags == 0)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHARACTER_SOCIAL);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHARACTER_SOCIAL);
|
||||||
stmt.AddValue(0, GetPlayerGUID().GetCounter());
|
stmt.AddValue(0, GetPlayerGUID().GetCounter());
|
||||||
stmt.AddValue(1, friendGuid.GetCounter());
|
stmt.AddValue(1, friendGuid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -220,7 +220,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHARACTER_SOCIAL_FLAGS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHARACTER_SOCIAL_FLAGS);
|
||||||
stmt.AddValue(0, (byte)friendInfo.Flags);
|
stmt.AddValue(0, (byte)friendInfo.Flags);
|
||||||
stmt.AddValue(1, GetPlayerGUID().GetCounter());
|
stmt.AddValue(1, GetPlayerGUID().GetCounter());
|
||||||
stmt.AddValue(2, friendGuid.GetCounter());
|
stmt.AddValue(2, friendGuid.GetCounter());
|
||||||
@@ -233,7 +233,7 @@ namespace Game.Entities
|
|||||||
if (!PlayerSocialMap.ContainsKey(friendGuid)) // not exist
|
if (!PlayerSocialMap.ContainsKey(friendGuid)) // not exist
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHARACTER_SOCIAL_NOTE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHARACTER_SOCIAL_NOTE);
|
||||||
stmt.AddValue(0, note);
|
stmt.AddValue(0, note);
|
||||||
stmt.AddValue(1, GetPlayerGUID().GetCounter());
|
stmt.AddValue(1, GetPlayerGUID().GetCounter());
|
||||||
stmt.AddValue(2, friendGuid.GetCounter());
|
stmt.AddValue(2, friendGuid.GetCounter());
|
||||||
|
|||||||
@@ -176,11 +176,11 @@ namespace Game
|
|||||||
pair.Value.done = 0;
|
pair.Value.done = 0;
|
||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ALL_GAME_EVENT_CONDITION_SAVE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ALL_GAME_EVENT_CONDITION_SAVE);
|
||||||
stmt.AddValue(0, event_id);
|
stmt.AddValue(0, event_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GAME_EVENT_SAVE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GAME_EVENT_SAVE);
|
||||||
stmt.AddValue(0, event_id);
|
stmt.AddValue(0, event_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -1502,12 +1502,12 @@ namespace Game
|
|||||||
// save the change to db
|
// save the change to db
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GAME_EVENT_CONDITION_SAVE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GAME_EVENT_CONDITION_SAVE);
|
||||||
stmt.AddValue(0, event_id);
|
stmt.AddValue(0, event_id);
|
||||||
stmt.AddValue(1, condition);
|
stmt.AddValue(1, condition);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GAME_EVENT_CONDITION_SAVE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GAME_EVENT_CONDITION_SAVE);
|
||||||
stmt.AddValue(0, event_id);
|
stmt.AddValue(0, event_id);
|
||||||
stmt.AddValue(1, condition);
|
stmt.AddValue(1, condition);
|
||||||
stmt.AddValue(2, eventFinishCond.done);
|
stmt.AddValue(2, eventFinishCond.done);
|
||||||
@@ -1547,11 +1547,11 @@ namespace Game
|
|||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GAME_EVENT_SAVE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GAME_EVENT_SAVE);
|
||||||
stmt.AddValue(0, event_id);
|
stmt.AddValue(0, event_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GAME_EVENT_SAVE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GAME_EVENT_SAVE);
|
||||||
stmt.AddValue(0, event_id);
|
stmt.AddValue(0, event_id);
|
||||||
stmt.AddValue(1, (byte)mGameEvent[event_id].state);
|
stmt.AddValue(1, (byte)mGameEvent[event_id].state);
|
||||||
stmt.AddValue(2, mGameEvent[event_id].nextstart != 0 ? mGameEvent[event_id].nextstart : 0L);
|
stmt.AddValue(2, mGameEvent[event_id].nextstart != 0 ? mGameEvent[event_id].nextstart : 0L);
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ namespace Game.Garrisons
|
|||||||
{
|
{
|
||||||
DeleteFromDB(_owner.GetGUID().GetCounter(), trans);
|
DeleteFromDB(_owner.GetGUID().GetCounter(), trans);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, _siteLevel.Id);
|
stmt.AddValue(1, _siteLevel.Id);
|
||||||
stmt.AddValue(2, _followerActivationsRemainingToday);
|
stmt.AddValue(2, _followerActivationsRemainingToday);
|
||||||
@@ -136,7 +136,7 @@ namespace Game.Garrisons
|
|||||||
|
|
||||||
foreach (uint building in _knownBuildings)
|
foreach (uint building in _knownBuildings)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON_BLUEPRINTS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON_BLUEPRINTS);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, building);
|
stmt.AddValue(1, building);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -146,7 +146,7 @@ namespace Game.Garrisons
|
|||||||
{
|
{
|
||||||
if (plot.BuildingInfo.PacketInfo != null)
|
if (plot.BuildingInfo.PacketInfo != null)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON_BUILDINGS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON_BUILDINGS);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, plot.BuildingInfo.PacketInfo.GarrPlotInstanceID);
|
stmt.AddValue(1, plot.BuildingInfo.PacketInfo.GarrPlotInstanceID);
|
||||||
stmt.AddValue(2, plot.BuildingInfo.PacketInfo.GarrBuildingID);
|
stmt.AddValue(2, plot.BuildingInfo.PacketInfo.GarrBuildingID);
|
||||||
@@ -159,7 +159,7 @@ namespace Game.Garrisons
|
|||||||
foreach (var follower in _followers.Values)
|
foreach (var follower in _followers.Values)
|
||||||
{
|
{
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON_FOLLOWERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON_FOLLOWERS);
|
||||||
stmt.AddValue(index++, follower.PacketInfo.DbID);
|
stmt.AddValue(index++, follower.PacketInfo.DbID);
|
||||||
stmt.AddValue(index++, _owner.GetGUID().GetCounter());
|
stmt.AddValue(index++, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(index++, follower.PacketInfo.GarrFollowerID);
|
stmt.AddValue(index++, follower.PacketInfo.GarrFollowerID);
|
||||||
@@ -176,7 +176,7 @@ namespace Game.Garrisons
|
|||||||
byte slot = 0;
|
byte slot = 0;
|
||||||
foreach (GarrAbilityRecord ability in follower.PacketInfo.AbilityID)
|
foreach (GarrAbilityRecord ability in follower.PacketInfo.AbilityID)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON_FOLLOWER_ABILITIES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON_FOLLOWER_ABILITIES);
|
||||||
stmt.AddValue(0, follower.PacketInfo.DbID);
|
stmt.AddValue(0, follower.PacketInfo.DbID);
|
||||||
stmt.AddValue(1, ability.Id);
|
stmt.AddValue(1, ability.Id);
|
||||||
stmt.AddValue(2, slot++);
|
stmt.AddValue(2, slot++);
|
||||||
@@ -187,19 +187,19 @@ namespace Game.Garrisons
|
|||||||
|
|
||||||
public static void DeleteFromDB(ulong ownerGuid, SQLTransaction trans)
|
public static void DeleteFromDB(ulong ownerGuid, SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHARACTER_GARRISON);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHARACTER_GARRISON);
|
||||||
stmt.AddValue(0, ownerGuid);
|
stmt.AddValue(0, ownerGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHARACTER_GARRISON_BLUEPRINTS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHARACTER_GARRISON_BLUEPRINTS);
|
||||||
stmt.AddValue(0, ownerGuid);
|
stmt.AddValue(0, ownerGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHARACTER_GARRISON_BUILDINGS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHARACTER_GARRISON_BUILDINGS);
|
||||||
stmt.AddValue(0, ownerGuid);
|
stmt.AddValue(0, ownerGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHARACTER_GARRISON_FOLLOWERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHARACTER_GARRISON_FOLLOWERS);
|
||||||
stmt.AddValue(0, ownerGuid);
|
stmt.AddValue(0, ownerGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1056,7 +1056,7 @@ namespace Game
|
|||||||
// add link to DB
|
// add link to DB
|
||||||
if (persist)
|
if (persist)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.INS_GRAVEYARD_ZONE);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_GRAVEYARD_ZONE);
|
||||||
|
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
stmt.AddValue(1, zoneId);
|
stmt.AddValue(1, zoneId);
|
||||||
@@ -1104,7 +1104,7 @@ namespace Game
|
|||||||
// remove link from DB
|
// remove link from DB
|
||||||
if (persist)
|
if (persist)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_GRAVEYARD_ZONE);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_GRAVEYARD_ZONE);
|
||||||
|
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
stmt.AddValue(1, zoneId);
|
stmt.AddValue(1, zoneId);
|
||||||
@@ -1557,7 +1557,7 @@ namespace Game
|
|||||||
foreach (var script in sWaypointScripts)
|
foreach (var script in sWaypointScripts)
|
||||||
actionSet.Add(script.Key);
|
actionSet.Add(script.Key);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_ACTION);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_ACTION);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -1774,7 +1774,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
var time = Time.GetMSTime();
|
var time = Time.GetMSTime();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_CREATURE_TEMPLATE);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_CREATURE_TEMPLATE);
|
||||||
stmt.AddValue(0, 0);
|
stmt.AddValue(0, 0);
|
||||||
stmt.AddValue(1, 1);
|
stmt.AddValue(1, 1);
|
||||||
|
|
||||||
@@ -3515,7 +3515,7 @@ namespace Game
|
|||||||
uint LoadReferenceVendor(int vendor, int item, List<uint> skip_vendors)
|
uint LoadReferenceVendor(int vendor, int item, List<uint> skip_vendors)
|
||||||
{
|
{
|
||||||
// find all items from the reference vendor
|
// find all items from the reference vendor
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_NPC_VENDOR_REF);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_NPC_VENDOR_REF);
|
||||||
stmt.AddValue(0, item);
|
stmt.AddValue(0, item);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
@@ -3788,7 +3788,7 @@ namespace Game
|
|||||||
PhasingHandler.InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
PhasingHandler.InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
||||||
Global.TerrainMgr.GetZoneAndAreaId(phaseShift, out uint zoneId, out uint areaId, data.MapId, data.SpawnPoint);
|
Global.TerrainMgr.GetZoneAndAreaId(phaseShift, out uint zoneId, out uint areaId, data.MapId, data.SpawnPoint);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_ZONE_AREA_DATA);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_CREATURE_ZONE_AREA_DATA);
|
||||||
stmt.AddValue(0, zoneId);
|
stmt.AddValue(0, zoneId);
|
||||||
stmt.AddValue(1, areaId);
|
stmt.AddValue(1, areaId);
|
||||||
stmt.AddValue(2, guid);
|
stmt.AddValue(2, guid);
|
||||||
@@ -3945,7 +3945,7 @@ namespace Game
|
|||||||
if (linkedGuidLow == 0) // we're removing the linking
|
if (linkedGuidLow == 0) // we're removing the linking
|
||||||
{
|
{
|
||||||
linkedRespawnStorage.Remove(guid);
|
linkedRespawnStorage.Remove(guid);
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_LINKED_RESPAWN);
|
||||||
stmt.AddValue(0, guidLow);
|
stmt.AddValue(0, guidLow);
|
||||||
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.CreatureToCreature);
|
stmt.AddValue(1, (uint)CreatureLinkedRespawnType.CreatureToCreature);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
@@ -3976,7 +3976,7 @@ namespace Game
|
|||||||
ObjectGuid linkedGuid = ObjectGuid.Create(HighGuid.Creature, slave.MapId, slave.Id, linkedGuidLow);
|
ObjectGuid linkedGuid = ObjectGuid.Create(HighGuid.Creature, slave.MapId, slave.Id, linkedGuidLow);
|
||||||
|
|
||||||
linkedRespawnStorage[guid] = linkedGuid;
|
linkedRespawnStorage[guid] = linkedGuid;
|
||||||
stmt = DB.World.GetPreparedStatement(WorldStatements.REP_LINKED_RESPAWN);
|
stmt = WorldDatabase.GetPreparedStatement(WorldStatements.REP_LINKED_RESPAWN);
|
||||||
stmt.AddValue(0, guidLow);
|
stmt.AddValue(0, guidLow);
|
||||||
stmt.AddValue(1, linkedGuidLow);
|
stmt.AddValue(1, linkedGuidLow);
|
||||||
stmt.AddValue(2, (uint)CreatureLinkedRespawnType.CreatureToCreature);
|
stmt.AddValue(2, (uint)CreatureLinkedRespawnType.CreatureToCreature);
|
||||||
@@ -4581,7 +4581,7 @@ namespace Game
|
|||||||
PhasingHandler.InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
PhasingHandler.InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
||||||
Global.TerrainMgr.GetZoneAndAreaId(phaseShift, out uint zoneId, out uint areaId, data.MapId, data.SpawnPoint);
|
Global.TerrainMgr.GetZoneAndAreaId(phaseShift, out uint zoneId, out uint areaId, data.MapId, data.SpawnPoint);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_GAMEOBJECT_ZONE_AREA_DATA);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.UPD_GAMEOBJECT_ZONE_AREA_DATA);
|
||||||
stmt.AddValue(0, zoneId);
|
stmt.AddValue(0, zoneId);
|
||||||
stmt.AddValue(1, areaId);
|
stmt.AddValue(1, areaId);
|
||||||
stmt.AddValue(2, guid);
|
stmt.AddValue(2, guid);
|
||||||
@@ -5180,7 +5180,7 @@ namespace Game
|
|||||||
|
|
||||||
if (persist)
|
if (persist)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.INS_NPC_VENDOR);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_NPC_VENDOR);
|
||||||
|
|
||||||
stmt.AddValue(0, entry);
|
stmt.AddValue(0, entry);
|
||||||
stmt.AddValue(1, vItem.item);
|
stmt.AddValue(1, vItem.item);
|
||||||
@@ -5203,7 +5203,7 @@ namespace Game
|
|||||||
|
|
||||||
if (persist)
|
if (persist)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_NPC_VENDOR);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_NPC_VENDOR);
|
||||||
|
|
||||||
stmt.AddValue(0, entry);
|
stmt.AddValue(0, entry);
|
||||||
stmt.AddValue(1, item);
|
stmt.AddValue(1, item);
|
||||||
@@ -5918,7 +5918,7 @@ namespace Game
|
|||||||
|
|
||||||
gameTeleStorage[newId] = tele;
|
gameTeleStorage[newId] = tele;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.INS_GAME_TELE);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.INS_GAME_TELE);
|
||||||
|
|
||||||
stmt.AddValue(0, newId);
|
stmt.AddValue(0, newId);
|
||||||
stmt.AddValue(1, tele.posX);
|
stmt.AddValue(1, tele.posX);
|
||||||
@@ -5940,7 +5940,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
if (pair.Value.nameLow == name)
|
if (pair.Value.nameLow == name)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_GAME_TELE);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.DEL_GAME_TELE);
|
||||||
stmt.AddValue(0, pair.Value.name);
|
stmt.AddValue(0, pair.Value.name);
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|
||||||
@@ -9601,11 +9601,11 @@ namespace Game
|
|||||||
// Delete all old mails without item and without body immediately, if starting server
|
// Delete all old mails without item and without body immediately, if starting server
|
||||||
if (!serverUp)
|
if (!serverUp)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_EMPTY_EXPIRED_MAIL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_EMPTY_EXPIRED_MAIL);
|
||||||
stmt.AddValue(0, curTime);
|
stmt.AddValue(0, curTime);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_EXPIRED_MAIL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_EXPIRED_MAIL);
|
||||||
stmt.AddValue(0, curTime);
|
stmt.AddValue(0, curTime);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
@@ -9615,7 +9615,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
MultiMap<ulong, MailItemInfo> itemsCache = new();
|
MultiMap<ulong, MailItemInfo> itemsCache = new();
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_EXPIRED_MAIL_ITEMS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_EXPIRED_MAIL_ITEMS);
|
||||||
stmt.AddValue(0, curTime);
|
stmt.AddValue(0, curTime);
|
||||||
SQLResult items = DB.Characters.Query(stmt);
|
SQLResult items = DB.Characters.Query(stmt);
|
||||||
if (!items.IsEmpty())
|
if (!items.IsEmpty())
|
||||||
@@ -9668,14 +9668,14 @@ namespace Game
|
|||||||
AzeriteEmpoweredItem.DeleteFromDB(null, itemInfo.item_guid);
|
AzeriteEmpoweredItem.DeleteFromDB(null, itemInfo.item_guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_MAIL_ITEM_BY_ID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_MAIL_ITEM_BY_ID);
|
||||||
stmt.AddValue(0, m.messageID);
|
stmt.AddValue(0, m.messageID);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Mail will be returned
|
// Mail will be returned
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_MAIL_RETURNED);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_MAIL_RETURNED);
|
||||||
stmt.AddValue(0, m.receiver);
|
stmt.AddValue(0, m.receiver);
|
||||||
stmt.AddValue(1, m.sender);
|
stmt.AddValue(1, m.sender);
|
||||||
stmt.AddValue(2, curTime + 30 * Time.Day);
|
stmt.AddValue(2, curTime + 30 * Time.Day);
|
||||||
@@ -9686,12 +9686,12 @@ namespace Game
|
|||||||
foreach (var itemInfo in m.items)
|
foreach (var itemInfo in m.items)
|
||||||
{
|
{
|
||||||
// Update receiver in mail items for its proper delivery, and in instance_item for avoid lost item at sender delete
|
// Update receiver in mail items for its proper delivery, and in instance_item for avoid lost item at sender delete
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_MAIL_ITEM_RECEIVER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_MAIL_ITEM_RECEIVER);
|
||||||
stmt.AddValue(0, m.sender);
|
stmt.AddValue(0, m.sender);
|
||||||
stmt.AddValue(1, itemInfo.item_guid);
|
stmt.AddValue(1, itemInfo.item_guid);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ITEM_OWNER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ITEM_OWNER);
|
||||||
stmt.AddValue(0, m.sender);
|
stmt.AddValue(0, m.sender);
|
||||||
stmt.AddValue(1, itemInfo.item_guid);
|
stmt.AddValue(1, itemInfo.item_guid);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -9701,7 +9701,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_MAIL_BY_ID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_MAIL_BY_ID);
|
||||||
stmt.AddValue(0, m.messageID);
|
stmt.AddValue(0, m.messageID);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
++deletedCount;
|
++deletedCount;
|
||||||
|
|||||||
+18
-18
@@ -124,7 +124,7 @@ namespace Game.Groups
|
|||||||
Global.GroupMgr.RegisterGroupDbStoreId(m_dbStoreId, this);
|
Global.GroupMgr.RegisterGroupDbStoreId(m_dbStoreId, this);
|
||||||
|
|
||||||
// Store group in database
|
// Store group in database
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GROUP);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GROUP);
|
||||||
|
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ namespace Game.Groups
|
|||||||
var character = Global.CharacterCacheStorage.GetCharacterCacheByGuid(member.guid);
|
var character = Global.CharacterCacheStorage.GetCharacterCacheByGuid(member.guid);
|
||||||
if (character == null)
|
if (character == null)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GROUP_MEMBER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GROUP_MEMBER);
|
||||||
stmt.AddValue(0, guidLow);
|
stmt.AddValue(0, guidLow);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
return;
|
return;
|
||||||
@@ -232,7 +232,7 @@ namespace Game.Groups
|
|||||||
m_lootMethod = LootMethod.PersonalLoot;
|
m_lootMethod = LootMethod.PersonalLoot;
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_TYPE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_TYPE);
|
||||||
|
|
||||||
stmt.AddValue(0, (byte)m_groupFlags);
|
stmt.AddValue(0, (byte)m_groupFlags);
|
||||||
stmt.AddValue(1, m_dbStoreId);
|
stmt.AddValue(1, m_dbStoreId);
|
||||||
@@ -251,7 +251,7 @@ namespace Game.Groups
|
|||||||
|
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_TYPE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_TYPE);
|
||||||
|
|
||||||
stmt.AddValue(0, (byte)m_groupFlags);
|
stmt.AddValue(0, (byte)m_groupFlags);
|
||||||
stmt.AddValue(1, m_dbStoreId);
|
stmt.AddValue(1, m_dbStoreId);
|
||||||
@@ -281,7 +281,7 @@ namespace Game.Groups
|
|||||||
|
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_TYPE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_TYPE);
|
||||||
|
|
||||||
stmt.AddValue(0, (byte)m_groupFlags);
|
stmt.AddValue(0, (byte)m_groupFlags);
|
||||||
stmt.AddValue(1, m_dbStoreId);
|
stmt.AddValue(1, m_dbStoreId);
|
||||||
@@ -429,7 +429,7 @@ namespace Game.Groups
|
|||||||
// insert into the table if we're not a Battlegroundgroup
|
// insert into the table if we're not a Battlegroundgroup
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GROUP_MEMBER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GROUP_MEMBER);
|
||||||
|
|
||||||
stmt.AddValue(0, m_dbStoreId);
|
stmt.AddValue(0, m_dbStoreId);
|
||||||
stmt.AddValue(1, member.guid.GetCounter());
|
stmt.AddValue(1, member.guid.GetCounter());
|
||||||
@@ -573,7 +573,7 @@ namespace Game.Groups
|
|||||||
// Remove player from group in DB
|
// Remove player from group in DB
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GROUP_MEMBER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GROUP_MEMBER);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
DelinkMember(guid);
|
DelinkMember(guid);
|
||||||
@@ -651,7 +651,7 @@ namespace Game.Groups
|
|||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
// Update the group leader
|
// Update the group leader
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_LEADER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_LEADER);
|
||||||
|
|
||||||
stmt.AddValue(0, newLeader.GetGUID().GetCounter());
|
stmt.AddValue(0, newLeader.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, m_dbStoreId);
|
stmt.AddValue(1, m_dbStoreId);
|
||||||
@@ -723,15 +723,15 @@ namespace Game.Groups
|
|||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GROUP);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GROUP);
|
||||||
stmt.AddValue(0, m_dbStoreId);
|
stmt.AddValue(0, m_dbStoreId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GROUP_MEMBER_ALL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GROUP_MEMBER_ALL);
|
||||||
stmt.AddValue(0, m_dbStoreId);
|
stmt.AddValue(0, m_dbStoreId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_LFG_DATA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_LFG_DATA);
|
||||||
stmt.AddValue(0, m_dbStoreId);
|
stmt.AddValue(0, m_dbStoreId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -959,7 +959,7 @@ namespace Game.Groups
|
|||||||
|
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_SUBGROUP);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_SUBGROUP);
|
||||||
|
|
||||||
stmt.AddValue(0, group);
|
stmt.AddValue(0, group);
|
||||||
stmt.AddValue(1, guid.GetCounter());
|
stmt.AddValue(1, guid.GetCounter());
|
||||||
@@ -1009,7 +1009,7 @@ namespace Game.Groups
|
|||||||
// Preserve new sub group in database for non-raid groups
|
// Preserve new sub group in database for non-raid groups
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_SUBGROUP);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_SUBGROUP);
|
||||||
|
|
||||||
stmt.AddValue(0, group);
|
stmt.AddValue(0, group);
|
||||||
stmt.AddValue(1, guid.GetCounter());
|
stmt.AddValue(1, guid.GetCounter());
|
||||||
@@ -1058,7 +1058,7 @@ namespace Game.Groups
|
|||||||
// Preserve new sub group in database for non-raid groups
|
// Preserve new sub group in database for non-raid groups
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_SUBGROUP);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_SUBGROUP);
|
||||||
stmt.AddValue(0, slots[i].group);
|
stmt.AddValue(0, slots[i].group);
|
||||||
stmt.AddValue(1, slots[i].guid.GetCounter());
|
stmt.AddValue(1, slots[i].guid.GetCounter());
|
||||||
|
|
||||||
@@ -1245,7 +1245,7 @@ namespace Game.Groups
|
|||||||
m_dungeonDifficulty = difficulty;
|
m_dungeonDifficulty = difficulty;
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_DIFFICULTY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_DIFFICULTY);
|
||||||
|
|
||||||
stmt.AddValue(0, (byte)m_dungeonDifficulty);
|
stmt.AddValue(0, (byte)m_dungeonDifficulty);
|
||||||
stmt.AddValue(1, m_dbStoreId);
|
stmt.AddValue(1, m_dbStoreId);
|
||||||
@@ -1269,7 +1269,7 @@ namespace Game.Groups
|
|||||||
m_raidDifficulty = difficulty;
|
m_raidDifficulty = difficulty;
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_RAID_DIFFICULTY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_RAID_DIFFICULTY);
|
||||||
|
|
||||||
stmt.AddValue(0, (byte)m_raidDifficulty);
|
stmt.AddValue(0, (byte)m_raidDifficulty);
|
||||||
stmt.AddValue(1, m_dbStoreId);
|
stmt.AddValue(1, m_dbStoreId);
|
||||||
@@ -1293,7 +1293,7 @@ namespace Game.Groups
|
|||||||
m_legacyRaidDifficulty = difficulty;
|
m_legacyRaidDifficulty = difficulty;
|
||||||
if (!IsBGGroup() && !IsBFGroup())
|
if (!IsBGGroup() && !IsBFGroup())
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_LEGACY_RAID_DIFFICULTY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_LEGACY_RAID_DIFFICULTY);
|
||||||
|
|
||||||
stmt.AddValue(0, (byte)m_legacyRaidDifficulty);
|
stmt.AddValue(0, (byte)m_legacyRaidDifficulty);
|
||||||
stmt.AddValue(1, m_dbStoreId);
|
stmt.AddValue(1, m_dbStoreId);
|
||||||
@@ -1746,7 +1746,7 @@ namespace Game.Groups
|
|||||||
ToggleGroupMemberFlag(slot, flag, apply);
|
ToggleGroupMemberFlag(slot, flag, apply);
|
||||||
|
|
||||||
// Preserve the new setting in the db
|
// Preserve the new setting in the db
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_FLAG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_FLAG);
|
||||||
|
|
||||||
stmt.AddValue(0, (byte)slot.flags);
|
stmt.AddValue(0, (byte)slot.flags);
|
||||||
stmt.AddValue(1, guid.GetCounter());
|
stmt.AddValue(1, guid.GetCounter());
|
||||||
|
|||||||
+48
-48
@@ -48,12 +48,12 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_MEMBERS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_MEMBERS);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD);
|
||||||
stmt.AddValue(index, m_id);
|
stmt.AddValue(index, m_id);
|
||||||
stmt.AddValue(++index, name);
|
stmt.AddValue(++index, name);
|
||||||
stmt.AddValue(++index, m_leaderGuid.GetCounter());
|
stmt.AddValue(++index, m_leaderGuid.GetCounter());
|
||||||
@@ -97,34 +97,34 @@ namespace Game.Guilds
|
|||||||
DeleteMember(trans, member.Value.GetGUID(), true);
|
DeleteMember(trans, member.Value.GetGUID(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_RANKS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_RANKS);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_TABS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_TABS);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
// Free bank tab used memory and delete items stored in them
|
// Free bank tab used memory and delete items stored in them
|
||||||
_DeleteBankItems(trans, true);
|
_DeleteBankItems(trans, true);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_ITEMS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_ITEMS);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_RIGHTS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_RIGHTS);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_EVENTLOGS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_EVENTLOGS);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_EVENTLOGS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_EVENTLOGS);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ namespace Game.Guilds
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_name = name;
|
m_name = name;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_NAME);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_NAME);
|
||||||
stmt.AddValue(0, m_name);
|
stmt.AddValue(0, m_name);
|
||||||
stmt.AddValue(1, GetId());
|
stmt.AddValue(1, GetId());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -340,7 +340,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
Global.ScriptMgr.OnGuildMOTDChanged(this, motd);
|
Global.ScriptMgr.OnGuildMOTDChanged(this, motd);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_MOTD);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_MOTD);
|
||||||
stmt.AddValue(0, motd);
|
stmt.AddValue(0, motd);
|
||||||
stmt.AddValue(1, m_id);
|
stmt.AddValue(1, m_id);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -361,7 +361,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
Global.ScriptMgr.OnGuildInfoChanged(this, info);
|
Global.ScriptMgr.OnGuildInfoChanged(this, info);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_INFO);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_INFO);
|
||||||
stmt.AddValue(0, info);
|
stmt.AddValue(0, info);
|
||||||
stmt.AddValue(1, m_id);
|
stmt.AddValue(1, m_id);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -804,13 +804,13 @@ namespace Game.Guilds
|
|||||||
SQLTransaction trans = new SQLTransaction();
|
SQLTransaction trans = new SQLTransaction();
|
||||||
|
|
||||||
// Delete bank rights for rank
|
// Delete bank rights for rank
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_RIGHTS_FOR_RANK);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_RIGHTS_FOR_RANK);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
stmt.AddValue(1, (byte)rankInfo.GetId());
|
stmt.AddValue(1, (byte)rankInfo.GetId());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
// Delete rank
|
// Delete rank
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_RANK);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_RANK);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
stmt.AddValue(1, (byte)rankInfo.GetId());
|
stmt.AddValue(1, (byte)rankInfo.GetId());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -825,7 +825,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
otherRank.SetOrder(otherRank.GetOrder() - 1);
|
otherRank.SetOrder(otherRank.GetOrder() - 1);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_ORDER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_ORDER);
|
||||||
stmt.AddValue(0, (byte)otherRank.GetOrder());
|
stmt.AddValue(0, (byte)otherRank.GetOrder());
|
||||||
stmt.AddValue(1, (byte)otherRank.GetId());
|
stmt.AddValue(1, (byte)otherRank.GetId());
|
||||||
stmt.AddValue(2, m_id);
|
stmt.AddValue(2, m_id);
|
||||||
@@ -859,13 +859,13 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
SQLTransaction trans = new SQLTransaction();
|
SQLTransaction trans = new SQLTransaction();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_ORDER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_ORDER);
|
||||||
stmt.AddValue(0, (byte)rankInfo.GetOrder());
|
stmt.AddValue(0, (byte)rankInfo.GetOrder());
|
||||||
stmt.AddValue(1, (byte)rankInfo.GetId());
|
stmt.AddValue(1, (byte)rankInfo.GetId());
|
||||||
stmt.AddValue(2, m_id);
|
stmt.AddValue(2, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_ORDER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_ORDER);
|
||||||
stmt.AddValue(0, (byte)otherRankInfo.GetOrder());
|
stmt.AddValue(0, (byte)otherRankInfo.GetOrder());
|
||||||
stmt.AddValue(1, (byte)otherRankInfo.GetId());
|
stmt.AddValue(1, (byte)otherRankInfo.GetId());
|
||||||
stmt.AddValue(2, m_id);
|
stmt.AddValue(2, m_id);
|
||||||
@@ -1628,7 +1628,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
// Player must exist
|
// Player must exist
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_DATA_FOR_GUILD);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_DATA_FOR_GUILD);
|
||||||
stmt.AddValue(0, lowguid);
|
stmt.AddValue(0, lowguid);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -1814,12 +1814,12 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_TAB);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_TAB);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
stmt.AddValue(1, tabId);
|
stmt.AddValue(1, tabId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_BANK_TAB);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_BANK_TAB);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
stmt.AddValue(1, tabId);
|
stmt.AddValue(1, tabId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -1833,11 +1833,11 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
void _CreateDefaultGuildRanks(SQLTransaction trans, Locale loc = Locale.enUS)
|
void _CreateDefaultGuildRanks(SQLTransaction trans, Locale loc = Locale.enUS)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_RANKS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_RANKS);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_RIGHTS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_RIGHTS);
|
||||||
stmt.AddValue(0, m_id);
|
stmt.AddValue(0, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -1918,7 +1918,7 @@ namespace Game.Guilds
|
|||||||
m_bankMoney -= amount;
|
m_bankMoney -= amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_BANK_MONEY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_BANK_MONEY);
|
||||||
stmt.AddValue(0, m_bankMoney);
|
stmt.AddValue(0, m_bankMoney);
|
||||||
stmt.AddValue(1, m_id);
|
stmt.AddValue(1, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -1934,7 +1934,7 @@ namespace Game.Guilds
|
|||||||
m_leaderGuid = leader.GetGUID();
|
m_leaderGuid = leader.GetGUID();
|
||||||
leader.ChangeRank(trans, GuildRankId.GuildMaster);
|
leader.ChangeRank(trans, GuildRankId.GuildMaster);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_LEADER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_LEADER);
|
||||||
stmt.AddValue(0, m_leaderGuid.GetCounter());
|
stmt.AddValue(0, m_leaderGuid.GetCounter());
|
||||||
stmt.AddValue(1, m_id);
|
stmt.AddValue(1, m_id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -2502,7 +2502,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
void _DeleteMemberFromDB(SQLTransaction trans, ulong lowguid)
|
void _DeleteMemberFromDB(SQLTransaction trans, ulong lowguid)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_MEMBER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_MEMBER);
|
||||||
stmt.AddValue(0, lowguid);
|
stmt.AddValue(0, lowguid);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
}
|
}
|
||||||
@@ -2618,7 +2618,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
m_publicNote = publicNote;
|
m_publicNote = publicNote;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_MEMBER_PNOTE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_MEMBER_PNOTE);
|
||||||
stmt.AddValue(0, publicNote);
|
stmt.AddValue(0, publicNote);
|
||||||
stmt.AddValue(1, m_guid.GetCounter());
|
stmt.AddValue(1, m_guid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -2631,7 +2631,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
m_officerNote = officerNote;
|
m_officerNote = officerNote;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_MEMBER_OFFNOTE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_MEMBER_OFFNOTE);
|
||||||
stmt.AddValue(0, officerNote);
|
stmt.AddValue(0, officerNote);
|
||||||
stmt.AddValue(1, m_guid.GetCounter());
|
stmt.AddValue(1, m_guid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -2646,7 +2646,7 @@ namespace Game.Guilds
|
|||||||
if (player != null)
|
if (player != null)
|
||||||
player.SetGuildRank((byte)newRank);
|
player.SetGuildRank((byte)newRank);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_MEMBER_RANK);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_MEMBER_RANK);
|
||||||
stmt.AddValue(0, (byte)newRank);
|
stmt.AddValue(0, (byte)newRank);
|
||||||
stmt.AddValue(1, m_guid.GetCounter());
|
stmt.AddValue(1, m_guid.GetCounter());
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
@@ -2654,7 +2654,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
public void SaveToDB(SQLTransaction trans)
|
public void SaveToDB(SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_MEMBER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_MEMBER);
|
||||||
stmt.AddValue(0, m_guildId);
|
stmt.AddValue(0, m_guildId);
|
||||||
stmt.AddValue(1, m_guid.GetCounter());
|
stmt.AddValue(1, m_guid.GetCounter());
|
||||||
stmt.AddValue(2, (byte)m_rankId);
|
stmt.AddValue(2, (byte)m_rankId);
|
||||||
@@ -2732,7 +2732,7 @@ namespace Game.Guilds
|
|||||||
{
|
{
|
||||||
m_bankWithdraw[tabId] += amount;
|
m_bankWithdraw[tabId] += amount;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_MEMBER_WITHDRAW_TABS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_MEMBER_WITHDRAW_TABS);
|
||||||
stmt.AddValue(0, m_guid.GetCounter());
|
stmt.AddValue(0, m_guid.GetCounter());
|
||||||
for (byte i = 0; i < GuildConst.MaxBankTabs;)
|
for (byte i = 0; i < GuildConst.MaxBankTabs;)
|
||||||
{
|
{
|
||||||
@@ -2748,7 +2748,7 @@ namespace Game.Guilds
|
|||||||
{
|
{
|
||||||
m_bankWithdrawMoney += amount;
|
m_bankWithdrawMoney += amount;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_MEMBER_WITHDRAW_MONEY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_MEMBER_WITHDRAW_MONEY);
|
||||||
stmt.AddValue(0, m_guid.GetCounter());
|
stmt.AddValue(0, m_guid.GetCounter());
|
||||||
stmt.AddValue(1, m_bankWithdrawMoney);
|
stmt.AddValue(1, m_bankWithdrawMoney);
|
||||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||||
@@ -2890,13 +2890,13 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
public override void SaveToDB(SQLTransaction trans)
|
public override void SaveToDB(SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_EVENTLOG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_EVENTLOG);
|
||||||
stmt.AddValue(0, m_guildId);
|
stmt.AddValue(0, m_guildId);
|
||||||
stmt.AddValue(1, m_guid);
|
stmt.AddValue(1, m_guid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_EVENTLOG);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_EVENTLOG);
|
||||||
stmt.AddValue(index, m_guildId);
|
stmt.AddValue(index, m_guildId);
|
||||||
stmt.AddValue(++index, m_guid);
|
stmt.AddValue(++index, m_guid);
|
||||||
stmt.AddValue(++index, (byte)m_eventType);
|
stmt.AddValue(++index, (byte)m_eventType);
|
||||||
@@ -2969,14 +2969,14 @@ namespace Game.Guilds
|
|||||||
{
|
{
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_EVENTLOG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_EVENTLOG);
|
||||||
stmt.AddValue(index, m_guildId);
|
stmt.AddValue(index, m_guildId);
|
||||||
stmt.AddValue(++index, m_guid);
|
stmt.AddValue(++index, m_guid);
|
||||||
stmt.AddValue(++index, m_bankTabId);
|
stmt.AddValue(++index, m_bankTabId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
index = 0;
|
index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_BANK_EVENTLOG);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_BANK_EVENTLOG);
|
||||||
stmt.AddValue(index, m_guildId);
|
stmt.AddValue(index, m_guildId);
|
||||||
stmt.AddValue(++index, m_guid);
|
stmt.AddValue(++index, m_guid);
|
||||||
stmt.AddValue(++index, m_bankTabId);
|
stmt.AddValue(++index, m_bankTabId);
|
||||||
@@ -3067,7 +3067,7 @@ namespace Game.Guilds
|
|||||||
public override void SaveToDB(SQLTransaction trans)
|
public override void SaveToDB(SQLTransaction trans)
|
||||||
{
|
{
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_NEWS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_NEWS);
|
||||||
stmt.AddValue(index, m_guildId);
|
stmt.AddValue(index, m_guildId);
|
||||||
stmt.AddValue(++index, GetGUID());
|
stmt.AddValue(++index, GetGUID());
|
||||||
stmt.AddValue(++index, (byte)GetNewsType());
|
stmt.AddValue(++index, (byte)GetNewsType());
|
||||||
@@ -3201,7 +3201,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
public void SaveToDB(SQLTransaction trans)
|
public void SaveToDB(SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_RANK);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_RANK);
|
||||||
stmt.AddValue(0, m_guildId);
|
stmt.AddValue(0, m_guildId);
|
||||||
stmt.AddValue(1, (byte)m_rankId);
|
stmt.AddValue(1, (byte)m_rankId);
|
||||||
stmt.AddValue(2, (byte)m_rankOrder);
|
stmt.AddValue(2, (byte)m_rankOrder);
|
||||||
@@ -3226,7 +3226,7 @@ namespace Game.Guilds
|
|||||||
if (logOnCreate)
|
if (logOnCreate)
|
||||||
Log.outError(LogFilter.Guild, $"Guild {m_guildId} has broken Tab {i} for rank {m_rankId}. Created default tab.");
|
Log.outError(LogFilter.Guild, $"Guild {m_guildId} has broken Tab {i} for rank {m_rankId}. Created default tab.");
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_BANK_RIGHT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_BANK_RIGHT);
|
||||||
stmt.AddValue(0, m_guildId);
|
stmt.AddValue(0, m_guildId);
|
||||||
stmt.AddValue(1, i);
|
stmt.AddValue(1, i);
|
||||||
stmt.AddValue(2, (byte)m_rankId);
|
stmt.AddValue(2, (byte)m_rankId);
|
||||||
@@ -3243,7 +3243,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
m_name = name;
|
m_name = name;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_NAME);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_NAME);
|
||||||
stmt.AddValue(0, m_name);
|
stmt.AddValue(0, m_name);
|
||||||
stmt.AddValue(1, (byte)m_rankId);
|
stmt.AddValue(1, (byte)m_rankId);
|
||||||
stmt.AddValue(2, m_guildId);
|
stmt.AddValue(2, m_guildId);
|
||||||
@@ -3260,7 +3260,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
m_rights = rights;
|
m_rights = rights;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_RIGHTS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_RIGHTS);
|
||||||
stmt.AddValue(0, (uint)m_rights);
|
stmt.AddValue(0, (uint)m_rights);
|
||||||
stmt.AddValue(1, (byte)m_rankId);
|
stmt.AddValue(1, (byte)m_rankId);
|
||||||
stmt.AddValue(2, m_guildId);
|
stmt.AddValue(2, m_guildId);
|
||||||
@@ -3274,7 +3274,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
m_bankMoneyPerDay = money;
|
m_bankMoneyPerDay = money;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_BANK_MONEY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_BANK_MONEY);
|
||||||
stmt.AddValue(0, money);
|
stmt.AddValue(0, money);
|
||||||
stmt.AddValue(1, (byte)m_rankId);
|
stmt.AddValue(1, (byte)m_rankId);
|
||||||
stmt.AddValue(2, m_guildId);
|
stmt.AddValue(2, m_guildId);
|
||||||
@@ -3290,7 +3290,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
if (saveToDB)
|
if (saveToDB)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_BANK_RIGHT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_BANK_RIGHT);
|
||||||
stmt.AddValue(0, m_guildId);
|
stmt.AddValue(0, m_guildId);
|
||||||
stmt.AddValue(1, rightsAndSlots.GetTabId());
|
stmt.AddValue(1, rightsAndSlots.GetTabId());
|
||||||
stmt.AddValue(2, (byte)m_rankId);
|
stmt.AddValue(2, (byte)m_rankId);
|
||||||
@@ -3372,7 +3372,7 @@ namespace Game.Guilds
|
|||||||
{
|
{
|
||||||
Log.outError(LogFilter.Guild, "Item (GUID {0}, id: {1}) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry);
|
Log.outError(LogFilter.Guild, "Item (GUID {0}, id: {1}) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_NONEXISTENT_GUILD_BANK_ITEM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_NONEXISTENT_GUILD_BANK_ITEM);
|
||||||
stmt.AddValue(0, m_guildId);
|
stmt.AddValue(0, m_guildId);
|
||||||
stmt.AddValue(1, m_tabId);
|
stmt.AddValue(1, m_tabId);
|
||||||
stmt.AddValue(2, slotId);
|
stmt.AddValue(2, slotId);
|
||||||
@@ -3407,7 +3407,7 @@ namespace Game.Guilds
|
|||||||
m_name = name;
|
m_name = name;
|
||||||
m_icon = icon;
|
m_icon = icon;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_BANK_TAB_INFO);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_BANK_TAB_INFO);
|
||||||
stmt.AddValue(0, m_name);
|
stmt.AddValue(0, m_name);
|
||||||
stmt.AddValue(1, m_icon);
|
stmt.AddValue(1, m_icon);
|
||||||
stmt.AddValue(2, m_guildId);
|
stmt.AddValue(2, m_guildId);
|
||||||
@@ -3422,7 +3422,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
m_text = text;
|
m_text = text;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_BANK_TAB_TEXT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_BANK_TAB_TEXT);
|
||||||
stmt.AddValue(0, m_text);
|
stmt.AddValue(0, m_text);
|
||||||
stmt.AddValue(1, m_guildId);
|
stmt.AddValue(1, m_guildId);
|
||||||
stmt.AddValue(2, m_tabId);
|
stmt.AddValue(2, m_tabId);
|
||||||
@@ -3462,7 +3462,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
m_items[slotId] = item;
|
m_items[slotId] = item;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_ITEM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_BANK_ITEM);
|
||||||
stmt.AddValue(0, m_guildId);
|
stmt.AddValue(0, m_guildId);
|
||||||
stmt.AddValue(1, m_tabId);
|
stmt.AddValue(1, m_tabId);
|
||||||
stmt.AddValue(2, slotId);
|
stmt.AddValue(2, slotId);
|
||||||
@@ -3470,7 +3470,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_BANK_ITEM);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GUILD_BANK_ITEM);
|
||||||
stmt.AddValue(0, m_guildId);
|
stmt.AddValue(0, m_guildId);
|
||||||
stmt.AddValue(1, m_tabId);
|
stmt.AddValue(1, m_tabId);
|
||||||
stmt.AddValue(2, slotId);
|
stmt.AddValue(2, slotId);
|
||||||
@@ -3562,7 +3562,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
public void SaveToDB(ulong guildId)
|
public void SaveToDB(ulong guildId)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_EMBLEM_INFO);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GUILD_EMBLEM_INFO);
|
||||||
stmt.AddValue(0, m_style);
|
stmt.AddValue(0, m_style);
|
||||||
stmt.AddValue(1, m_color);
|
stmt.AddValue(1, m_color);
|
||||||
stmt.AddValue(2, m_borderStyle);
|
stmt.AddValue(2, m_borderStyle);
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ namespace Game
|
|||||||
// Delete orphan guild bank items
|
// Delete orphan guild bank items
|
||||||
DB.Characters.DirectExecute("DELETE gbi FROM guild_bank_item gbi LEFT JOIN guild g ON gbi.guildId = g.guildId WHERE g.guildId IS NULL");
|
DB.Characters.DirectExecute("DELETE gbi FROM guild_bank_item gbi LEFT JOIN guild g ON gbi.guildId = g.guildId WHERE g.guildId IS NULL");
|
||||||
|
|
||||||
SQLResult result = DB.Characters.Query(DB.Characters.GetPreparedStatement(CharStatements.SEL_GUILD_BANK_ITEMS));
|
SQLResult result = DB.Characters.Query(CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GUILD_BANK_ITEMS));
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty.");
|
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty.");
|
||||||
@@ -387,11 +387,11 @@ namespace Game
|
|||||||
|
|
||||||
foreach (var pair in GuildStore)
|
foreach (var pair in GuildStore)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GUILD_ACHIEVEMENT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GUILD_ACHIEVEMENT);
|
||||||
stmt.AddValue(0, pair.Key);
|
stmt.AddValue(0, pair.Key);
|
||||||
SQLResult achievementResult = DB.Characters.Query(stmt);
|
SQLResult achievementResult = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GUILD_ACHIEVEMENT_CRITERIA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GUILD_ACHIEVEMENT_CRITERIA);
|
||||||
stmt.AddValue(0, pair.Key);
|
stmt.AddValue(0, pair.Key);
|
||||||
SQLResult criteriaResult = DB.Characters.Query(stmt);
|
SQLResult criteriaResult = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ namespace Game
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_GUILD_REWARDS_REQ_ACHIEVEMENTS);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_GUILD_REWARDS_REQ_ACHIEVEMENTS);
|
||||||
stmt.AddValue(0, reward.ItemID);
|
stmt.AddValue(0, reward.ItemID);
|
||||||
SQLResult reqAchievementResult = DB.World.Query(stmt);
|
SQLResult reqAchievementResult = DB.World.Query(stmt);
|
||||||
if (!reqAchievementResult.IsEmpty())
|
if (!reqAchievementResult.IsEmpty())
|
||||||
@@ -478,7 +478,7 @@ namespace Game
|
|||||||
|
|
||||||
public void ResetTimes(bool week)
|
public void ResetTimes(bool week)
|
||||||
{
|
{
|
||||||
DB.Characters.Execute(DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_MEMBER_WITHDRAW));
|
DB.Characters.Execute(CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GUILD_MEMBER_WITHDRAW));
|
||||||
|
|
||||||
foreach (var guild in GuildStore.Values)
|
foreach (var guild in GuildStore.Values)
|
||||||
guild.ResetTimes(week);
|
guild.ResetTimes(week);
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ namespace Game
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// place bid
|
// place bid
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_AUCTION_BID);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_AUCTION_BID);
|
||||||
stmt.AddValue(0, auction.Bidder.GetCounter());
|
stmt.AddValue(0, auction.Bidder.GetCounter());
|
||||||
stmt.AddValue(1, auction.BidAmount);
|
stmt.AddValue(1, auction.BidAmount);
|
||||||
stmt.AddValue(2, (byte)auction.ServerFlags);
|
stmt.AddValue(2, (byte)auction.ServerFlags);
|
||||||
@@ -408,7 +408,7 @@ namespace Game
|
|||||||
auction.BidderHistory.Add(player.GetGUID());
|
auction.BidderHistory.Add(player.GetGUID());
|
||||||
if (auction.BidderHistory.Contains(player.GetGUID()))
|
if (auction.BidderHistory.Contains(player.GetGUID()))
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_AUCTION_BIDDER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_AUCTION_BIDDER);
|
||||||
stmt.AddValue(0, auction.Id);
|
stmt.AddValue(0, auction.Id);
|
||||||
stmt.AddValue(1, player.GetGUID().GetCounter());
|
stmt.AddValue(1, player.GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -531,7 +531,7 @@ namespace Game
|
|||||||
[WorldPacketHandler(ClientOpcodes.AuctionRequestFavoriteList)]
|
[WorldPacketHandler(ClientOpcodes.AuctionRequestFavoriteList)]
|
||||||
void HandleAuctionRequestFavoriteList(AuctionRequestFavoriteList requestFavoriteList)
|
void HandleAuctionRequestFavoriteList(AuctionRequestFavoriteList requestFavoriteList)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_FAVORITE_AUCTIONS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_FAVORITE_AUCTIONS);
|
||||||
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
||||||
GetQueryProcessor().AddCallback(DB.Characters.AsyncQuery(stmt)).WithCallback(favoriteAuctionResult =>
|
GetQueryProcessor().AddCallback(DB.Characters.AsyncQuery(stmt)).WithCallback(favoriteAuctionResult =>
|
||||||
{
|
{
|
||||||
@@ -926,14 +926,14 @@ namespace Game
|
|||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHARACTER_FAVORITE_AUCTION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHARACTER_FAVORITE_AUCTION);
|
||||||
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, setFavoriteItem.Item.Order);
|
stmt.AddValue(1, setFavoriteItem.Item.Order);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
if (!setFavoriteItem.IsNotFavorite)
|
if (!setFavoriteItem.IsNotFavorite)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_FAVORITE_AUCTION);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHARACTER_FAVORITE_AUCTION);
|
||||||
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, setFavoriteItem.Item.Order);
|
stmt.AddValue(1, setFavoriteItem.Item.Order);
|
||||||
stmt.AddValue(2, setFavoriteItem.Item.ItemID);
|
stmt.AddValue(2, setFavoriteItem.Item.ItemID);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Game
|
|||||||
void HandleCharEnum(EnumCharacters charEnum)
|
void HandleCharEnum(EnumCharacters charEnum)
|
||||||
{
|
{
|
||||||
// remove expired bans
|
// remove expired bans
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_EXPIRED_BANS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_EXPIRED_BANS);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
// get all the data necessary for loading all characters (along with their pets) on the account
|
// get all the data necessary for loading all characters (along with their pets) on the account
|
||||||
@@ -86,7 +86,7 @@ namespace Game
|
|||||||
|
|
||||||
if (charInfo.Flags2 != CharacterCustomizeFlags.Customize)
|
if (charInfo.Flags2 != CharacterCustomizeFlags.Customize)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||||
stmt.AddValue(0, (ushort)AtLoginFlags.Customize);
|
stmt.AddValue(0, (ushort)AtLoginFlags.Customize);
|
||||||
stmt.AddValue(1, charInfo.Guid.GetCounter());
|
stmt.AddValue(1, charInfo.Guid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -414,7 +414,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
CharacterCreateInfo createInfo = charCreate.CreateInfo;
|
CharacterCreateInfo createInfo = charCreate.CreateInfo;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
||||||
stmt.AddValue(0, charCreate.CreateInfo.Name);
|
stmt.AddValue(0, charCreate.CreateInfo.Name);
|
||||||
|
|
||||||
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithChainingCallback((queryCallback, result) =>
|
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithChainingCallback((queryCallback, result) =>
|
||||||
@@ -425,7 +425,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_SUM_REALM_CHARACTERS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_SUM_REALM_CHARACTERS);
|
||||||
stmt.AddValue(0, GetAccountId());
|
stmt.AddValue(0, GetAccountId());
|
||||||
queryCallback.SetNextQuery(DB.Login.AsyncQuery(stmt));
|
queryCallback.SetNextQuery(DB.Login.AsyncQuery(stmt));
|
||||||
|
|
||||||
@@ -441,7 +441,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_SUM_CHARS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_SUM_CHARS);
|
||||||
stmt.AddValue(0, GetAccountId());
|
stmt.AddValue(0, GetAccountId());
|
||||||
queryCallback.SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
queryCallback.SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
||||||
|
|
||||||
@@ -595,7 +595,7 @@ namespace Game
|
|||||||
newChar.SaveToDB(loginTransaction, characterTransaction, true);
|
newChar.SaveToDB(loginTransaction, characterTransaction, true);
|
||||||
createInfo.CharCount += 1;
|
createInfo.CharCount += 1;
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_REALM_CHARACTERS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.REP_REALM_CHARACTERS);
|
||||||
stmt.AddValue(0, createInfo.CharCount);
|
stmt.AddValue(0, createInfo.CharCount);
|
||||||
stmt.AddValue(1, GetAccountId());
|
stmt.AddValue(1, GetAccountId());
|
||||||
stmt.AddValue(2, Global.WorldMgr.GetRealm().Id.Index);
|
stmt.AddValue(2, Global.WorldMgr.GetRealm().Id.Index);
|
||||||
@@ -626,7 +626,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_CREATE_INFO);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_CREATE_INFO);
|
||||||
stmt.AddValue(0, GetAccountId());
|
stmt.AddValue(0, GetAccountId());
|
||||||
stmt.AddValue(1, (skipCinematics == 1 || createInfo.ClassId == Class.DemonHunter || createInfo.ClassId == Class.Evoker) ? 1200 : 1); // 200 (max chars per realm) + 1000 (max deleted chars per realm)
|
stmt.AddValue(1, (skipCinematics == 1 || createInfo.ClassId == Class.DemonHunter || createInfo.ClassId == Class.Evoker) ? 1200 : 1); // 200 (max chars per realm) + 1000 (max deleted chars per realm)
|
||||||
queryCallback.WithCallback(finalizeCharacterCreation).SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
queryCallback.WithCallback(finalizeCharacterCreation).SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
||||||
@@ -722,7 +722,7 @@ namespace Game
|
|||||||
|
|
||||||
foreach (var reorderInfo in reorderChars.Entries)
|
foreach (var reorderInfo in reorderChars.Entries)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_LIST_SLOT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_LIST_SLOT);
|
||||||
stmt.AddValue(0, reorderInfo.NewPosition);
|
stmt.AddValue(0, reorderInfo.NewPosition);
|
||||||
stmt.AddValue(1, reorderInfo.PlayerGUID.GetCounter());
|
stmt.AddValue(1, reorderInfo.PlayerGUID.GetCounter());
|
||||||
stmt.AddValue(2, GetAccountId());
|
stmt.AddValue(2, GetAccountId());
|
||||||
@@ -902,11 +902,11 @@ namespace Game
|
|||||||
|
|
||||||
pCurrChar.SendInitialPacketsAfterAddToMap();
|
pCurrChar.SendInitialPacketsAfterAddToMap();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_ONLINE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_ONLINE);
|
||||||
stmt.AddValue(0, pCurrChar.GetGUID().GetCounter());
|
stmt.AddValue(0, pCurrChar.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_ONLINE);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_ONLINE);
|
||||||
stmt.AddValue(0, GetAccountId());
|
stmt.AddValue(0, GetAccountId());
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
|
|
||||||
@@ -946,12 +946,12 @@ namespace Game
|
|||||||
if (pCurrChar.HasAtLoginFlag(AtLoginFlags.ResetPetTalents))
|
if (pCurrChar.HasAtLoginFlag(AtLoginFlags.ResetPetTalents))
|
||||||
{
|
{
|
||||||
// Delete all of the player's pet spells
|
// Delete all of the player's pet spells
|
||||||
PreparedStatement stmtSpells = DB.Characters.GetPreparedStatement(CharStatements.DEL_ALL_PET_SPELLS_BY_OWNER);
|
PreparedStatement stmtSpells = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ALL_PET_SPELLS_BY_OWNER);
|
||||||
stmtSpells.AddValue(0, pCurrChar.GetGUID().GetCounter());
|
stmtSpells.AddValue(0, pCurrChar.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmtSpells);
|
DB.Characters.Execute(stmtSpells);
|
||||||
|
|
||||||
// Then reset all of the player's pet specualizations
|
// Then reset all of the player's pet specualizations
|
||||||
PreparedStatement stmtSpec = DB.Characters.GetPreparedStatement(CharStatements.UPD_PET_SPECS_BY_OWNER);
|
PreparedStatement stmtSpec = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_PET_SPECS_BY_OWNER);
|
||||||
stmtSpec.AddValue(0, pCurrChar.GetGUID().GetCounter());
|
stmtSpec.AddValue(0, pCurrChar.GetGUID().GetCounter());
|
||||||
DB.Characters.Execute(stmtSpec);
|
DB.Characters.Execute(stmtSpec);
|
||||||
}
|
}
|
||||||
@@ -1228,7 +1228,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that there is no character with the desired new name
|
// Ensure that there is no character with the desired new name
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
||||||
stmt.AddValue(0, checkCharacterNameAvailability.Name);
|
stmt.AddValue(0, checkCharacterNameAvailability.Name);
|
||||||
|
|
||||||
var sequenceIndex = checkCharacterNameAvailability.SequenceIndex;
|
var sequenceIndex = checkCharacterNameAvailability.SequenceIndex;
|
||||||
@@ -1276,7 +1276,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that there is no character with the desired new name
|
// Ensure that there is no character with the desired new name
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_FREE_NAME);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_FREE_NAME);
|
||||||
stmt.AddValue(0, request.RenameInfo.Guid.GetCounter());
|
stmt.AddValue(0, request.RenameInfo.Guid.GetCounter());
|
||||||
stmt.AddValue(1, request.RenameInfo.NewName);
|
stmt.AddValue(1, request.RenameInfo.NewName);
|
||||||
|
|
||||||
@@ -1305,13 +1305,13 @@ namespace Game
|
|||||||
ulong lowGuid = renameInfo.Guid.GetCounter();
|
ulong lowGuid = renameInfo.Guid.GetCounter();
|
||||||
|
|
||||||
// Update name and at_login flag in the db
|
// Update name and at_login flag in the db
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
|
||||||
stmt.AddValue(0, renameInfo.NewName);
|
stmt.AddValue(0, renameInfo.NewName);
|
||||||
stmt.AddValue(1, (ushort)atLoginFlags);
|
stmt.AddValue(1, (ushort)atLoginFlags);
|
||||||
stmt.AddValue(2, lowGuid);
|
stmt.AddValue(2, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -1362,11 +1362,11 @@ namespace Game
|
|||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
|
||||||
stmt.AddValue(0, packet.Player.GetCounter());
|
stmt.AddValue(0, packet.Player.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_DECLINED_NAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_DECLINED_NAME);
|
||||||
stmt.AddValue(0, packet.Player.GetCounter());
|
stmt.AddValue(0, packet.Player.GetCounter());
|
||||||
|
|
||||||
for (byte i = 0; i < SharedConst.MaxDeclinedNameCases; i++)
|
for (byte i = 0; i < SharedConst.MaxDeclinedNameCases; i++)
|
||||||
@@ -1437,7 +1437,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_CUSTOMIZE_INFO);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_CUSTOMIZE_INFO);
|
||||||
stmt.AddValue(0, packet.CustomizeInfo.CharGUID.GetCounter());
|
stmt.AddValue(0, packet.CustomizeInfo.CharGUID.GetCounter());
|
||||||
|
|
||||||
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithCallback(HandleCharCustomizeCallback, packet.CustomizeInfo));
|
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithCallback(HandleCharCustomizeCallback, packet.CustomizeInfo));
|
||||||
@@ -1520,13 +1520,13 @@ namespace Game
|
|||||||
|
|
||||||
// Name Change and update atLogin flags
|
// Name Change and update atLogin flags
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
|
||||||
stmt.AddValue(0, customizeInfo.CharName);
|
stmt.AddValue(0, customizeInfo.CharName);
|
||||||
stmt.AddValue(1, (ushort)atLoginFlags);
|
stmt.AddValue(1, (ushort)atLoginFlags);
|
||||||
stmt.AddValue(2, lowGuid);
|
stmt.AddValue(2, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
|
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -1708,7 +1708,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_RACE_OR_FACTION_CHANGE_INFOS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_RACE_OR_FACTION_CHANGE_INFOS);
|
||||||
stmt.AddValue(0, packet.RaceOrFactionChangeInfo.Guid.GetCounter());
|
stmt.AddValue(0, packet.RaceOrFactionChangeInfo.Guid.GetCounter());
|
||||||
|
|
||||||
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithCallback(HandleCharRaceOrFactionChangeCallback, packet.RaceOrFactionChangeInfo));
|
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithCallback(HandleCharRaceOrFactionChangeCallback, packet.RaceOrFactionChangeInfo));
|
||||||
@@ -1830,14 +1830,14 @@ namespace Game
|
|||||||
|
|
||||||
// Name Change and update atLogin flags
|
// Name Change and update atLogin flags
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
|
||||||
stmt.AddValue(0, factionChangeInfo.Name);
|
stmt.AddValue(0, factionChangeInfo.Name);
|
||||||
stmt.AddValue(1, (ushort)((atLoginFlags | AtLoginFlags.Resurrect) & ~usedLoginFlag));
|
stmt.AddValue(1, (ushort)((atLoginFlags | AtLoginFlags.Resurrect) & ~usedLoginFlag));
|
||||||
stmt.AddValue(2, lowGuid);
|
stmt.AddValue(2, lowGuid);
|
||||||
|
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
|
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -1848,7 +1848,7 @@ namespace Game
|
|||||||
|
|
||||||
// Race Change
|
// Race Change
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_RACE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_RACE);
|
||||||
stmt.AddValue(0, (byte)factionChangeInfo.RaceID);
|
stmt.AddValue(0, (byte)factionChangeInfo.RaceID);
|
||||||
stmt.AddValue(1, (ushort)PlayerExtraFlags.HasRaceChanged);
|
stmt.AddValue(1, (ushort)PlayerExtraFlags.HasRaceChanged);
|
||||||
stmt.AddValue(2, lowGuid);
|
stmt.AddValue(2, lowGuid);
|
||||||
@@ -1862,12 +1862,12 @@ namespace Game
|
|||||||
{
|
{
|
||||||
// Switch Languages
|
// Switch Languages
|
||||||
// delete all languages first
|
// delete all languages first
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_SKILL_LANGUAGES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_SKILL_LANGUAGES);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
// Now add them back
|
// Now add them back
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_SKILL_LANGUAGE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_SKILL_LANGUAGE);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
|
|
||||||
// Faction specific languages
|
// Faction specific languages
|
||||||
@@ -1881,7 +1881,7 @@ namespace Game
|
|||||||
// Race specific languages
|
// Race specific languages
|
||||||
if (factionChangeInfo.RaceID != Race.Orc && factionChangeInfo.RaceID != Race.Human)
|
if (factionChangeInfo.RaceID != Race.Orc && factionChangeInfo.RaceID != Race.Human)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_SKILL_LANGUAGE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_SKILL_LANGUAGE);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
|
|
||||||
switch (factionChangeInfo.RaceID)
|
switch (factionChangeInfo.RaceID)
|
||||||
@@ -1935,7 +1935,7 @@ namespace Game
|
|||||||
if (factionChangeInfo.FactionChange)
|
if (factionChangeInfo.FactionChange)
|
||||||
{
|
{
|
||||||
// Delete all Flypaths
|
// Delete all Flypaths
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_TAXI_PATH);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_TAXI_PATH);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -1955,7 +1955,7 @@ namespace Game
|
|||||||
taximaskstream += (uint)(factionMask[i] | deathKnightExtraNode) + ' ';
|
taximaskstream += (uint)(factionMask[i] | deathKnightExtraNode) + ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_TAXIMASK);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_TAXIMASK);
|
||||||
stmt.AddValue(0, taximaskstream);
|
stmt.AddValue(0, taximaskstream);
|
||||||
stmt.AddValue(1, lowGuid);
|
stmt.AddValue(1, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -1974,21 +1974,21 @@ namespace Game
|
|||||||
if (!HasPermission(RBACPermissions.TwoSideAddFriend))
|
if (!HasPermission(RBACPermissions.TwoSideAddFriend))
|
||||||
{
|
{
|
||||||
// Delete Friend List
|
// Delete Friend List
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_SOCIAL_BY_GUID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_SOCIAL_BY_GUID);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_SOCIAL_BY_FRIEND);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_SOCIAL_BY_FRIEND);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset homebind and position
|
// Reset homebind and position
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PLAYER_HOMEBIND);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PLAYER_HOMEBIND);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PLAYER_HOMEBIND);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PLAYER_HOMEBIND);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
|
|
||||||
WorldLocation loc;
|
WorldLocation loc;
|
||||||
@@ -2019,12 +2019,12 @@ namespace Game
|
|||||||
uint achiev_alliance = it.Key;
|
uint achiev_alliance = it.Key;
|
||||||
uint achiev_horde = it.Value;
|
uint achiev_horde = it.Value;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT);
|
||||||
stmt.AddValue(0, (ushort)(newTeamId == TeamId.Alliance ? achiev_alliance : achiev_horde));
|
stmt.AddValue(0, (ushort)(newTeamId == TeamId.Alliance ? achiev_alliance : achiev_horde));
|
||||||
stmt.AddValue(1, lowGuid);
|
stmt.AddValue(1, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_ACHIEVEMENT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_ACHIEVEMENT);
|
||||||
stmt.AddValue(0, (ushort)(newTeamId == TeamId.Alliance ? achiev_alliance : achiev_horde));
|
stmt.AddValue(0, (ushort)(newTeamId == TeamId.Alliance ? achiev_alliance : achiev_horde));
|
||||||
stmt.AddValue(1, (ushort)(newTeamId == TeamId.Alliance ? achiev_horde : achiev_alliance));
|
stmt.AddValue(1, (ushort)(newTeamId == TeamId.Alliance ? achiev_horde : achiev_alliance));
|
||||||
stmt.AddValue(2, lowGuid);
|
stmt.AddValue(2, lowGuid);
|
||||||
@@ -2038,7 +2038,7 @@ namespace Game
|
|||||||
uint oldItemId = it.Key;
|
uint oldItemId = it.Key;
|
||||||
uint newItemId = it.Value;
|
uint newItemId = it.Value;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_INVENTORY_FACTION_CHANGE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_INVENTORY_FACTION_CHANGE);
|
||||||
stmt.AddValue(0, newItemId);
|
stmt.AddValue(0, newItemId);
|
||||||
stmt.AddValue(1, oldItemId);
|
stmt.AddValue(1, oldItemId);
|
||||||
stmt.AddValue(2, lowGuid);
|
stmt.AddValue(2, lowGuid);
|
||||||
@@ -2046,7 +2046,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete all current quests
|
// Delete all current quests
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -2056,12 +2056,12 @@ namespace Game
|
|||||||
uint quest_alliance = it.Key;
|
uint quest_alliance = it.Key;
|
||||||
uint quest_horde = it.Value;
|
uint quest_horde = it.Value;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
stmt.AddValue(1, (newTeamId == TeamId.Alliance ? quest_alliance : quest_horde));
|
stmt.AddValue(1, (newTeamId == TeamId.Alliance ? quest_alliance : quest_horde));
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_QUESTSTATUS_REWARDED_FACTION_CHANGE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_QUESTSTATUS_REWARDED_FACTION_CHANGE);
|
||||||
stmt.AddValue(0, (newTeamId == TeamId.Alliance ? quest_alliance : quest_horde));
|
stmt.AddValue(0, (newTeamId == TeamId.Alliance ? quest_alliance : quest_horde));
|
||||||
stmt.AddValue(1, (newTeamId == TeamId.Alliance ? quest_horde : quest_alliance));
|
stmt.AddValue(1, (newTeamId == TeamId.Alliance ? quest_horde : quest_alliance));
|
||||||
stmt.AddValue(2, lowGuid);
|
stmt.AddValue(2, lowGuid);
|
||||||
@@ -2069,7 +2069,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mark all rewarded quests as "active" (will count for completed quests achievements)
|
// Mark all rewarded quests as "active" (will count for completed quests achievements)
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_QUESTSTATUS_REWARDED_ACTIVE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_QUESTSTATUS_REWARDED_ACTIVE);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -2081,7 +2081,7 @@ namespace Game
|
|||||||
long newRaceMask = (long)(newTeamId == TeamId.Alliance ? SharedConst.RaceMaskAlliance : SharedConst.RaceMaskHorde);
|
long newRaceMask = (long)(newTeamId == TeamId.Alliance ? SharedConst.RaceMaskAlliance : SharedConst.RaceMaskHorde);
|
||||||
if (quest.AllowableRaces != -1 && !Convert.ToBoolean(quest.AllowableRaces & newRaceMask))
|
if (quest.AllowableRaces != -1 && !Convert.ToBoolean(quest.AllowableRaces & newRaceMask))
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_QUESTSTATUS_REWARDED_ACTIVE_BY_QUEST);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_QUESTSTATUS_REWARDED_ACTIVE_BY_QUEST);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
stmt.AddValue(1, quest.Id);
|
stmt.AddValue(1, quest.Id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -2095,12 +2095,12 @@ namespace Game
|
|||||||
uint spell_alliance = it.Key;
|
uint spell_alliance = it.Key;
|
||||||
uint spell_horde = it.Value;
|
uint spell_horde = it.Value;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_SPELL_BY_SPELL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_SPELL_BY_SPELL);
|
||||||
stmt.AddValue(0, (newTeamId == TeamId.Alliance ? spell_alliance : spell_horde));
|
stmt.AddValue(0, (newTeamId == TeamId.Alliance ? spell_alliance : spell_horde));
|
||||||
stmt.AddValue(1, lowGuid);
|
stmt.AddValue(1, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_SPELL_FACTION_CHANGE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_SPELL_FACTION_CHANGE);
|
||||||
stmt.AddValue(0, (newTeamId == TeamId.Alliance ? spell_alliance : spell_horde));
|
stmt.AddValue(0, (newTeamId == TeamId.Alliance ? spell_alliance : spell_horde));
|
||||||
stmt.AddValue(1, (newTeamId == TeamId.Alliance ? spell_horde : spell_alliance));
|
stmt.AddValue(1, (newTeamId == TeamId.Alliance ? spell_horde : spell_alliance));
|
||||||
stmt.AddValue(2, lowGuid);
|
stmt.AddValue(2, lowGuid);
|
||||||
@@ -2116,7 +2116,7 @@ namespace Game
|
|||||||
uint oldReputation = (newTeamId == TeamId.Alliance) ? reputation_horde : reputation_alliance;
|
uint oldReputation = (newTeamId == TeamId.Alliance) ? reputation_horde : reputation_alliance;
|
||||||
|
|
||||||
// select old standing set in db
|
// select old standing set in db
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_REP_BY_FACTION);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_REP_BY_FACTION);
|
||||||
stmt.AddValue(0, oldReputation);
|
stmt.AddValue(0, oldReputation);
|
||||||
stmt.AddValue(1, lowGuid);
|
stmt.AddValue(1, lowGuid);
|
||||||
|
|
||||||
@@ -2136,12 +2136,12 @@ namespace Game
|
|||||||
int FinalRep = oldDBRep + oldBaseRep;
|
int FinalRep = oldDBRep + oldBaseRep;
|
||||||
int newDBRep = FinalRep - newBaseRep;
|
int newDBRep = FinalRep - newBaseRep;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_REP_BY_FACTION);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_REP_BY_FACTION);
|
||||||
stmt.AddValue(0, newReputation);
|
stmt.AddValue(0, newReputation);
|
||||||
stmt.AddValue(1, lowGuid);
|
stmt.AddValue(1, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_REP_FACTION_CHANGE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_REP_FACTION_CHANGE);
|
||||||
stmt.AddValue(0, (ushort)newReputation);
|
stmt.AddValue(0, (ushort)newReputation);
|
||||||
stmt.AddValue(1, newDBRep);
|
stmt.AddValue(1, newDBRep);
|
||||||
stmt.AddValue(2, (ushort)oldReputation);
|
stmt.AddValue(2, (ushort)oldReputation);
|
||||||
@@ -2207,13 +2207,13 @@ namespace Game
|
|||||||
for (int index = 0; index < knownTitles.Count; ++index)
|
for (int index = 0; index < knownTitles.Count; ++index)
|
||||||
ss += knownTitles[index] + ' ';
|
ss += knownTitles[index] + ' ';
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_TITLES_FACTION_CHANGE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_TITLES_FACTION_CHANGE);
|
||||||
stmt.AddValue(0, ss);
|
stmt.AddValue(0, ss);
|
||||||
stmt.AddValue(1, lowGuid);
|
stmt.AddValue(1, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
// unset any currently chosen title
|
// unset any currently chosen title
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.RES_CHAR_TITLES_FACTION_CHANGE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.RES_CHAR_TITLES_FACTION_CHANGE);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
}
|
}
|
||||||
@@ -2249,7 +2249,7 @@ namespace Game
|
|||||||
[WorldPacketHandler(ClientOpcodes.GetUndeleteCharacterCooldownStatus, Status = SessionStatus.Authed)]
|
[WorldPacketHandler(ClientOpcodes.GetUndeleteCharacterCooldownStatus, Status = SessionStatus.Authed)]
|
||||||
void HandleGetUndeleteCooldownStatus(GetUndeleteCharacterCooldownStatus getCooldown)
|
void HandleGetUndeleteCooldownStatus(GetUndeleteCharacterCooldownStatus getCooldown)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_LAST_CHAR_UNDELETE);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_LAST_CHAR_UNDELETE);
|
||||||
stmt.AddValue(0, GetBattlenetAccountId());
|
stmt.AddValue(0, GetBattlenetAccountId());
|
||||||
|
|
||||||
_queryProcessor.AddCallback(DB.Login.AsyncQuery(stmt).WithCallback(HandleUndeleteCooldownStatusCallback));
|
_queryProcessor.AddCallback(DB.Login.AsyncQuery(stmt).WithCallback(HandleUndeleteCooldownStatusCallback));
|
||||||
@@ -2279,7 +2279,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_LAST_CHAR_UNDELETE);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_LAST_CHAR_UNDELETE);
|
||||||
stmt.AddValue(0, GetBattlenetAccountId());
|
stmt.AddValue(0, GetBattlenetAccountId());
|
||||||
|
|
||||||
CharacterUndeleteInfo undeleteInfo = undeleteCharacter.UndeleteInfo;
|
CharacterUndeleteInfo undeleteInfo = undeleteCharacter.UndeleteInfo;
|
||||||
@@ -2296,7 +2296,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_DEL_INFO_BY_GUID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_DEL_INFO_BY_GUID);
|
||||||
stmt.AddValue(0, undeleteInfo.CharacterGuid.GetCounter());
|
stmt.AddValue(0, undeleteInfo.CharacterGuid.GetCounter());
|
||||||
queryCallback.SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
queryCallback.SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
||||||
}).WithChainingCallback((queryCallback, result) =>
|
}).WithChainingCallback((queryCallback, result) =>
|
||||||
@@ -2315,7 +2315,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
||||||
stmt.AddValue(0, undeleteInfo.Name);
|
stmt.AddValue(0, undeleteInfo.Name);
|
||||||
queryCallback.SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
queryCallback.SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
||||||
}).WithChainingCallback((queryCallback, result) =>
|
}).WithChainingCallback((queryCallback, result) =>
|
||||||
@@ -2332,7 +2332,7 @@ namespace Game
|
|||||||
// * max demon hunter count
|
// * max demon hunter count
|
||||||
// * team violation
|
// * team violation
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_SUM_CHARS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_SUM_CHARS);
|
||||||
stmt.AddValue(0, GetAccountId());
|
stmt.AddValue(0, GetAccountId());
|
||||||
queryCallback.SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
queryCallback.SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
||||||
}).WithCallback(result =>
|
}).WithCallback(result =>
|
||||||
@@ -2346,13 +2346,13 @@ namespace Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_RESTORE_DELETE_INFO);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_RESTORE_DELETE_INFO);
|
||||||
stmt.AddValue(0, undeleteInfo.Name);
|
stmt.AddValue(0, undeleteInfo.Name);
|
||||||
stmt.AddValue(1, GetAccountId());
|
stmt.AddValue(1, GetAccountId());
|
||||||
stmt.AddValue(2, undeleteInfo.CharacterGuid.GetCounter());
|
stmt.AddValue(2, undeleteInfo.CharacterGuid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_LAST_CHAR_UNDELETE);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_LAST_CHAR_UNDELETE);
|
||||||
stmt.AddValue(0, GetBattlenetAccountId());
|
stmt.AddValue(0, GetBattlenetAccountId());
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
|
|
||||||
@@ -2615,258 +2615,258 @@ namespace Game
|
|||||||
{
|
{
|
||||||
ulong lowGuid = m_guid.GetCounter();
|
ulong lowGuid = m_guid.GetCounter();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.From, stmt);
|
SetQuery(PlayerLoginQueryLoad.From, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_CUSTOMIZATIONS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_CUSTOMIZATIONS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Customizations, stmt);
|
SetQuery(PlayerLoginQueryLoad.Customizations, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GROUP_MEMBER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GROUP_MEMBER);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Group, stmt);
|
SetQuery(PlayerLoginQueryLoad.Group, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_AURAS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_AURAS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Auras, stmt);
|
SetQuery(PlayerLoginQueryLoad.Auras, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_AURA_EFFECTS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_AURA_EFFECTS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.AuraEffects, stmt);
|
SetQuery(PlayerLoginQueryLoad.AuraEffects, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_AURA_STORED_LOCATIONS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_AURA_STORED_LOCATIONS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.AuraStoredLocations, stmt);
|
SetQuery(PlayerLoginQueryLoad.AuraStoredLocations, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_SPELL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_SPELL);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Spells, stmt);
|
SetQuery(PlayerLoginQueryLoad.Spells, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_SPELL_FAVORITES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_SPELL_FAVORITES);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.SpellFavorites, stmt);
|
SetQuery(PlayerLoginQueryLoad.SpellFavorites, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.QuestStatus, stmt);
|
SetQuery(PlayerLoginQueryLoad.QuestStatus, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_OBJECTIVES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_OBJECTIVES);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.QuestStatusObjectives, stmt);
|
SetQuery(PlayerLoginQueryLoad.QuestStatusObjectives, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.QuestStatusObjectivesCriteria, stmt);
|
SetQuery(PlayerLoginQueryLoad.QuestStatusObjectivesCriteria, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_OBJECTIVES_CRITERIA_PROGRESS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_OBJECTIVES_CRITERIA_PROGRESS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.QuestStatusObjectivesCriteriaProgress, stmt);
|
SetQuery(PlayerLoginQueryLoad.QuestStatusObjectivesCriteriaProgress, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_DAILY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_DAILY);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.DailyQuestStatus, stmt);
|
SetQuery(PlayerLoginQueryLoad.DailyQuestStatus, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_WEEKLY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_WEEKLY);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.WeeklyQuestStatus, stmt);
|
SetQuery(PlayerLoginQueryLoad.WeeklyQuestStatus, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_MONTHLY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_MONTHLY);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.MonthlyQuestStatus, stmt);
|
SetQuery(PlayerLoginQueryLoad.MonthlyQuestStatus, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_SEASONAL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_SEASONAL);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.SeasonalQuestStatus, stmt);
|
SetQuery(PlayerLoginQueryLoad.SeasonalQuestStatus, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_REPUTATION);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_REPUTATION);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Reputation, stmt);
|
SetQuery(PlayerLoginQueryLoad.Reputation, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_INVENTORY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_INVENTORY);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Inventory, stmt);
|
SetQuery(PlayerLoginQueryLoad.Inventory, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_ITEM_INSTANCE_ARTIFACT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_ITEM_INSTANCE_ARTIFACT);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Artifacts, stmt);
|
SetQuery(PlayerLoginQueryLoad.Artifacts, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_ITEM_INSTANCE_AZERITE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_ITEM_INSTANCE_AZERITE);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Azerite, stmt);
|
SetQuery(PlayerLoginQueryLoad.Azerite, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_ITEM_INSTANCE_AZERITE_MILESTONE_POWER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_ITEM_INSTANCE_AZERITE_MILESTONE_POWER);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.AzeriteMilestonePowers, stmt);
|
SetQuery(PlayerLoginQueryLoad.AzeriteMilestonePowers, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_ITEM_INSTANCE_AZERITE_UNLOCKED_ESSENCE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_ITEM_INSTANCE_AZERITE_UNLOCKED_ESSENCE);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.AzeriteUnlockedEssences, stmt);
|
SetQuery(PlayerLoginQueryLoad.AzeriteUnlockedEssences, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_ITEM_INSTANCE_AZERITE_EMPOWERED);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_ITEM_INSTANCE_AZERITE_EMPOWERED);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.AzeriteEmpowered, stmt);
|
SetQuery(PlayerLoginQueryLoad.AzeriteEmpowered, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_VOID_STORAGE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_VOID_STORAGE);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.VoidStorage, stmt);
|
SetQuery(PlayerLoginQueryLoad.VoidStorage, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAIL);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAIL);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Mails, stmt);
|
SetQuery(PlayerLoginQueryLoad.Mails, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAILITEMS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.MailItems, stmt);
|
SetQuery(PlayerLoginQueryLoad.MailItems, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_ARTIFACT);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAILITEMS_ARTIFACT);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.MailItemsArtifact, stmt);
|
SetQuery(PlayerLoginQueryLoad.MailItemsArtifact, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.MailItemsAzerite, stmt);
|
SetQuery(PlayerLoginQueryLoad.MailItemsAzerite, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_MILESTONE_POWER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_MILESTONE_POWER);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.MailItemsAzeriteMilestonePower, stmt);
|
SetQuery(PlayerLoginQueryLoad.MailItemsAzeriteMilestonePower, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_UNLOCKED_ESSENCE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_UNLOCKED_ESSENCE);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.MailItemsAzeriteUnlockedEssence, stmt);
|
SetQuery(PlayerLoginQueryLoad.MailItemsAzeriteUnlockedEssence, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_EMPOWERED);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_EMPOWERED);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.MailItemsAzeriteEmpowered, stmt);
|
SetQuery(PlayerLoginQueryLoad.MailItemsAzeriteEmpowered, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_SOCIALLIST);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_SOCIALLIST);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.SocialList, stmt);
|
SetQuery(PlayerLoginQueryLoad.SocialList, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_HOMEBIND);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_HOMEBIND);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.HomeBind, stmt);
|
SetQuery(PlayerLoginQueryLoad.HomeBind, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_SPELLCOOLDOWNS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_SPELLCOOLDOWNS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.SpellCooldowns, stmt);
|
SetQuery(PlayerLoginQueryLoad.SpellCooldowns, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_SPELL_CHARGES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_SPELL_CHARGES);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.SpellCharges, stmt);
|
SetQuery(PlayerLoginQueryLoad.SpellCharges, stmt);
|
||||||
|
|
||||||
if (WorldConfig.GetBoolValue(WorldCfg.DeclinedNamesUsed))
|
if (WorldConfig.GetBoolValue(WorldCfg.DeclinedNamesUsed))
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_DECLINEDNAMES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_DECLINEDNAMES);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.DeclinedNames, stmt);
|
SetQuery(PlayerLoginQueryLoad.DeclinedNames, stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GUILD_MEMBER);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GUILD_MEMBER);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Guild, stmt);
|
SetQuery(PlayerLoginQueryLoad.Guild, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_ARENAINFO);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_ARENAINFO);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.ArenaInfo, stmt);
|
SetQuery(PlayerLoginQueryLoad.ArenaInfo, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_ACHIEVEMENTS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_ACHIEVEMENTS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Achievements, stmt);
|
SetQuery(PlayerLoginQueryLoad.Achievements, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_CRITERIAPROGRESS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_CRITERIAPROGRESS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.CriteriaProgress, stmt);
|
SetQuery(PlayerLoginQueryLoad.CriteriaProgress, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_EQUIPMENTSETS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_EQUIPMENTSETS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.EquipmentSets, stmt);
|
SetQuery(PlayerLoginQueryLoad.EquipmentSets, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_TRANSMOG_OUTFITS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_TRANSMOG_OUTFITS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.TransmogOutfits, stmt);
|
SetQuery(PlayerLoginQueryLoad.TransmogOutfits, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_CUF_PROFILES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_CUF_PROFILES);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.CufProfiles, stmt);
|
SetQuery(PlayerLoginQueryLoad.CufProfiles, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_BGDATA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_BGDATA);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.BgData, stmt);
|
SetQuery(PlayerLoginQueryLoad.BgData, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_GLYPHS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_GLYPHS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Glyphs, stmt);
|
SetQuery(PlayerLoginQueryLoad.Glyphs, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_TALENTS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_TALENTS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Talents, stmt);
|
SetQuery(PlayerLoginQueryLoad.Talents, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_PVP_TALENTS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_PVP_TALENTS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.PvpTalents, stmt);
|
SetQuery(PlayerLoginQueryLoad.PvpTalents, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PLAYER_ACCOUNT_DATA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PLAYER_ACCOUNT_DATA);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.AccountData, stmt);
|
SetQuery(PlayerLoginQueryLoad.AccountData, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_SKILLS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_SKILLS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Skills, stmt);
|
SetQuery(PlayerLoginQueryLoad.Skills, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_RANDOMBG);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_RANDOMBG);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.RandomBg, stmt);
|
SetQuery(PlayerLoginQueryLoad.RandomBg, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_BANNED);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_BANNED);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Banned, stmt);
|
SetQuery(PlayerLoginQueryLoad.Banned, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUSREW);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUSREW);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.QuestStatusRew, stmt);
|
SetQuery(PlayerLoginQueryLoad.QuestStatusRew, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_ACCOUNT_INSTANCELOCKTIMES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_ACCOUNT_INSTANCELOCKTIMES);
|
||||||
stmt.AddValue(0, m_accountId);
|
stmt.AddValue(0, m_accountId);
|
||||||
SetQuery(PlayerLoginQueryLoad.InstanceLockTimes, stmt);
|
SetQuery(PlayerLoginQueryLoad.InstanceLockTimes, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PLAYER_CURRENCY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_PLAYER_CURRENCY);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Currency, stmt);
|
SetQuery(PlayerLoginQueryLoad.Currency, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CORPSE_LOCATION);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CORPSE_LOCATION);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.CorpseLocation, stmt);
|
SetQuery(PlayerLoginQueryLoad.CorpseLocation, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_PETS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_PETS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.PetSlots, stmt);
|
SetQuery(PlayerLoginQueryLoad.PetSlots, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_GARRISON);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_GARRISON);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.Garrison, stmt);
|
SetQuery(PlayerLoginQueryLoad.Garrison, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_GARRISON_BLUEPRINTS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_GARRISON_BLUEPRINTS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.GarrisonBlueprints, stmt);
|
SetQuery(PlayerLoginQueryLoad.GarrisonBlueprints, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_GARRISON_BUILDINGS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_GARRISON_BUILDINGS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.GarrisonBuildings, stmt);
|
SetQuery(PlayerLoginQueryLoad.GarrisonBuildings, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_GARRISON_FOLLOWERS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_GARRISON_FOLLOWERS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.GarrisonFollowers, stmt);
|
SetQuery(PlayerLoginQueryLoad.GarrisonFollowers, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_GARRISON_FOLLOWER_ABILITIES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_GARRISON_FOLLOWER_ABILITIES);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.GarrisonFollowerAbilities, stmt);
|
SetQuery(PlayerLoginQueryLoad.GarrisonFollowerAbilities, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_TRAIT_ENTRIES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_TRAIT_ENTRIES);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.TraitEntries, stmt);
|
SetQuery(PlayerLoginQueryLoad.TraitEntries, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_TRAIT_CONFIGS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHAR_TRAIT_CONFIGS);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
SetQuery(PlayerLoginQueryLoad.TraitConfigs, stmt);
|
SetQuery(PlayerLoginQueryLoad.TraitConfigs, stmt);
|
||||||
}
|
}
|
||||||
@@ -2892,11 +2892,11 @@ namespace Game
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool result = true;
|
bool result = true;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(statements[isDeletedCharacters ? 1 : 0][withDeclinedNames ? 1 : 0]);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(statements[isDeletedCharacters ? 1 : 0][withDeclinedNames ? 1 : 0]);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SetQuery(EnumCharacterQueryLoad.Characters, stmt);
|
SetQuery(EnumCharacterQueryLoad.Characters, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(statements[isDeletedCharacters ? 1 : 0][2]);
|
stmt = CharacterDatabase.GetPreparedStatement(statements[isDeletedCharacters ? 1 : 0][2]);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SetQuery(EnumCharacterQueryLoad.Customizations, stmt);
|
SetQuery(EnumCharacterQueryLoad.Customizations, stmt);
|
||||||
|
|
||||||
|
|||||||
@@ -711,7 +711,7 @@ namespace Game
|
|||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_GIFT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_GIFT);
|
||||||
stmt.AddValue(0, item.GetOwnerGUID().GetCounter());
|
stmt.AddValue(0, item.GetOwnerGUID().GetCounter());
|
||||||
stmt.AddValue(1, item.GetGUID().GetCounter());
|
stmt.AddValue(1, item.GetGUID().GetCounter());
|
||||||
stmt.AddValue(2, item.GetEntry());
|
stmt.AddValue(2, item.GetEntry());
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAIL_COUNT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_MAIL_COUNT);
|
||||||
stmt.AddValue(0, receiverGuid.GetCounter());
|
stmt.AddValue(0, receiverGuid.GetCounter());
|
||||||
|
|
||||||
GetQueryProcessor().AddCallback(DB.Characters.AsyncQuery(stmt).WithChainingCallback((queryCallback, mailCountResult) =>
|
GetQueryProcessor().AddCallback(DB.Characters.AsyncQuery(stmt).WithChainingCallback((queryCallback, mailCountResult) =>
|
||||||
@@ -366,11 +366,11 @@ namespace Game
|
|||||||
//we can return mail now, so firstly delete the old one
|
//we can return mail now, so firstly delete the old one
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_MAIL_BY_ID);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_MAIL_BY_ID);
|
||||||
stmt.AddValue(0, returnToSender.MailID);
|
stmt.AddValue(0, returnToSender.MailID);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_MAIL_ITEM_BY_ID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_MAIL_ITEM_BY_ID);
|
||||||
stmt.AddValue(0, returnToSender.MailID);
|
stmt.AddValue(0, returnToSender.MailID);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ namespace Game
|
|||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_PET_SLOT_BY_ID);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_PET_SLOT_BY_ID);
|
||||||
stmt.AddValue(0, (short)dstPetSlot);
|
stmt.AddValue(0, (short)dstPetSlot);
|
||||||
stmt.AddValue(1, _player.GetGUID().GetCounter());
|
stmt.AddValue(1, _player.GetGUID().GetCounter());
|
||||||
stmt.AddValue(2, srcPet.PetNumber);
|
stmt.AddValue(2, srcPet.PetNumber);
|
||||||
@@ -510,7 +510,7 @@ namespace Game
|
|||||||
|
|
||||||
if (dstPet != null)
|
if (dstPet != null)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_PET_SLOT_BY_ID);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_PET_SLOT_BY_ID);
|
||||||
stmt.AddValue(0, (short)srcPetSlot);
|
stmt.AddValue(0, (short)srcPetSlot);
|
||||||
stmt.AddValue(1, _player.GetGUID().GetCounter());
|
stmt.AddValue(1, _player.GetGUID().GetCounter());
|
||||||
stmt.AddValue(2, dstPet.PetNumber);
|
stmt.AddValue(2, dstPet.PetNumber);
|
||||||
|
|||||||
@@ -554,11 +554,11 @@ namespace Game
|
|||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
if (isdeclined)
|
if (isdeclined)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_PET_DECLINEDNAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_PET_DECLINEDNAME);
|
||||||
stmt.AddValue(0, pet.GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, pet.GetCharmInfo().GetPetNumber());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_PET_DECLINEDNAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_PET_DECLINEDNAME);
|
||||||
stmt.AddValue(0, pet.GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, pet.GetCharmInfo().GetPetNumber());
|
||||||
stmt.AddValue(1, GetPlayer().GetGUID().ToString());
|
stmt.AddValue(1, GetPlayer().GetGUID().ToString());
|
||||||
|
|
||||||
@@ -568,7 +568,7 @@ namespace Game
|
|||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_PET_NAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_PET_NAME);
|
||||||
stmt.AddValue(0, name);
|
stmt.AddValue(0, name);
|
||||||
stmt.AddValue(1, GetPlayer().GetGUID().ToString());
|
stmt.AddValue(1, GetPlayer().GetGUID().ToString());
|
||||||
stmt.AddValue(2, pet.GetCharmInfo().GetPetNumber());
|
stmt.AddValue(2, pet.GetCharmInfo().GetPetNumber());
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_WHOIS);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_WHOIS);
|
||||||
stmt.AddValue(0, player.GetSession().GetAccountId());
|
stmt.AddValue(0, player.GetSession().GetAccountId());
|
||||||
|
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ namespace Game
|
|||||||
|
|
||||||
if (item.IsWrapped())// wrapped?
|
if (item.IsWrapped())// wrapped?
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_GIFT_BY_ITEM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_GIFT_BY_ITEM);
|
||||||
stmt.AddValue(0, item.GetGUID().GetCounter());
|
stmt.AddValue(0, item.GetGUID().GetCounter());
|
||||||
|
|
||||||
var pos = item.GetPos();
|
var pos = item.GetPos();
|
||||||
@@ -237,7 +237,7 @@ namespace Game
|
|||||||
|
|
||||||
GetPlayer().SaveInventoryAndGoldToDB(trans);
|
GetPlayer().SaveInventoryAndGoldToDB(trans);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GIFT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GIFT);
|
||||||
stmt.AddValue(0, itemGuid.GetCounter());
|
stmt.AddValue(0, itemGuid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace Game
|
|||||||
if (!Global.SupportMgr.GetBugSystemStatus())
|
if (!Global.SupportMgr.GetBugSystemStatus())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_BUG_REPORT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_BUG_REPORT);
|
||||||
stmt.AddValue(0, bugReport.Text);
|
stmt.AddValue(0, bugReport.Text);
|
||||||
stmt.AddValue(1, bugReport.DiagInfo);
|
stmt.AddValue(1, bugReport.DiagInfo);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace Game.Loots
|
|||||||
_lootItemStorage.Clear();
|
_lootItemStorage.Clear();
|
||||||
uint count = 0;
|
uint count = 0;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_ITEMCONTAINER_ITEMS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_ITEMCONTAINER_ITEMS);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
@@ -60,7 +60,7 @@ namespace Game.Loots
|
|||||||
else
|
else
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 stored item loots");
|
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 stored item loots");
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_ITEMCONTAINER_MONEY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_ITEMCONTAINER_MONEY);
|
||||||
result = DB.Characters.Query(stmt);
|
result = DB.Characters.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
@@ -146,11 +146,11 @@ namespace Game.Loots
|
|||||||
_lootItemStorage.TryRemove(containerId, out _);
|
_lootItemStorage.TryRemove(containerId, out _);
|
||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_ITEMS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_ITEMS);
|
||||||
stmt.AddValue(0, containerId);
|
stmt.AddValue(0, containerId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_MONEY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_MONEY);
|
||||||
stmt.AddValue(0, containerId);
|
stmt.AddValue(0, containerId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ namespace Game.Loots
|
|||||||
if (loot.gold != 0)
|
if (loot.gold != 0)
|
||||||
container.AddMoney(loot.gold, trans);
|
container.AddMoney(loot.gold, trans);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_ITEMS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_ITEMS);
|
||||||
stmt.AddValue(0, containerId);
|
stmt.AddValue(0, containerId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ namespace Game.Loots
|
|||||||
if (trans == null)
|
if (trans == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEMCONTAINER_ITEMS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEMCONTAINER_ITEMS);
|
||||||
|
|
||||||
// container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix
|
// container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix
|
||||||
stmt.AddValue(0, _containerId);
|
stmt.AddValue(0, _containerId);
|
||||||
@@ -256,11 +256,11 @@ namespace Game.Loots
|
|||||||
if (trans == null)
|
if (trans == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_MONEY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_MONEY);
|
||||||
stmt.AddValue(0, _containerId);
|
stmt.AddValue(0, _containerId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEMCONTAINER_MONEY);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_ITEMCONTAINER_MONEY);
|
||||||
stmt.AddValue(0, _containerId);
|
stmt.AddValue(0, _containerId);
|
||||||
stmt.AddValue(1, _money);
|
stmt.AddValue(1, _money);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -270,7 +270,7 @@ namespace Game.Loots
|
|||||||
{
|
{
|
||||||
_money = 0;
|
_money = 0;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_MONEY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_MONEY);
|
||||||
stmt.AddValue(0, _containerId);
|
stmt.AddValue(0, _containerId);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
@@ -288,7 +288,7 @@ namespace Game.Loots
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Deletes a single item associated with an openable item from the DB
|
// Deletes a single item associated with an openable item from the DB
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_ITEM);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_ITEM);
|
||||||
stmt.AddValue(0, _containerId);
|
stmt.AddValue(0, _containerId);
|
||||||
stmt.AddValue(1, itemId);
|
stmt.AddValue(1, itemId);
|
||||||
stmt.AddValue(2, count);
|
stmt.AddValue(2, count);
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace Game.Mails
|
|||||||
{
|
{
|
||||||
item.SaveToDB(trans); // item not in inventory and can be save standalone
|
item.SaveToDB(trans); // item not in inventory and can be save standalone
|
||||||
// owner in data will set at mail receive and item extracting
|
// owner in data will set at mail receive and item extracting
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ITEM_OWNER);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ITEM_OWNER);
|
||||||
stmt.AddValue(0, receiver_guid);
|
stmt.AddValue(0, receiver_guid);
|
||||||
stmt.AddValue(1, item.GetGUID().GetCounter());
|
stmt.AddValue(1, item.GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -152,7 +152,7 @@ namespace Game.Mails
|
|||||||
|
|
||||||
// Add to DB
|
// Add to DB
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_MAIL);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_MAIL);
|
||||||
stmt.AddValue(index, mailId);
|
stmt.AddValue(index, mailId);
|
||||||
stmt.AddValue(++index, (byte)sender.GetMailMessageType());
|
stmt.AddValue(++index, (byte)sender.GetMailMessageType());
|
||||||
stmt.AddValue(++index, (sbyte)sender.GetStationery());
|
stmt.AddValue(++index, (sbyte)sender.GetStationery());
|
||||||
@@ -171,7 +171,7 @@ namespace Game.Mails
|
|||||||
|
|
||||||
foreach (var item in m_items.Values)
|
foreach (var item in m_items.Values)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_MAIL_ITEM);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_MAIL_ITEM);
|
||||||
stmt.AddValue(0, mailId);
|
stmt.AddValue(0, mailId);
|
||||||
stmt.AddValue(1, item.GetGUID().GetCounter());
|
stmt.AddValue(1, item.GetGUID().GetCounter());
|
||||||
stmt.AddValue(2, receiver.GetPlayerGUIDLow());
|
stmt.AddValue(2, receiver.GetPlayerGUIDLow());
|
||||||
|
|||||||
@@ -270,13 +270,13 @@ namespace Game.Maps
|
|||||||
$"{entries.MapDifficulty.DifficultyID}-{CliDB.DifficultyStorage.LookupByKey(entries.MapDifficulty.DifficultyID).Name}] Expired instance lock for {playerGuid} in instance {updateEvent.InstanceId} is now active");
|
$"{entries.MapDifficulty.DifficultyID}-{CliDB.DifficultyStorage.LookupByKey(entries.MapDifficulty.DifficultyID).Name}] Expired instance lock for {playerGuid} in instance {updateEvent.InstanceId} is now active");
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHARACTER_INSTANCE_LOCK);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHARACTER_INSTANCE_LOCK);
|
||||||
stmt.AddValue(0, playerGuid.GetCounter());
|
stmt.AddValue(0, playerGuid.GetCounter());
|
||||||
stmt.AddValue(1, entries.MapDifficulty.MapID);
|
stmt.AddValue(1, entries.MapDifficulty.MapID);
|
||||||
stmt.AddValue(2, entries.MapDifficulty.LockID);
|
stmt.AddValue(2, entries.MapDifficulty.LockID);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_INSTANCE_LOCK);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHARACTER_INSTANCE_LOCK);
|
||||||
stmt.AddValue(0, playerGuid.GetCounter());
|
stmt.AddValue(0, playerGuid.GetCounter());
|
||||||
stmt.AddValue(1, entries.MapDifficulty.MapID);
|
stmt.AddValue(1, entries.MapDifficulty.MapID);
|
||||||
stmt.AddValue(2, entries.MapDifficulty.LockID);
|
stmt.AddValue(2, entries.MapDifficulty.LockID);
|
||||||
@@ -308,11 +308,11 @@ namespace Game.Maps
|
|||||||
if (updateEvent.EntranceWorldSafeLocId.HasValue)
|
if (updateEvent.EntranceWorldSafeLocId.HasValue)
|
||||||
sharedData.EntranceWorldSafeLocId = updateEvent.EntranceWorldSafeLocId.Value;
|
sharedData.EntranceWorldSafeLocId = updateEvent.EntranceWorldSafeLocId.Value;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_INSTANCE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_INSTANCE);
|
||||||
stmt.AddValue(0, sharedData.InstanceId);
|
stmt.AddValue(0, sharedData.InstanceId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_INSTANCE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_INSTANCE);
|
||||||
stmt.AddValue(0, sharedData.InstanceId);
|
stmt.AddValue(0, sharedData.InstanceId);
|
||||||
stmt.AddValue(1, sharedData.Data);
|
stmt.AddValue(1, sharedData.Data);
|
||||||
stmt.AddValue(2, sharedData.CompletedEncountersMask);
|
stmt.AddValue(2, sharedData.CompletedEncountersMask);
|
||||||
@@ -326,7 +326,7 @@ namespace Game.Maps
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_instanceLockDataById.Remove(instanceId);
|
_instanceLockDataById.Remove(instanceId);
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_INSTANCE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_INSTANCE);
|
||||||
stmt.AddValue(0, instanceId);
|
stmt.AddValue(0, instanceId);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
Log.outDebug(LogFilter.Instance, $"Deleting instance {instanceId} as it is no longer referenced by any player");
|
Log.outDebug(LogFilter.Instance, $"Deleting instance {instanceId} as it is no longer referenced by any player");
|
||||||
@@ -339,7 +339,7 @@ namespace Game.Maps
|
|||||||
{
|
{
|
||||||
DateTime oldExpiryTime = instanceLock.GetEffectiveExpiryTime();
|
DateTime oldExpiryTime = instanceLock.GetEffectiveExpiryTime();
|
||||||
instanceLock.SetExtended(extended);
|
instanceLock.SetExtended(extended);
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHARACTER_INSTANCE_LOCK_EXTENSION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHARACTER_INSTANCE_LOCK_EXTENSION);
|
||||||
stmt.AddValue(0, extended ? 1 : 0);
|
stmt.AddValue(0, extended ? 1 : 0);
|
||||||
stmt.AddValue(1, playerGuid.GetCounter());
|
stmt.AddValue(1, playerGuid.GetCounter());
|
||||||
stmt.AddValue(2, entries.MapDifficulty.MapID);
|
stmt.AddValue(2, entries.MapDifficulty.MapID);
|
||||||
@@ -395,7 +395,7 @@ namespace Game.Maps
|
|||||||
instanceLock.SetExpiryTime(newExpiryTime);
|
instanceLock.SetExpiryTime(newExpiryTime);
|
||||||
instanceLock.SetExtended(false);
|
instanceLock.SetExtended(false);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHARACTER_INSTANCE_LOCK_FORCE_EXPIRE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHARACTER_INSTANCE_LOCK_FORCE_EXPIRE);
|
||||||
stmt.AddValue(0, (ulong)Time.DateTimeToUnixTime(newExpiryTime));
|
stmt.AddValue(0, (ulong)Time.DateTimeToUnixTime(newExpiryTime));
|
||||||
stmt.AddValue(1, playerGuid.GetCounter());
|
stmt.AddValue(1, playerGuid.GetCounter());
|
||||||
stmt.AddValue(2, entries.MapDifficulty.MapID);
|
stmt.AddValue(2, entries.MapDifficulty.MapID);
|
||||||
|
|||||||
@@ -2052,7 +2052,7 @@ namespace Game.Maps
|
|||||||
if (Instanceable())
|
if (Instanceable())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_RESPAWN);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_RESPAWN);
|
||||||
stmt.AddValue(0, (ushort)type);
|
stmt.AddValue(0, (ushort)type);
|
||||||
stmt.AddValue(1, spawnId);
|
stmt.AddValue(1, spawnId);
|
||||||
stmt.AddValue(2, GetId());
|
stmt.AddValue(2, GetId());
|
||||||
@@ -2692,7 +2692,7 @@ namespace Game.Maps
|
|||||||
if (Instanceable())
|
if (Instanceable())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_RESPAWN);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_RESPAWN);
|
||||||
stmt.AddValue(0, (ushort)info.type);
|
stmt.AddValue(0, (ushort)info.type);
|
||||||
stmt.AddValue(1, info.spawnId);
|
stmt.AddValue(1, info.spawnId);
|
||||||
stmt.AddValue(2, info.respawnTime);
|
stmt.AddValue(2, info.respawnTime);
|
||||||
@@ -2706,7 +2706,7 @@ namespace Game.Maps
|
|||||||
if (Instanceable())
|
if (Instanceable())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_RESPAWNS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_RESPAWNS);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, GetInstanceId());
|
stmt.AddValue(1, GetInstanceId());
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
@@ -2744,7 +2744,7 @@ namespace Game.Maps
|
|||||||
if (Instanceable())
|
if (Instanceable())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ALL_RESPAWNS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ALL_RESPAWNS);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, GetInstanceId());
|
stmt.AddValue(1, GetInstanceId());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -2768,7 +2768,7 @@ namespace Game.Maps
|
|||||||
|
|
||||||
public void LoadCorpseData()
|
public void LoadCorpseData()
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CORPSES);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CORPSES);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, GetInstanceId());
|
stmt.AddValue(1, GetInstanceId());
|
||||||
|
|
||||||
@@ -2781,7 +2781,7 @@ namespace Game.Maps
|
|||||||
MultiMap<ulong, uint> phases = new();
|
MultiMap<ulong, uint> phases = new();
|
||||||
MultiMap<ulong, ChrCustomizationChoice> customizations = new();
|
MultiMap<ulong, ChrCustomizationChoice> customizations = new();
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CORPSE_PHASES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CORPSE_PHASES);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, GetInstanceId());
|
stmt.AddValue(1, GetInstanceId());
|
||||||
|
|
||||||
@@ -2800,7 +2800,7 @@ namespace Game.Maps
|
|||||||
} while (phaseResult.NextRow());
|
} while (phaseResult.NextRow());
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CORPSE_CUSTOMIZATIONS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CORPSE_CUSTOMIZATIONS);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, GetInstanceId());
|
stmt.AddValue(1, GetInstanceId());
|
||||||
|
|
||||||
@@ -2847,7 +2847,7 @@ namespace Game.Maps
|
|||||||
public void DeleteCorpseData()
|
public void DeleteCorpseData()
|
||||||
{
|
{
|
||||||
// DELETE cp, c FROM corpse_phases cp INNER JOIN corpse c ON cp.OwnerGuid = c.guid WHERE c.mapId = ? AND c.instanceId = ?
|
// DELETE cp, c FROM corpse_phases cp INNER JOIN corpse c ON cp.OwnerGuid = c.guid WHERE c.mapId = ? AND c.instanceId = ?
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CORPSES_FROM_MAP);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CORPSES_FROM_MAP);
|
||||||
stmt.AddValue(0, GetId());
|
stmt.AddValue(0, GetId());
|
||||||
stmt.AddValue(1, GetInstanceId());
|
stmt.AddValue(1, GetInstanceId());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
_waypointStore.Remove(id);
|
_waypointStore.Remove(id);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_BY_ID);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_WAYPOINT_DATA_BY_ID);
|
||||||
stmt.AddValue(0, id);
|
stmt.AddValue(0, id);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ namespace Game.Networking
|
|||||||
bool CheckAccessLevelAndPassword(string email, string password)
|
bool CheckAccessLevelAndPassword(string email, string password)
|
||||||
{
|
{
|
||||||
//"SELECT a.id, a.username FROM account a LEFT JOIN battlenet_accounts ba ON a.battlenet_account = ba.id WHERE ba.email = ?"
|
//"SELECT a.id, a.username FROM account a LEFT JOIN battlenet_accounts ba ON a.battlenet_account = ba.id WHERE ba.email = ?"
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_GAME_ACCOUNT_LIST);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_GAME_ACCOUNT_LIST);
|
||||||
stmt.AddValue(0, email);
|
stmt.AddValue(0, email);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
@@ -144,7 +144,7 @@ namespace Game.Networking
|
|||||||
uint accountId = result.Read<uint>(0);
|
uint accountId = result.Read<uint>(0);
|
||||||
string username = result.Read<string>(1);
|
string username = result.Read<string>(1);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_ACCESS_BY_ID);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_ACCESS_BY_ID);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
result = DB.Login.Query(stmt);
|
result = DB.Login.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
@@ -165,7 +165,7 @@ namespace Game.Networking
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_CHECK_PASSWORD);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_CHECK_PASSWORD);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
result = DB.Login.Query(stmt);
|
result = DB.Login.Query(stmt);
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace Game.Networking
|
|||||||
{
|
{
|
||||||
string ip_address = GetRemoteIpAddress().ToString();
|
string ip_address = GetRemoteIpAddress().ToString();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SelIpInfo);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SelIpInfo);
|
||||||
stmt.AddValue(0, ip_address);
|
stmt.AddValue(0, ip_address);
|
||||||
stmt.AddValue(1, BitConverter.ToUInt32(GetRemoteIpAddress().Address.GetAddressBytes(), 0));
|
stmt.AddValue(1, BitConverter.ToUInt32(GetRemoteIpAddress().Address.GetAddressBytes(), 0));
|
||||||
|
|
||||||
@@ -457,7 +457,7 @@ namespace Game.Networking
|
|||||||
void HandleAuthSession(AuthSession authSession)
|
void HandleAuthSession(AuthSession authSession)
|
||||||
{
|
{
|
||||||
// Get the account information from the realmd database
|
// Get the account information from the realmd database
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_INFO_BY_NAME);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_INFO_BY_NAME);
|
||||||
stmt.AddValue(0, Global.WorldMgr.GetRealm().Id.Index);
|
stmt.AddValue(0, Global.WorldMgr.GetRealm().Id.Index);
|
||||||
stmt.AddValue(1, authSession.RealmJoinTicket);
|
stmt.AddValue(1, authSession.RealmJoinTicket);
|
||||||
|
|
||||||
@@ -539,14 +539,14 @@ namespace Game.Networking
|
|||||||
if (WorldConfig.GetBoolValue(WorldCfg.AllowLogginIpAddressesInDatabase))
|
if (WorldConfig.GetBoolValue(WorldCfg.AllowLogginIpAddressesInDatabase))
|
||||||
{
|
{
|
||||||
// As we don't know if attempted login process by ip works, we update last_attempt_ip right away
|
// As we don't know if attempted login process by ip works, we update last_attempt_ip right away
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_LAST_ATTEMPT_IP);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_LAST_ATTEMPT_IP);
|
||||||
stmt.AddValue(0, address.Address.ToString());
|
stmt.AddValue(0, address.Address.ToString());
|
||||||
stmt.AddValue(1, authSession.RealmJoinTicket);
|
stmt.AddValue(1, authSession.RealmJoinTicket);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
// This also allows to check for possible "hack" attempts on account
|
// This also allows to check for possible "hack" attempts on account
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_INFO_CONTINUED_SESSION);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_INFO_CONTINUED_SESSION);
|
||||||
stmt.AddValue(0, _sessionKey);
|
stmt.AddValue(0, _sessionKey);
|
||||||
stmt.AddValue(1, account.game.Id);
|
stmt.AddValue(1, account.game.Id);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -607,7 +607,7 @@ namespace Game.Networking
|
|||||||
{
|
{
|
||||||
mutetime = GameTime.GetGameTime() + mutetime;
|
mutetime = GameTime.GetGameTime() + mutetime;
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_MUTE_TIME_LOGIN);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_MUTE_TIME_LOGIN);
|
||||||
stmt.AddValue(0, mutetime);
|
stmt.AddValue(0, mutetime);
|
||||||
stmt.AddValue(1, account.game.Id);
|
stmt.AddValue(1, account.game.Id);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -636,7 +636,7 @@ namespace Game.Networking
|
|||||||
if (WorldConfig.GetBoolValue(WorldCfg.AllowLogginIpAddressesInDatabase))
|
if (WorldConfig.GetBoolValue(WorldCfg.AllowLogginIpAddressesInDatabase))
|
||||||
{
|
{
|
||||||
// Update the last_ip in the database
|
// Update the last_ip in the database
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_LAST_IP);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_LAST_IP);
|
||||||
stmt.AddValue(0, address.Address.ToString());
|
stmt.AddValue(0, address.Address.ToString());
|
||||||
stmt.AddValue(1, authSession.RealmJoinTicket);
|
stmt.AddValue(1, authSession.RealmJoinTicket);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
@@ -675,7 +675,7 @@ namespace Game.Networking
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint accountId = key.AccountId;
|
uint accountId = key.AccountId;
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_INFO_CONTINUED_SESSION);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_INFO_CONTINUED_SESSION);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
|
|
||||||
_queryProcessor.AddCallback(DB.Login.AsyncQuery(stmt).WithCallback(HandleAuthContinuedSessionCallback, authSession));
|
_queryProcessor.AddCallback(DB.Login.AsyncQuery(stmt).WithCallback(HandleAuthContinuedSessionCallback, authSession));
|
||||||
|
|||||||
@@ -44,13 +44,13 @@ namespace Game
|
|||||||
|
|
||||||
public static void SaveToDB(QuestPool pool, SQLTransaction trans)
|
public static void SaveToDB(QuestPool pool, SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement delStmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_POOL_QUEST_SAVE);
|
PreparedStatement delStmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_POOL_QUEST_SAVE);
|
||||||
delStmt.AddValue(0, pool.poolId);
|
delStmt.AddValue(0, pool.poolId);
|
||||||
trans.Append(delStmt);
|
trans.Append(delStmt);
|
||||||
|
|
||||||
foreach (uint questId in pool.activeQuests)
|
foreach (uint questId in pool.activeQuests)
|
||||||
{
|
{
|
||||||
PreparedStatement insStmt = DB.Characters.GetPreparedStatement(CharStatements.INS_POOL_QUEST_SAVE);
|
PreparedStatement insStmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_POOL_QUEST_SAVE);
|
||||||
insStmt.AddValue(0, pool.poolId);
|
insStmt.AddValue(0, pool.poolId);
|
||||||
insStmt.AddValue(1, questId);
|
insStmt.AddValue(1, questId);
|
||||||
trans.Append(insStmt);
|
trans.Append(insStmt);
|
||||||
@@ -141,7 +141,7 @@ namespace Game
|
|||||||
SQLTransaction trans0 = new SQLTransaction();
|
SQLTransaction trans0 = new SQLTransaction();
|
||||||
foreach (uint poolId in unknownPoolIds)
|
foreach (uint poolId in unknownPoolIds)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_POOL_QUEST_SAVE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_POOL_QUEST_SAVE);
|
||||||
stmt.AddValue(0, poolId);
|
stmt.AddValue(0, poolId);
|
||||||
trans0.Append(stmt);
|
trans0.Append(stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ namespace Game
|
|||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA_PROGRESS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA_PROGRESS);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ namespace Game
|
|||||||
// Removing non-existing criteria data for all characters
|
// Removing non-existing criteria data for all characters
|
||||||
Log.outError(LogFilter.Player, $"Non-existing quest objective criteria {criteriaId} data has been removed from the table `character_queststatus_objectives_criteria_progress`.");
|
Log.outError(LogFilter.Player, $"Non-existing quest objective criteria {criteriaId} data has been removed from the table `character_queststatus_objectives_criteria_progress`.");
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_INVALID_QUEST_PROGRESS_CRITERIA);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_INVALID_QUEST_PROGRESS_CRITERIA);
|
||||||
stmt.AddValue(0, criteriaId);
|
stmt.AddValue(0, criteriaId);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ namespace Game
|
|||||||
|
|
||||||
public void SaveToDB(SQLTransaction trans)
|
public void SaveToDB(SQLTransaction trans)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
foreach (uint completedObjectiveId in _completedObjectives)
|
foreach (uint completedObjectiveId in _completedObjectives)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, completedObjectiveId);
|
stmt.AddValue(1, completedObjectiveId);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
@@ -130,14 +130,14 @@ namespace Game
|
|||||||
if (!pair.Value.Changed)
|
if (!pair.Value.Changed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA_PROGRESS_BY_CRITERIA);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA_PROGRESS_BY_CRITERIA);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
if (pair.Value.Counter != 0)
|
if (pair.Value.Counter != 0)
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA_PROGRESS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_QUESTSTATUS_OBJECTIVES_CRITERIA_PROGRESS);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, pair.Key);
|
stmt.AddValue(1, pair.Key);
|
||||||
stmt.AddValue(2, pair.Value.Counter);
|
stmt.AddValue(2, pair.Value.Counter);
|
||||||
|
|||||||
@@ -758,12 +758,12 @@ namespace Game
|
|||||||
{
|
{
|
||||||
if (factionState.needSave)
|
if (factionState.needSave)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_REPUTATION_BY_FACTION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_REPUTATION_BY_FACTION);
|
||||||
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, factionState.Id);
|
stmt.AddValue(1, factionState.Id);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_REPUTATION_BY_FACTION);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_REPUTATION_BY_FACTION);
|
||||||
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
||||||
stmt.AddValue(1, factionState.Id);
|
stmt.AddValue(1, factionState.Id);
|
||||||
stmt.AddValue(2, factionState.Standing);
|
stmt.AddValue(2, factionState.Standing);
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ namespace Game
|
|||||||
SendPacket(logoutComplete);
|
SendPacket(logoutComplete);
|
||||||
|
|
||||||
//! Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline
|
//! Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ACCOUNT_ONLINE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_ACCOUNT_ONLINE);
|
||||||
stmt.AddValue(0, GetAccountId());
|
stmt.AddValue(0, GetAccountId());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
@@ -459,7 +459,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
bool hasTutorialsInDB = tutorialsChanged.HasAnyFlag(TutorialsFlag.LoadedFromDB);
|
bool hasTutorialsInDB = tutorialsChanged.HasAnyFlag(TutorialsFlag.LoadedFromDB);
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(hasTutorialsInDB ? CharStatements.UPD_TUTORIALS : CharStatements.INS_TUTORIALS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(hasTutorialsInDB ? CharStatements.UPD_TUTORIALS : CharStatements.INS_TUTORIALS);
|
||||||
for (var i = 0; i < SharedConst.MaxAccountTutorialValues; ++i)
|
for (var i = 0; i < SharedConst.MaxAccountTutorialValues; ++i)
|
||||||
stmt.AddValue(i, tutorials[i]);
|
stmt.AddValue(i, tutorials[i]);
|
||||||
stmt.AddValue(SharedConst.MaxAccountTutorialValues, GetAccountId());
|
stmt.AddValue(SharedConst.MaxAccountTutorialValues, GetAccountId());
|
||||||
@@ -538,7 +538,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
if (Convert.ToBoolean((1 << (int)type) & (int)AccountDataTypes.GlobalCacheMask))
|
if (Convert.ToBoolean((1 << (int)type) & (int)AccountDataTypes.GlobalCacheMask))
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_ACCOUNT_DATA);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_ACCOUNT_DATA);
|
||||||
stmt.AddValue(0, GetAccountId());
|
stmt.AddValue(0, GetAccountId());
|
||||||
stmt.AddValue(1, (byte)type);
|
stmt.AddValue(1, (byte)type);
|
||||||
stmt.AddValue(2, time);
|
stmt.AddValue(2, time);
|
||||||
@@ -551,7 +551,7 @@ namespace Game
|
|||||||
if (m_GUIDLow == 0)
|
if (m_GUIDLow == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_PLAYER_ACCOUNT_DATA);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_PLAYER_ACCOUNT_DATA);
|
||||||
stmt.AddValue(0, m_GUIDLow);
|
stmt.AddValue(0, m_GUIDLow);
|
||||||
stmt.AddValue(1, (byte)type);
|
stmt.AddValue(1, (byte)type);
|
||||||
stmt.AddValue(2, time);
|
stmt.AddValue(2, time);
|
||||||
@@ -1109,11 +1109,11 @@ namespace Game
|
|||||||
{
|
{
|
||||||
public void Initialize(uint accountId, uint battlenetAccountId)
|
public void Initialize(uint accountId, uint battlenetAccountId)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_ACCOUNT_DATA);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_ACCOUNT_DATA);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SetQuery(AccountInfoQueryLoad.GlobalAccountDataIndexPerRealm, stmt);
|
SetQuery(AccountInfoQueryLoad.GlobalAccountDataIndexPerRealm, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_TUTORIALS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_TUTORIALS);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SetQuery(AccountInfoQueryLoad.TutorialsIndexPerRealm, stmt);
|
SetQuery(AccountInfoQueryLoad.TutorialsIndexPerRealm, stmt);
|
||||||
}
|
}
|
||||||
@@ -1123,40 +1123,40 @@ namespace Game
|
|||||||
{
|
{
|
||||||
public void Initialize(uint accountId, uint battlenetAccountId)
|
public void Initialize(uint accountId, uint battlenetAccountId)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_TOYS);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_TOYS);
|
||||||
stmt.AddValue(0, battlenetAccountId);
|
stmt.AddValue(0, battlenetAccountId);
|
||||||
SetQuery(AccountInfoQueryLoad.GlobalAccountToys, stmt);
|
SetQuery(AccountInfoQueryLoad.GlobalAccountToys, stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BATTLE_PETS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BATTLE_PETS);
|
||||||
stmt.AddValue(0, battlenetAccountId);
|
stmt.AddValue(0, battlenetAccountId);
|
||||||
stmt.AddValue(1, Global.WorldMgr.GetRealmId().Index);
|
stmt.AddValue(1, Global.WorldMgr.GetRealmId().Index);
|
||||||
SetQuery(AccountInfoQueryLoad.BattlePets, stmt);
|
SetQuery(AccountInfoQueryLoad.BattlePets, stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BATTLE_PET_SLOTS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BATTLE_PET_SLOTS);
|
||||||
stmt.AddValue(0, battlenetAccountId);
|
stmt.AddValue(0, battlenetAccountId);
|
||||||
SetQuery(AccountInfoQueryLoad.BattlePetSlot, stmt);
|
SetQuery(AccountInfoQueryLoad.BattlePetSlot, stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_HEIRLOOMS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_HEIRLOOMS);
|
||||||
stmt.AddValue(0, battlenetAccountId);
|
stmt.AddValue(0, battlenetAccountId);
|
||||||
SetQuery(AccountInfoQueryLoad.GlobalAccountHeirlooms, stmt);
|
SetQuery(AccountInfoQueryLoad.GlobalAccountHeirlooms, stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_MOUNTS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_MOUNTS);
|
||||||
stmt.AddValue(0, battlenetAccountId);
|
stmt.AddValue(0, battlenetAccountId);
|
||||||
SetQuery(AccountInfoQueryLoad.Mounts, stmt);
|
SetQuery(AccountInfoQueryLoad.Mounts, stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SelBnetCharacterCountsByAccountId);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SelBnetCharacterCountsByAccountId);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
SetQuery(AccountInfoQueryLoad.GlobalRealmCharacterCounts, stmt);
|
SetQuery(AccountInfoQueryLoad.GlobalRealmCharacterCounts, stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_ITEM_APPEARANCES);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_ITEM_APPEARANCES);
|
||||||
stmt.AddValue(0, battlenetAccountId);
|
stmt.AddValue(0, battlenetAccountId);
|
||||||
SetQuery(AccountInfoQueryLoad.ItemAppearances, stmt);
|
SetQuery(AccountInfoQueryLoad.ItemAppearances, stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_ITEM_FAVORITE_APPEARANCES);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_ITEM_FAVORITE_APPEARANCES);
|
||||||
stmt.AddValue(0, battlenetAccountId);
|
stmt.AddValue(0, battlenetAccountId);
|
||||||
SetQuery(AccountInfoQueryLoad.ItemFavoriteAppearances, stmt);
|
SetQuery(AccountInfoQueryLoad.ItemFavoriteAppearances, stmt);
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_TRANSMOG_ILLUSIONS);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_TRANSMOG_ILLUSIONS);
|
||||||
stmt.AddValue(0, battlenetAccountId);
|
stmt.AddValue(0, battlenetAccountId);
|
||||||
SetQuery(AccountInfoQueryLoad.TransmogIllusions, stmt);
|
SetQuery(AccountInfoQueryLoad.TransmogIllusions, stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ namespace Game.Spells
|
|||||||
PreparedStatement stmt;
|
PreparedStatement stmt;
|
||||||
if (typeof(T) == typeof(Pet))
|
if (typeof(T) == typeof(Pet))
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_SPELL_COOLDOWNS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_SPELL_COOLDOWNS);
|
||||||
stmt.AddValue(0, _owner.GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, _owner.GetCharmInfo().GetPetNumber());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_PET_SPELL_CHARGES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_PET_SPELL_CHARGES);
|
||||||
stmt.AddValue(0, _owner.GetCharmInfo().GetPetNumber());
|
stmt.AddValue(0, _owner.GetCharmInfo().GetPetNumber());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ namespace Game.Spells
|
|||||||
if (!pair.Value.OnHold)
|
if (!pair.Value.OnHold)
|
||||||
{
|
{
|
||||||
index = 0;
|
index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PET_SPELL_COOLDOWN);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PET_SPELL_COOLDOWN);
|
||||||
stmt.AddValue(index++, _owner.GetCharmInfo().GetPetNumber());
|
stmt.AddValue(index++, _owner.GetCharmInfo().GetPetNumber());
|
||||||
stmt.AddValue(index++, pair.Key);
|
stmt.AddValue(index++, pair.Key);
|
||||||
stmt.AddValue(index++, Time.DateTimeToUnixTime(pair.Value.CooldownEnd));
|
stmt.AddValue(index++, Time.DateTimeToUnixTime(pair.Value.CooldownEnd));
|
||||||
@@ -102,7 +102,7 @@ namespace Game.Spells
|
|||||||
foreach (var pair in _categoryCharges)
|
foreach (var pair in _categoryCharges)
|
||||||
{
|
{
|
||||||
index = 0;
|
index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PET_SPELL_CHARGES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_PET_SPELL_CHARGES);
|
||||||
stmt.AddValue(index++, _owner.GetCharmInfo().GetPetNumber());
|
stmt.AddValue(index++, _owner.GetCharmInfo().GetPetNumber());
|
||||||
stmt.AddValue(index++, pair.Key);
|
stmt.AddValue(index++, pair.Key);
|
||||||
stmt.AddValue(index++, Time.DateTimeToUnixTime(pair.Value.RechargeStart));
|
stmt.AddValue(index++, Time.DateTimeToUnixTime(pair.Value.RechargeStart));
|
||||||
@@ -112,11 +112,11 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_SPELL_COOLDOWNS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_SPELL_COOLDOWNS);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_SPELL_CHARGES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_CHAR_SPELL_CHARGES);
|
||||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ namespace Game.Spells
|
|||||||
if (!pair.Value.OnHold)
|
if (!pair.Value.OnHold)
|
||||||
{
|
{
|
||||||
index = 0;
|
index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_SPELL_COOLDOWN);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_SPELL_COOLDOWN);
|
||||||
stmt.AddValue(index++, _owner.GetGUID().GetCounter());
|
stmt.AddValue(index++, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(index++, pair.Key);
|
stmt.AddValue(index++, pair.Key);
|
||||||
stmt.AddValue(index++, pair.Value.ItemId);
|
stmt.AddValue(index++, pair.Value.ItemId);
|
||||||
@@ -140,7 +140,7 @@ namespace Game.Spells
|
|||||||
foreach (var pair in _categoryCharges)
|
foreach (var pair in _categoryCharges)
|
||||||
{
|
{
|
||||||
index = 0;
|
index = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_SPELL_CHARGES);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHAR_SPELL_CHARGES);
|
||||||
stmt.AddValue(index++, _owner.GetGUID().GetCounter());
|
stmt.AddValue(index++, _owner.GetGUID().GetCounter());
|
||||||
stmt.AddValue(index++, pair.Key);
|
stmt.AddValue(index++, pair.Key);
|
||||||
stmt.AddValue(index++, Time.DateTimeToUnixTime(pair.Value.RechargeStart));
|
stmt.AddValue(index++, Time.DateTimeToUnixTime(pair.Value.RechargeStart));
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Game.SupportSystem
|
|||||||
_lastBugId = 0;
|
_lastBugId = 0;
|
||||||
_openBugTicketCount = 0;
|
_openBugTicketCount = 0;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GM_BUGS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GM_BUGS);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
@@ -96,7 +96,7 @@ namespace Game.SupportSystem
|
|||||||
_lastComplaintId = 0;
|
_lastComplaintId = 0;
|
||||||
_openComplaintTicketCount = 0;
|
_openComplaintTicketCount = 0;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GM_COMPLAINTS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GM_COMPLAINTS);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
@@ -119,7 +119,7 @@ namespace Game.SupportSystem
|
|||||||
if (_lastComplaintId < id)
|
if (_lastComplaintId < id)
|
||||||
_lastComplaintId = id;
|
_lastComplaintId = id;
|
||||||
|
|
||||||
chatLogStmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GM_COMPLAINT_CHATLINES);
|
chatLogStmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GM_COMPLAINT_CHATLINES);
|
||||||
chatLogStmt.AddValue(0, id);
|
chatLogStmt.AddValue(0, id);
|
||||||
chatLogResult = DB.Characters.Query(stmt);
|
chatLogResult = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ namespace Game.SupportSystem
|
|||||||
_lastSuggestionId = 0;
|
_lastSuggestionId = 0;
|
||||||
_openSuggestionTicketCount = 0;
|
_openSuggestionTicketCount = 0;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GM_SUGGESTIONS);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_GM_SUGGESTIONS);
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
@@ -255,7 +255,7 @@ namespace Game.SupportSystem
|
|||||||
|
|
||||||
_lastBugId = 0;
|
_lastBugId = 0;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ALL_GM_BUGS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ALL_GM_BUGS);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
break;
|
break;
|
||||||
case "ComplaintTicket":
|
case "ComplaintTicket":
|
||||||
@@ -264,8 +264,8 @@ namespace Game.SupportSystem
|
|||||||
_lastComplaintId = 0;
|
_lastComplaintId = 0;
|
||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
trans.Append(DB.Characters.GetPreparedStatement(CharStatements.DEL_ALL_GM_COMPLAINTS));
|
trans.Append(CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ALL_GM_COMPLAINTS));
|
||||||
trans.Append(DB.Characters.GetPreparedStatement(CharStatements.DEL_ALL_GM_COMPLAINT_CHATLOGS));
|
trans.Append(CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ALL_GM_COMPLAINT_CHATLOGS));
|
||||||
DB.Characters.CommitTransaction(trans);
|
DB.Characters.CommitTransaction(trans);
|
||||||
break;
|
break;
|
||||||
case "SuggestionTicket":
|
case "SuggestionTicket":
|
||||||
@@ -273,7 +273,7 @@ namespace Game.SupportSystem
|
|||||||
|
|
||||||
_lastSuggestionId = 0;
|
_lastSuggestionId = 0;
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ALL_GM_SUGGESTIONS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_ALL_GM_SUGGESTIONS);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ namespace Game.SupportSystem
|
|||||||
public override void SaveToDB()
|
public override void SaveToDB()
|
||||||
{
|
{
|
||||||
byte idx = 0;
|
byte idx = 0;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_GM_BUG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_GM_BUG);
|
||||||
stmt.AddValue(idx, _id);
|
stmt.AddValue(idx, _id);
|
||||||
stmt.AddValue(++idx, _playerGuid.GetCounter());
|
stmt.AddValue(++idx, _playerGuid.GetCounter());
|
||||||
stmt.AddValue(++idx, _note);
|
stmt.AddValue(++idx, _note);
|
||||||
@@ -163,7 +163,7 @@ namespace Game.SupportSystem
|
|||||||
|
|
||||||
public override void DeleteFromDB()
|
public override void DeleteFromDB()
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GM_BUG);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GM_BUG);
|
||||||
stmt.AddValue(0, _id);
|
stmt.AddValue(0, _id);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,7 @@ namespace Game.SupportSystem
|
|||||||
var trans = new SQLTransaction();
|
var trans = new SQLTransaction();
|
||||||
|
|
||||||
byte idx = 0;
|
byte idx = 0;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_GM_COMPLAINT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_GM_COMPLAINT);
|
||||||
stmt.AddValue(idx, _id);
|
stmt.AddValue(idx, _id);
|
||||||
stmt.AddValue(++idx, _playerGuid.GetCounter());
|
stmt.AddValue(++idx, _playerGuid.GetCounter());
|
||||||
stmt.AddValue(++idx, _note);
|
stmt.AddValue(++idx, _note);
|
||||||
@@ -288,7 +288,7 @@ namespace Game.SupportSystem
|
|||||||
foreach (var c in _chatLog.Lines)
|
foreach (var c in _chatLog.Lines)
|
||||||
{
|
{
|
||||||
idx = 0;
|
idx = 0;
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GM_COMPLAINT_CHATLINE);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_GM_COMPLAINT_CHATLINE);
|
||||||
stmt.AddValue(idx, _id);
|
stmt.AddValue(idx, _id);
|
||||||
stmt.AddValue(++idx, lineIndex);
|
stmt.AddValue(++idx, lineIndex);
|
||||||
stmt.AddValue(++idx, c.Timestamp);
|
stmt.AddValue(++idx, c.Timestamp);
|
||||||
@@ -303,11 +303,11 @@ namespace Game.SupportSystem
|
|||||||
|
|
||||||
public override void DeleteFromDB()
|
public override void DeleteFromDB()
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GM_COMPLAINT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GM_COMPLAINT);
|
||||||
stmt.AddValue(0, _id);
|
stmt.AddValue(0, _id);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GM_COMPLAINT_CHATLOG);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GM_COMPLAINT_CHATLOG);
|
||||||
stmt.AddValue(0, _id);
|
stmt.AddValue(0, _id);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
@@ -398,7 +398,7 @@ namespace Game.SupportSystem
|
|||||||
public override void SaveToDB()
|
public override void SaveToDB()
|
||||||
{
|
{
|
||||||
byte idx = 0;
|
byte idx = 0;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_GM_SUGGESTION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_GM_SUGGESTION);
|
||||||
stmt.AddValue(idx, _id);
|
stmt.AddValue(idx, _id);
|
||||||
stmt.AddValue(++idx, _playerGuid.GetCounter());
|
stmt.AddValue(++idx, _playerGuid.GetCounter());
|
||||||
stmt.AddValue(++idx, _note);
|
stmt.AddValue(++idx, _note);
|
||||||
@@ -417,7 +417,7 @@ namespace Game.SupportSystem
|
|||||||
|
|
||||||
public override void DeleteFromDB()
|
public override void DeleteFromDB()
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GM_SUGGESTION);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_GM_SUGGESTION);
|
||||||
stmt.AddValue(0, _id);
|
stmt.AddValue(0, _id);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace Game
|
|||||||
mTextMap.Clear(); // for reload case
|
mTextMap.Clear(); // for reload case
|
||||||
//all currently used temp texts are NOT reset
|
//all currently used temp texts are NOT reset
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_CREATURE_TEXT);
|
PreparedStatement stmt = WorldDatabase.GetPreparedStatement(WorldStatements.SEL_CREATURE_TEXT);
|
||||||
SQLResult result = DB.World.Query(stmt);
|
SQLResult result = DB.World.Query(stmt);
|
||||||
|
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace Game
|
|||||||
|
|
||||||
public void LoadDBAllowedSecurityLevel()
|
public void LoadDBAllowedSecurityLevel()
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_REALMLIST_SECURITY_LEVEL);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_REALMLIST_SECURITY_LEVEL);
|
||||||
stmt.AddValue(0, (int)_realm.Id.Index);
|
stmt.AddValue(0, (int)_realm.Id.Index);
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
|
|
||||||
@@ -1269,7 +1269,7 @@ namespace Game
|
|||||||
|
|
||||||
m_Autobroadcasts.Clear();
|
m_Autobroadcasts.Clear();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_AUTOBROADCAST);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_AUTOBROADCAST);
|
||||||
stmt.AddValue(0, _realm.Id.Index);
|
stmt.AddValue(0, _realm.Id.Index);
|
||||||
|
|
||||||
SQLResult result = DB.Login.Query(stmt);
|
SQLResult result = DB.Login.Query(stmt);
|
||||||
@@ -1398,7 +1398,7 @@ namespace Game
|
|||||||
|
|
||||||
m_timers[WorldTimers.UpTime].Reset();
|
m_timers[WorldTimers.UpTime].Reset();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_UPTIME_PLAYERS);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_UPTIME_PLAYERS);
|
||||||
|
|
||||||
stmt.AddValue(0, tmpDiff);
|
stmt.AddValue(0, tmpDiff);
|
||||||
stmt.AddValue(1, maxOnlinePlayers);
|
stmt.AddValue(1, maxOnlinePlayers);
|
||||||
@@ -1415,7 +1415,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
m_timers[WorldTimers.CleanDB].Reset();
|
m_timers[WorldTimers.CleanDB].Reset();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_OLD_LOGS);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_OLD_LOGS);
|
||||||
stmt.AddValue(0, WorldConfig.GetIntValue(WorldCfg.LogdbCleartime));
|
stmt.AddValue(0, WorldConfig.GetIntValue(WorldCfg.LogdbCleartime));
|
||||||
stmt.AddValue(1, 0);
|
stmt.AddValue(1, 0);
|
||||||
stmt.AddValue(2, GetRealm().Id.Index);
|
stmt.AddValue(2, GetRealm().Id.Index);
|
||||||
@@ -1637,10 +1637,10 @@ namespace Game
|
|||||||
{
|
{
|
||||||
case BanMode.IP:
|
case BanMode.IP:
|
||||||
// No SQL injection with prepared statements
|
// No SQL injection with prepared statements
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BY_IP);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_BY_IP);
|
||||||
stmt.AddValue(0, nameOrIP);
|
stmt.AddValue(0, nameOrIP);
|
||||||
resultAccounts = DB.Login.Query(stmt);
|
resultAccounts = DB.Login.Query(stmt);
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_IP_BANNED);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_IP_BANNED);
|
||||||
stmt.AddValue(0, nameOrIP);
|
stmt.AddValue(0, nameOrIP);
|
||||||
stmt.AddValue(1, duration_secs);
|
stmt.AddValue(1, duration_secs);
|
||||||
stmt.AddValue(2, author);
|
stmt.AddValue(2, author);
|
||||||
@@ -1649,13 +1649,13 @@ namespace Game
|
|||||||
break;
|
break;
|
||||||
case BanMode.Account:
|
case BanMode.Account:
|
||||||
// No SQL injection with prepared statements
|
// No SQL injection with prepared statements
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_ID_BY_NAME);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_ACCOUNT_ID_BY_NAME);
|
||||||
stmt.AddValue(0, nameOrIP);
|
stmt.AddValue(0, nameOrIP);
|
||||||
resultAccounts = DB.Login.Query(stmt);
|
resultAccounts = DB.Login.Query(stmt);
|
||||||
break;
|
break;
|
||||||
case BanMode.Character:
|
case BanMode.Character:
|
||||||
// No SQL injection with prepared statements
|
// No SQL injection with prepared statements
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_ACCOUNT_BY_NAME);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_ACCOUNT_BY_NAME);
|
||||||
stmt.AddValue(0, nameOrIP);
|
stmt.AddValue(0, nameOrIP);
|
||||||
resultAccounts = DB.Characters.Query(stmt);
|
resultAccounts = DB.Characters.Query(stmt);
|
||||||
break;
|
break;
|
||||||
@@ -1680,11 +1680,11 @@ namespace Game
|
|||||||
if (mode != BanMode.IP)
|
if (mode != BanMode.IP)
|
||||||
{
|
{
|
||||||
// make sure there is only one active ban
|
// make sure there is only one active ban
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_NOT_BANNED);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_NOT_BANNED);
|
||||||
stmt.AddValue(0, account);
|
stmt.AddValue(0, account);
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
// No SQL injection with prepared statements
|
// No SQL injection with prepared statements
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_ACCOUNT_BANNED);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.INS_ACCOUNT_BANNED);
|
||||||
stmt.AddValue(0, account);
|
stmt.AddValue(0, account);
|
||||||
stmt.AddValue(1, duration_secs);
|
stmt.AddValue(1, duration_secs);
|
||||||
stmt.AddValue(2, author);
|
stmt.AddValue(2, author);
|
||||||
@@ -1711,7 +1711,7 @@ namespace Game
|
|||||||
PreparedStatement stmt;
|
PreparedStatement stmt;
|
||||||
if (mode == BanMode.IP)
|
if (mode == BanMode.IP)
|
||||||
{
|
{
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_IP_NOT_BANNED);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.DEL_IP_NOT_BANNED);
|
||||||
stmt.AddValue(0, nameOrIP);
|
stmt.AddValue(0, nameOrIP);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
}
|
}
|
||||||
@@ -1727,7 +1727,7 @@ namespace Game
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//NO SQL injection as account is uint32
|
//NO SQL injection as account is uint32
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_NOT_BANNED);
|
stmt = LoginDatabase.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_NOT_BANNED);
|
||||||
stmt.AddValue(0, account);
|
stmt.AddValue(0, account);
|
||||||
DB.Login.Execute(stmt);
|
DB.Login.Execute(stmt);
|
||||||
}
|
}
|
||||||
@@ -1760,11 +1760,11 @@ namespace Game
|
|||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
|
|
||||||
// make sure there is only one active ban
|
// make sure there is only one active ban
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHARACTER_BAN);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHARACTER_BAN);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_BAN);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.INS_CHARACTER_BAN);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
stmt.AddValue(1, (long)durationSecs);
|
stmt.AddValue(1, (long)durationSecs);
|
||||||
stmt.AddValue(2, author);
|
stmt.AddValue(2, author);
|
||||||
@@ -1794,7 +1794,7 @@ namespace Game
|
|||||||
else
|
else
|
||||||
guid = pBanned.GetGUID();
|
guid = pBanned.GetGUID();
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHARACTER_BAN);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHARACTER_BAN);
|
||||||
stmt.AddValue(0, guid.GetCounter());
|
stmt.AddValue(0, guid.GetCounter());
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
return true;
|
return true;
|
||||||
@@ -1962,7 +1962,7 @@ namespace Game
|
|||||||
|
|
||||||
public void UpdateRealmCharCount(uint accountId)
|
public void UpdateRealmCharCount(uint accountId)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_COUNT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_CHARACTER_COUNT);
|
||||||
stmt.AddValue(0, accountId);
|
stmt.AddValue(0, accountId);
|
||||||
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithCallback(UpdateRealmCharCount));
|
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithCallback(UpdateRealmCharCount));
|
||||||
}
|
}
|
||||||
@@ -1974,7 +1974,7 @@ namespace Game
|
|||||||
uint Id = result.Read<uint>(0);
|
uint Id = result.Read<uint>(0);
|
||||||
uint charCount = result.Read<uint>(1);
|
uint charCount = result.Read<uint>(1);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_REALM_CHARACTERS);
|
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.REP_REALM_CHARACTERS);
|
||||||
stmt.AddValue(0, charCount);
|
stmt.AddValue(0, charCount);
|
||||||
stmt.AddValue(1, Id);
|
stmt.AddValue(1, Id);
|
||||||
stmt.AddValue(2, _realm.Id.Index);
|
stmt.AddValue(2, _realm.Id.Index);
|
||||||
@@ -1997,10 +1997,10 @@ namespace Game
|
|||||||
public void DailyReset()
|
public void DailyReset()
|
||||||
{
|
{
|
||||||
// reset all saved quest status
|
// reset all saved quest status
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_RESET_CHARACTER_QUESTSTATUS_DAILY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_RESET_CHARACTER_QUESTSTATUS_DAILY);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHARACTER_GARRISON_FOLLOWER_ACTIVATIONS);
|
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHARACTER_GARRISON_FOLLOWER_ACTIVATIONS);
|
||||||
stmt.AddValue(0, 1);
|
stmt.AddValue(0, 1);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
@@ -2044,7 +2044,7 @@ namespace Game
|
|||||||
public void ResetWeeklyQuests()
|
public void ResetWeeklyQuests()
|
||||||
{
|
{
|
||||||
// reset all saved quest status
|
// reset all saved quest status
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_RESET_CHARACTER_QUESTSTATUS_WEEKLY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_RESET_CHARACTER_QUESTSTATUS_WEEKLY);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
// reset all quest status in memory
|
// reset all quest status in memory
|
||||||
foreach (var itr in m_sessions)
|
foreach (var itr in m_sessions)
|
||||||
@@ -2082,7 +2082,7 @@ namespace Game
|
|||||||
public void ResetMonthlyQuests()
|
public void ResetMonthlyQuests()
|
||||||
{
|
{
|
||||||
// reset all saved quest status
|
// reset all saved quest status
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_RESET_CHARACTER_QUESTSTATUS_MONTHLY);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_RESET_CHARACTER_QUESTSTATUS_MONTHLY);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
// reset all quest status in memory
|
// reset all quest status in memory
|
||||||
foreach (var itr in m_sessions)
|
foreach (var itr in m_sessions)
|
||||||
@@ -2212,7 +2212,7 @@ namespace Game
|
|||||||
|
|
||||||
public void ResetEventSeasonalQuests(ushort event_id, long eventStartTime)
|
public void ResetEventSeasonalQuests(ushort event_id, long eventStartTime)
|
||||||
{
|
{
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_RESET_CHARACTER_QUESTSTATUS_SEASONAL_BY_EVENT);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_RESET_CHARACTER_QUESTSTATUS_SEASONAL_BY_EVENT);
|
||||||
stmt.AddValue(0, event_id);
|
stmt.AddValue(0, event_id);
|
||||||
stmt.AddValue(1, eventStartTime);
|
stmt.AddValue(1, eventStartTime);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -2225,7 +2225,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
Log.outInfo(LogFilter.Server, "Random BG status reset for all characters.");
|
Log.outInfo(LogFilter.Server, "Random BG status reset for all characters.");
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_BATTLEGROUND_RANDOM_ALL);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.DEL_BATTLEGROUND_RANDOM_ALL);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|
||||||
foreach (var session in m_sessions.Values)
|
foreach (var session in m_sessions.Values)
|
||||||
@@ -2308,7 +2308,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
m_worldVariables[var] = value;
|
m_worldVariables[var] = value;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_WORLD_VARIABLE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_WORLD_VARIABLE);
|
||||||
stmt.AddValue(0, var);
|
stmt.AddValue(0, var);
|
||||||
stmt.AddValue(1, value);
|
stmt.AddValue(1, value);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
@@ -2446,7 +2446,7 @@ namespace Game
|
|||||||
long[] warModeEnabledFaction = new long[2];
|
long[] warModeEnabledFaction = new long[2];
|
||||||
|
|
||||||
// Search for characters that have war mode enabled and played during the last week
|
// Search for characters that have war mode enabled and played during the last week
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_WAR_MODE_TUNING);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.SEL_WAR_MODE_TUNING);
|
||||||
stmt.AddValue(0, (uint)PlayerFlags.WarModeDesired);
|
stmt.AddValue(0, (uint)PlayerFlags.WarModeDesired);
|
||||||
stmt.AddValue(1, (uint)PlayerFlags.WarModeDesired);
|
stmt.AddValue(1, (uint)PlayerFlags.WarModeDesired);
|
||||||
|
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ namespace Game
|
|||||||
if (GetWorldStateTemplate(worldStateId) == null)
|
if (GetWorldStateTemplate(worldStateId) == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_WORLD_STATE);
|
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_WORLD_STATE);
|
||||||
stmt.AddValue(0, worldStateId);
|
stmt.AddValue(0, worldStateId);
|
||||||
stmt.AddValue(1, value);
|
stmt.AddValue(1, value);
|
||||||
DB.Characters.Execute(stmt);
|
DB.Characters.Execute(stmt);
|
||||||
|
|||||||
Reference in New Issue
Block a user