Core/Characters: Replace 2 database statements with 1

Port From (https://github.com/TrinityCore/TrinityCore/commit/8cbc21120f81954382c06e89da204ec3c984e430)
This commit is contained in:
hondacrx
2022-05-04 09:48:27 -04:00
parent d953548ad4
commit 1c860ad2e2
3 changed files with 5 additions and 21 deletions
+2 -11
View File
@@ -1959,20 +1959,11 @@ namespace Game
uint Id = result.Read<uint>(0);
uint charCount = result.Read<uint>(1);
SQLTransaction trans = new();
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_REALM_CHARACTERS_BY_REALM);
stmt.AddValue(0, Id);
stmt.AddValue(1, _realm.Id.Index);
trans.Append(stmt);
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_REALM_CHARACTERS);
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_REALM_CHARACTERS);
stmt.AddValue(0, charCount);
stmt.AddValue(1, Id);
stmt.AddValue(2, _realm.Id.Index);
trans.Append(stmt);
DB.Login.CommitTransaction(trans);
DB.Login.DirectExecute(stmt);
}
}