diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index fdb37420..36ec35de 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -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; diff --git a/TShockAPI/SaveManager.cs b/TShockAPI/SaveManager.cs index 5d5e444c..3b001a0f 100644 --- a/TShockAPI/SaveManager.cs +++ b/TShockAPI/SaveManager.cs @@ -48,16 +48,19 @@ namespace TShockAPI /// 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()); + } } } diff --git a/docs/src/config.md b/docs/src/config.md index f62c93fa..4d747eab 100644 --- a/docs/src/config.md +++ b/docs/src/config.md @@ -42,6 +42,7 @@ An example configuration file is below. "KickOnMediumcoreDeath": false, "BanOnMediumcoreDeath": false, "AutoSave": true, + "AnnounceSave": true, "MaximumLoginAttempts": 3, "RconPassword": "", "RconPort": 7777, @@ -141,6 +142,11 @@ The following is the official documentation for the configuration file: **Description:** Enable/Disable Terrarias built in auto save **Default:** "True" +## AnnounceSave +**Type:** Boolean +**Description:** Enable/Disable save announcements +**Default:** "True" + ## BackupInterval **Type:** Int32 **Description:** Backup frequency in minutes. So, a value of 60 = 60 minutes. Backups are stored in the \tshock\backups folder.