Add independent console option. Various random fixes
This commit is contained in:
@@ -111,8 +111,15 @@ quit";
|
||||
init.ContinueWith(x => _server.Start());
|
||||
|
||||
Log.Info("Showing UI");
|
||||
|
||||
#if !DEBUG
|
||||
if (!_config.IndependentConsole)
|
||||
{
|
||||
Console.SetOut(TextWriter.Null);
|
||||
NativeMethods.FreeConsole();
|
||||
}
|
||||
#endif
|
||||
|
||||
new TorchUI(_server).ShowDialog();
|
||||
}
|
||||
else
|
||||
|
@@ -72,10 +72,13 @@ namespace Torch.Server
|
||||
[Obsolete("Use vanilla reserved slot config")]
|
||||
public HashSet<ulong> ReservedPlayers { get; set; } = new HashSet<ulong>();
|
||||
|
||||
//Prevent reserved players being written to disk, but allow it to bre read
|
||||
//Prevent reserved players being written to disk, but allow it to be read
|
||||
//remove this when ReservedPlayers is removed
|
||||
private bool ShouldSerializeReservedPlayers() => false;
|
||||
|
||||
[Arg("console", "Keeps a separate console window open after the main UI loads.")]
|
||||
public bool IndependentConsole { get; set; } = false;
|
||||
|
||||
[XmlIgnore]
|
||||
private string _path;
|
||||
|
||||
|
@@ -195,8 +195,7 @@ namespace Torch.Server
|
||||
public override void Init(object gameInstance)
|
||||
{
|
||||
base.Init(gameInstance);
|
||||
var game = gameInstance as MySandboxGame;
|
||||
if (game != null && MySession.Static != null)
|
||||
if (gameInstance is MySandboxGame && MySession.Static != null)
|
||||
State = ServerState.Running;
|
||||
else
|
||||
State = ServerState.Stopped;
|
||||
|
@@ -273,8 +273,7 @@ namespace Torch
|
||||
MySessionLoader.LoadSingleplayerSession(sessionPath);
|
||||
return;
|
||||
}
|
||||
ulong checkpointSize;
|
||||
MyObjectBuilder_Checkpoint checkpoint = MyLocalCache.LoadCheckpoint(sessionPath, out checkpointSize);
|
||||
MyObjectBuilder_Checkpoint checkpoint = MyLocalCache.LoadCheckpoint(sessionPath, out ulong checkpointSize);
|
||||
if (MySession.IsCompatibleVersion(checkpoint))
|
||||
{
|
||||
if (MyWorkshop.DownloadWorldModsBlocking(checkpoint.Mods, null).Success)
|
||||
|
Reference in New Issue
Block a user