Merge pull request #3106 from Terrabade/general-devel
Allow for reloading of player bans
This commit is contained in:
commit
77f9092303
2 changed files with 5 additions and 7 deletions
|
|
@ -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,15 +90,12 @@ 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()
|
||||
{
|
||||
if (_bans == null)
|
||||
public void UpdateBans()
|
||||
{
|
||||
_bans = RetrieveAllBans().ToDictionary(b => b.TicketNumber);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts bans from the old ban system to the new.
|
||||
|
|
|
|||
|
|
@ -607,6 +607,7 @@ namespace TShockAPI
|
|||
TShock.ItemBans.DataModel.UpdateItemBans();
|
||||
TShock.ProjectileBans.UpdateBans();
|
||||
TShock.TileBans.UpdateBans();
|
||||
TShock.Bans.UpdateBans();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue