Make PreparedStatements static for each database.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user