Update some commands to new system.

This commit is contained in:
hondacrx
2022-11-09 17:30:12 -05:00
parent bca92b80b9
commit c4ce4e45f8
9 changed files with 269 additions and 441 deletions
+7 -3
View File
@@ -1745,12 +1745,16 @@ namespace Game
/// Ban an account or ban an IP address, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban
public BanReturn BanCharacter(string name, string duration, string reason, string author)
{
uint durationSecs = Time.TimeStringToSecs(duration);
return BanAccount(BanMode.Character, name, durationSecs, reason, author);
}
public BanReturn BanCharacter(string name, uint durationSecs, string reason, string author)
{
Player pBanned = Global.ObjAccessor.FindConnectedPlayerByName(name);
ObjectGuid guid;
uint duration_secs = Time.TimeStringToSecs(duration);
// Pick a player to ban if not online
if (!pBanned)
{
@@ -1771,7 +1775,7 @@ namespace Game
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_BAN);
stmt.AddValue(0, guid.GetCounter());
stmt.AddValue(1, (long)duration_secs);
stmt.AddValue(1, (long)durationSecs);
stmt.AddValue(2, author);
stmt.AddValue(3, reason);
trans.Append(stmt);