mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-31 17: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
|
||||
Logger.Log("Setting up config reloading...", LoggerLevelConfig.Instance);
|
||||
fileWatcher = new FileSystemWatcher
|
||||
if (Instance.ConfigReloading)
|
||||
{
|
||||
Path = Environment.CurrentDirectory,
|
||||
Filter = ConfigFileName,
|
||||
NotifyFilter = NotifyFilters.LastWrite, // only watch for writes to config file
|
||||
};
|
||||
Logger.Log("Setting up config reloading...", LoggerLevelConfig.Instance);
|
||||
fileWatcher = new FileSystemWatcher
|
||||
{
|
||||
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)
|
||||
|
@ -140,6 +143,8 @@ public class ServerSettings
|
|||
|
||||
public bool VitaCreateMode { get; set; }
|
||||
|
||||
public bool ConfigReloading { get; set; } = true;
|
||||
|
||||
#region Meta
|
||||
|
||||
[NotNull]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue