Merge pull request #635 from CyberShadow/announce-save
Add AnnounceSave option
This commit is contained in:
commit
4fd766a505
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("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 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;
|
[Description("Number of failed login attempts before kicking the player.")] public int MaximumLoginAttempts = 3;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@ namespace TShockAPI
|
||||||
/// SaveWorld event handler which notifies users that the server may lag
|
/// SaveWorld event handler which notifies users that the server may lag
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void OnSaveWorld(WorldSaveEventArgs args)
|
public void OnSaveWorld(WorldSaveEventArgs args)
|
||||||
|
{
|
||||||
|
if (TShock.Config.AnnounceSave)
|
||||||
{
|
{
|
||||||
// Protect against internal errors causing save failures
|
// Protect against internal errors causing save failures
|
||||||
// These can be caused by an unexpected error such as a bad or out of date plugin
|
// These can be caused by an unexpected error such as a bad or out of date plugin
|
||||||
|
|
@ -60,6 +62,7 @@ namespace TShockAPI
|
||||||
Log.Error(ex.ToString());
|
Log.Error(ex.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Saves the map data
|
/// Saves the map data
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ An example configuration file is below.
|
||||||
"KickOnMediumcoreDeath": false,
|
"KickOnMediumcoreDeath": false,
|
||||||
"BanOnMediumcoreDeath": false,
|
"BanOnMediumcoreDeath": false,
|
||||||
"AutoSave": true,
|
"AutoSave": true,
|
||||||
|
"AnnounceSave": true,
|
||||||
"MaximumLoginAttempts": 3,
|
"MaximumLoginAttempts": 3,
|
||||||
"RconPassword": "",
|
"RconPassword": "",
|
||||||
"RconPort": 7777,
|
"RconPort": 7777,
|
||||||
|
|
@ -141,6 +142,11 @@ The following is the official documentation for the configuration file:
|
||||||
**Description:** Enable/Disable Terrarias built in auto save
|
**Description:** Enable/Disable Terrarias built in auto save
|
||||||
**Default:** "True"
|
**Default:** "True"
|
||||||
|
|
||||||
|
## AnnounceSave
|
||||||
|
**Type:** Boolean
|
||||||
|
**Description:** Enable/Disable save announcements
|
||||||
|
**Default:** "True"
|
||||||
|
|
||||||
## BackupInterval
|
## BackupInterval
|
||||||
**Type:** Int32
|
**Type:** Int32
|
||||||
**Description:** Backup frequency in minutes. So, a value of 60 = 60 minutes. Backups are stored in the \tshock\backups folder.
|
**Description:** Backup frequency in minutes. So, a value of 60 = 60 minutes. Backups are stored in the \tshock\backups folder.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue