mirror of
https://github.com/rafi1212122/BLHX.Server.git
synced 2025-12-12 14:34:39 +01:00
JSON data table parsing stuff
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user