Добавьте файлы проекта.

This commit is contained in:
Давид Чернопятов
2024-02-01 01:21:56 +02:00
parent ff5a5e1a58
commit e0ef2c6a46
189 changed files with 14229 additions and 0 deletions
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SteamLibForked\SteamLibForked.csproj" />
</ItemGroup>
</Project>
+51
View File
@@ -0,0 +1,51 @@
using Newtonsoft.Json;
using SteamLib.Utility.MaFiles;
var currentPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
if (currentPath != null)
Environment.CurrentDirectory = currentPath;
Console.WriteLine(currentPath);
foreach (var path in args)
{
if (Path.Exists(path) == false)
{
Console.WriteLine($"NOT VALID PATH: '{path}'");
continue;
}
Console.WriteLine("Reading: " + path);
try
{
var text = File.ReadAllText(path);
var maf = MafileSerializer.Deserialize(text, out _);
var legacy = MafileSerializer.SerializeLegacy(maf, Formatting.Indented);
var name = Path.GetFileNameWithoutExtension(path);
Write(legacy, name);
Console.WriteLine("DONE: " + name);
}
catch (Exception ex)
{
Console.WriteLine($"ERROR: {ex.Message}");
Console.WriteLine(ex);
}
finally
{
Console.WriteLine("-----------------------------------------");
}
}
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
void Write(string maf, string name)
{
var path = Path.Combine(name + "_legacy.mafile");
File.WriteAllText(path, maf);
}