17 lines
No EOL
542 B
C#
17 lines
No EOL
542 B
C#
using System.Text.Json.Nodes;
|
|
|
|
namespace RC2BotArchiver;
|
|
|
|
public static class FixCRF2Archive
|
|
{
|
|
public static void FixIt()
|
|
{
|
|
foreach (var directory in Directory.EnumerateDirectories("robots"))
|
|
{
|
|
var meta = File.ReadAllText(Path.Combine(directory, "robotData.json"));
|
|
var metadata = JsonNode.Parse(meta);
|
|
var data = metadata!["data"]!.AsValue().GetValue<string>();
|
|
File.WriteAllBytes(Path.Combine(directory, "robot.rc2"), Convert.FromBase64String(data));
|
|
}
|
|
}
|
|
} |