Add config option for saving the world when last player exists
This commit is contained in:
parent
97d2894773
commit
7d9c960b0f
2 changed files with 5 additions and 1 deletions
|
|
@ -394,6 +394,9 @@ namespace TShockAPI
|
||||||
[Description("The maximum allowable MP, before equipment buffs.")]
|
[Description("The maximum allowable MP, before equipment buffs.")]
|
||||||
public int MaxMP = 200;
|
public int MaxMP = 200;
|
||||||
|
|
||||||
|
[Description("Determines if the server should save the world if the last player exits.")]
|
||||||
|
public bool SaveWorldOnLastPlayerExit = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reads a configuration file from a given path
|
/// Reads a configuration file from a given path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1026,7 +1026,8 @@ namespace TShockAPI
|
||||||
// The last player will leave after this hook is executed.
|
// The last player will leave after this hook is executed.
|
||||||
if (Utils.ActivePlayers() == 1)
|
if (Utils.ActivePlayers() == 1)
|
||||||
{
|
{
|
||||||
SaveManager.Instance.SaveWorld();
|
if (Config.SaveWorldOnLastPlayerExit)
|
||||||
|
SaveManager.Instance.SaveWorld();
|
||||||
SetConsoleTitle(true);
|
SetConsoleTitle(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue