Merge pull request #3106 from Terrabade/general-devel

Allow for reloading of player bans
This commit is contained in:
Lucas Nicodemus 2025-05-24 19:51:04 +09:00 committed by GitHub
commit 77f9092303
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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>