diff --git a/Torch.Server/Managers/InstanceManager.cs b/Torch.Server/Managers/InstanceManager.cs index a4e4a9e..0a33755 100644 --- a/Torch.Server/Managers/InstanceManager.cs +++ b/Torch.Server/Managers/InstanceManager.cs @@ -134,7 +134,7 @@ namespace Torch.Server.Managers worldPath = DedicatedConfig.Worlds.First().WorldPath; else // make sure we won't end up with a file path when we expect it to be a directory - worldPath = Path.EndsInDirectorySeparator(worldPath) ? worldPath : Path.GetDirectoryName(worldPath); + worldPath = worldPath.EndsWith(".sbc") ? Path.GetDirectoryName(worldPath) : worldPath; SelectWorld(worldPath, false); @@ -235,7 +235,7 @@ namespace Torch.Server.Managers try { - MyObjectBuilderSerializer.DeserializeXML(sandboxPath, out MyObjectBuilder_Checkpoint checkpoint, out ulong sizeInBytes); + MyObjectBuilderSerializerKeen.DeserializeXML(sandboxPath, out MyObjectBuilder_Checkpoint checkpoint, out ulong sizeInBytes); if (checkpoint == null) { Log.Error($"Failed to load {DedicatedConfig.LoadWorld}, checkpoint null ({sizeInBytes} bytes, instance {Torch.Config.InstancePath})"); @@ -368,14 +368,14 @@ namespace Torch.Server.Managers public void LoadSandbox() { - if (!MyObjectBuilderSerializer.DeserializeXML(_checkpointPath, out MyObjectBuilder_Checkpoint checkpoint)) + if (!MyObjectBuilderSerializerKeen.DeserializeXML(_checkpointPath, out MyObjectBuilder_Checkpoint checkpoint)) throw new SerializationException("Error reading checkpoint, see keen log for details"); Checkpoint = new CheckpointViewModel(checkpoint); // migrate old saves if (File.Exists(_worldConfigPath)) { - if (!MyObjectBuilderSerializer.DeserializeXML(_worldConfigPath, out MyObjectBuilder_WorldConfiguration worldConfig)) + if (!MyObjectBuilderSerializerKeen.DeserializeXML(_worldConfigPath, out MyObjectBuilder_WorldConfiguration worldConfig)) throw new SerializationException("Error reading settings, see keen log for details"); WorldConfiguration = new WorldConfigurationViewModel(worldConfig); }