Make PreparedStatements static for each database.

This commit is contained in:
hondacrx
2023-02-04 20:55:14 -05:00
parent e0e20b6b1c
commit 149fadccab
90 changed files with 922 additions and 923 deletions
+2 -2
View File
@@ -95,7 +95,7 @@ namespace Game.Chat
foreach (var iter in _bannedStore)
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(1, (uint)_channelTeam);
stmt.AddValue(2, _announceEnabled);
@@ -108,7 +108,7 @@ namespace Game.Chat
{
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(1, (uint)_channelTeam);
DB.Characters.Execute(stmt);
+2 -2
View File
@@ -31,7 +31,7 @@ namespace Game.Chat
uint days = WorldConfig.GetUIntValue(WorldCfg.PreserveCustomChannelDuration);
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);
DB.Characters.Execute(stmt);
}
@@ -73,7 +73,7 @@ namespace Game.Chat
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(1, (uint)team);
DB.Characters.Execute(stmt);