JSON data table parsing stuff

This commit is contained in:
Kyle Belanger
2024-02-19 17:35:16 -05:00
parent 27acfdff08
commit f33a60d33c
16 changed files with 1392296 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
using BLHX.Server.Common.Utils;
using BLHX.Server.Common.Data;
using BLHX.Server.Common.Utils;
namespace BLHX.Server.Game.Commands;
@@ -10,11 +11,14 @@ public class TestCommand : Command
[Argument("type")]
public string? Type { get; set; }
[Argument("verbose")]
public string? Verbose { get; set; }
[Argument("count")]
public string? Count { get; set; }
[Argument("verbose")]
public string? Verbose { get; set; }
[Argument("value")]
public string? Value { get; set; }
public override void Execute(Dictionary<string, string> args)
{
@@ -25,6 +29,9 @@ public class TestCommand : Command
case "gacha":
TestGacha(Parse(Count, 1000000), Parse(Verbose, false));
break;
case "lookup":
LookupShip(Parse(Value, 1));
break;
default:
Logger.c.Warn("Unknown test type");
break;
@@ -59,4 +66,14 @@ public class TestCommand : Command
Logger.c.Log($"{RarityStrings[i]}: {counts[i]} ({percentage}%)");
}
}
void LookupShip(int id)
{
ShipDataStatistics? ship = Data.ShipDataStatistics.GetValueOrDefault(id);
if (ship != null)
Logger.c.Log($"Ship {id} ({ship.EnglishName}):\n{JSON.Stringify(ship)}");
else
Logger.c.Warn($"Ship {id} not found");
}
}

View File

@@ -1,5 +1,6 @@
using System.Net;
using System.Net.Sockets;
using BLHX.Server.Common.Data;
using BLHX.Server.Common.Utils;
namespace BLHX.Server.Game

View File

@@ -1,7 +1,7 @@
using BLHX.Server.Common.Proto.p10;
using BLHX.Server.Common.Database;
using BLHX.Server.Common.Proto;
using BLHX.Server.Common.Utils;
using BLHX.Server.Common.Data;
namespace BLHX.Server.Game.Handlers
{