Add AnnounceSave option
This commit is contained in:
parent
0878900ea5
commit
6fac82ee2c
3 changed files with 19 additions and 9 deletions
|
|
@ -80,6 +80,7 @@ namespace TShockAPI
|
|||
[Description("Bans a hardcore player on death.")] public bool BanOnMediumcoreDeath;
|
||||
|
||||
[Description("Enable/disable Terraria's built in auto save.")] public bool AutoSave = true;
|
||||
[Description("Enable/disable save announcements.")] public bool AnnounceSave = true;
|
||||
|
||||
[Description("Number of failed login attempts before kicking the player.")] public int MaximumLoginAttempts = 3;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,16 +48,19 @@ namespace TShockAPI
|
|||
/// </summary>
|
||||
public void OnSaveWorld(WorldSaveEventArgs args)
|
||||
{
|
||||
// Protect against internal errors causing save failures
|
||||
// These can be caused by an unexpected error such as a bad or out of date plugin
|
||||
try
|
||||
if (TShock.Config.AnnounceSave)
|
||||
{
|
||||
TShock.Utils.Broadcast("Saving world. Momentary lag might result from this.", Color.Red);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error("World saved notification failed");
|
||||
Log.Error(ex.ToString());
|
||||
// Protect against internal errors causing save failures
|
||||
// These can be caused by an unexpected error such as a bad or out of date plugin
|
||||
try
|
||||
{
|
||||
TShock.Utils.Broadcast("Saving world. Momentary lag might result from this.", Color.Red);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error("World saved notification failed");
|
||||
Log.Error(ex.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue