Assert option and other fixes (#370)
* Add option to control assert logging * Fix logging errors from calling InitMultithreading before InvokeBeforeRun
This commit is contained in:
@@ -120,6 +120,9 @@ namespace Torch.Server
|
||||
[Arg("testplugin", "Path to a plugin to debug. For development use only.")]
|
||||
public string TestPlugin { get; set; }
|
||||
|
||||
[Arg("asserts", "Enable Keen's assert logging.")]
|
||||
public bool EnableAsserts { get; set; } = false;
|
||||
|
||||
[XmlIgnore]
|
||||
private string _path;
|
||||
|
||||
|
@@ -53,7 +53,7 @@ namespace Torch.Server
|
||||
internal bool FatalException { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public TorchServer(TorchConfig config = null)
|
||||
public TorchServer(TorchConfig config = null)
|
||||
{
|
||||
DedicatedInstance = new InstanceManager(this);
|
||||
AddManager(DedicatedInstance);
|
||||
@@ -63,6 +63,11 @@ namespace Torch.Server
|
||||
|
||||
var sessionManager = Managers.GetManager<ITorchSessionManager>();
|
||||
sessionManager.AddFactory(x => new MultiplayerManagerDedicated(this));
|
||||
|
||||
// Needs to be done at some point after MyVRageWindows.Init
|
||||
// where the debug listeners are registered
|
||||
if (!((TorchConfig)Config).EnableAsserts)
|
||||
MyDebug.Listeners.Clear();
|
||||
}
|
||||
|
||||
public bool HasRun { get => _hasRun; set => SetValue(ref _hasRun, value); }
|
||||
|
Reference in New Issue
Block a user