mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-03 02:28:39 +00:00
Add option to disable config reloading
This commit is contained in:
parent
daba7b9633
commit
23eaed40b7
1 changed files with 13 additions and 8 deletions
|
@ -69,17 +69,20 @@ public class ServerSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up reloading
|
// Set up reloading
|
||||||
Logger.Log("Setting up config reloading...", LoggerLevelConfig.Instance);
|
if (Instance.ConfigReloading)
|
||||||
fileWatcher = new FileSystemWatcher
|
|
||||||
{
|
{
|
||||||
Path = Environment.CurrentDirectory,
|
Logger.Log("Setting up config reloading...", LoggerLevelConfig.Instance);
|
||||||
Filter = ConfigFileName,
|
fileWatcher = new FileSystemWatcher
|
||||||
NotifyFilter = NotifyFilters.LastWrite, // only watch for writes to config file
|
{
|
||||||
};
|
Path = Environment.CurrentDirectory,
|
||||||
|
Filter = ConfigFileName,
|
||||||
|
NotifyFilter = NotifyFilters.LastWrite, // only watch for writes to config file
|
||||||
|
};
|
||||||
|
|
||||||
fileWatcher.Changed += onConfigChanged; // add event handler
|
fileWatcher.Changed += onConfigChanged; // add event handler
|
||||||
|
|
||||||
fileWatcher.EnableRaisingEvents = true; // begin watching
|
fileWatcher.EnableRaisingEvents = true; // begin watching
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void onConfigChanged(object sender, FileSystemEventArgs e)
|
private static void onConfigChanged(object sender, FileSystemEventArgs e)
|
||||||
|
@ -140,6 +143,8 @@ public class ServerSettings
|
||||||
|
|
||||||
public bool VitaCreateMode { get; set; }
|
public bool VitaCreateMode { get; set; }
|
||||||
|
|
||||||
|
public bool ConfigReloading { get; set; } = true;
|
||||||
|
|
||||||
#region Meta
|
#region Meta
|
||||||
|
|
||||||
[NotNull]
|
[NotNull]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue