Add player bans to server reload
This commit is contained in:
parent
eb45b31c58
commit
55e80e044c
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)"));
|
throw new Exception(GetString("Could not find a database library (probably Sqlite3.dll)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
EnsureBansCollection();
|
UpdateBans();
|
||||||
TryConvertBans();
|
TryConvertBans();
|
||||||
|
|
||||||
OnBanValidate += BanValidateCheck;
|
OnBanValidate += BanValidateCheck;
|
||||||
|
|
@ -90,14 +90,11 @@ namespace TShockAPI.DB
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ensures the <see cref="_bans"/> collection is ready to use.
|
/// Updates the <see cref="_bans"/> collection from database.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void EnsureBansCollection()
|
public void UpdateBans()
|
||||||
{
|
{
|
||||||
if (_bans == null)
|
_bans = RetrieveAllBans().ToDictionary(b => b.TicketNumber);
|
||||||
{
|
|
||||||
_bans = RetrieveAllBans().ToDictionary(b => b.TicketNumber);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -607,6 +607,7 @@ namespace TShockAPI
|
||||||
TShock.ItemBans.DataModel.UpdateItemBans();
|
TShock.ItemBans.DataModel.UpdateItemBans();
|
||||||
TShock.ProjectileBans.UpdateBans();
|
TShock.ProjectileBans.UpdateBans();
|
||||||
TShock.TileBans.UpdateBans();
|
TShock.TileBans.UpdateBans();
|
||||||
|
TShock.Bans.UpdateBans();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue