Add player bans to server reload

This commit is contained in:
Terrabade 2025-05-24 11:21:03 +01:00
parent eb45b31c58
commit 55e80e044c
2 changed files with 5 additions and 7 deletions

View file

@ -82,7 +82,7 @@ namespace TShockAPI.DB
throw new Exception(GetString("Could not find a database library (probably Sqlite3.dll)"));
}
EnsureBansCollection();
UpdateBans();
TryConvertBans();
OnBanValidate += BanValidateCheck;
@ -90,14 +90,11 @@ namespace TShockAPI.DB
}
/// <summary>
/// Ensures the <see cref="_bans"/> collection is ready to use.
/// Updates the <see cref="_bans"/> collection from database.
/// </summary>
private void EnsureBansCollection()
public void UpdateBans()
{
if (_bans == null)
{
_bans = RetrieveAllBans().ToDictionary(b => b.TicketNumber);
}
_bans = RetrieveAllBans().ToDictionary(b => b.TicketNumber);
}
/// <summary>

View file

@ -607,6 +607,7 @@ namespace TShockAPI
TShock.ItemBans.DataModel.UpdateItemBans();
TShock.ProjectileBans.UpdateBans();
TShock.TileBans.UpdateBans();
TShock.Bans.UpdateBans();
}
/// <summary>