changed CLI settings
This commit is contained in:
parent
5d88ad49c0
commit
c0e3eccdc2
@ -13,23 +13,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DTLib.Web" Version="1.2.1" />
|
<PackageReference Include="DTLib.Web" Version="1.2.2" />
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Remove="data\**" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Remove="data\**" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Remove="data\**" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="data\**" />
|
|
||||||
<None Remove="Properties\launchSettings.json" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -28,7 +28,11 @@ public class Program
|
|||||||
{
|
{
|
||||||
private static readonly IOPath _configPath = "./config.dtsod";
|
private static readonly IOPath _configPath = "./config.dtsod";
|
||||||
private static Config _config = new();
|
private static Config _config = new();
|
||||||
private static readonly ILogger _loggerRoot = new ConsoleLogger();
|
|
||||||
|
private static readonly ILogger _loggerRoot = new CompositeLogger(
|
||||||
|
new ConsoleLogger(),
|
||||||
|
new FileLogger("logs", "ParadoxSaveParser.WebAPI"));
|
||||||
|
|
||||||
private static readonly CancellationTokenSource _mainCancel = new();
|
private static readonly CancellationTokenSource _mainCancel = new();
|
||||||
private static ConcurrentDictionary<string, SaveFileMetadata> _saveMetadataStorage = new();
|
private static ConcurrentDictionary<string, SaveFileMetadata> _saveMetadataStorage = new();
|
||||||
|
|
||||||
@ -44,9 +48,11 @@ public class Program
|
|||||||
{
|
{
|
||||||
Console.InputEncoding = Encoding.UTF8;
|
Console.InputEncoding = Encoding.UTF8;
|
||||||
Console.OutputEncoding = Encoding.UTF8;
|
Console.OutputEncoding = Encoding.UTF8;
|
||||||
|
Console.CursorVisible = false;
|
||||||
ContextLogger logger = new ContextLogger(nameof(Main), _loggerRoot);
|
ContextLogger logger = new ContextLogger(nameof(Main), _loggerRoot);
|
||||||
Console.CancelKeyPress += (_, _) =>
|
Console.CancelKeyPress += (_, e) =>
|
||||||
{
|
{
|
||||||
|
e.Cancel = true;
|
||||||
logger.LogInfo("Ctrl+C Pressed");
|
logger.LogInfo("Ctrl+C Pressed");
|
||||||
_mainCancel.Cancel();
|
_mainCancel.Cancel();
|
||||||
};
|
};
|
||||||
@ -104,7 +110,8 @@ public class Program
|
|||||||
throw new Exception("Guid collision!");
|
throw new Exception("Guid collision!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReSharper disable once NotAccessedPositionalProperty.Global
|
||||||
public record ErrorMessage(string errorMessage);
|
public record ErrorMessage(string errorMessage);
|
||||||
|
|
||||||
private static async Task<HttpStatusCode>ReturnResponse(HttpListenerContext ctx, HttpStatusCode statusCode, object response)
|
private static async Task<HttpStatusCode>ReturnResponse(HttpListenerContext ctx, HttpStatusCode statusCode, object response)
|
||||||
@ -187,7 +194,7 @@ public class Program
|
|||||||
new ErrorMessage("Invalid save format: no 'gamestate' file found"));
|
new ErrorMessage("Invalid save format: no 'gamestate' file found"));
|
||||||
|
|
||||||
string extractedGamestatePath = PathHelper.GetSaveFilePath(meta.id) + ".gamestate";
|
string extractedGamestatePath = PathHelper.GetSaveFilePath(meta.id) + ".gamestate";
|
||||||
zipEntry.ExtractToFile(extractedGamestatePath);
|
zipEntry.ExtractToFile(extractedGamestatePath, true);
|
||||||
var gamestateStream = File.OpenRead(extractedGamestatePath);
|
var gamestateStream = File.OpenRead(extractedGamestatePath);
|
||||||
|
|
||||||
meta.status = SaveFileProcessingStatus.Parsing;
|
meta.status = SaveFileProcessingStatus.Parsing;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user