static void Main() { string input = File.ReadAllText("data.json"); Console.Write(DataProcess.StripComments(input)); Console.ReadKey(); }
public static void Save_CombatGameConstants_Data(MessageCenterMessage message) { if (message is DataManagerRequestCompleteMessage <string> msg && msg.Resource != null && msg.ResourceType == BattleTechResourceType.CombatGameConstants) { try { string json = Regex.Replace(DataProcess.StripComments(msg.Resource), @"(?<=\n)\s+", ""); // 48K to 32K fastJSON.JSON.Parse(json); CombatConstantJSON = ZipStr(json); // 32K to 8K LoadMoraleResources = typeof(CombatGameConstants).GetMethod("LoadMoraleResources", NonPublic | Instance); LoadMaintenanceResources = typeof(CombatGameConstants).GetMethod("LoadMaintenanceResources", NonPublic | Instance); } catch (Exception ex) { CombatConstantJSON = null; Warn(ex); } } }