diff --git a/src/Luban.Job.Cfg/Source/Cache/FileRecordCacheManager.cs b/src/Luban.Job.Cfg/Source/Cache/FileRecordCacheManager.cs index c90b373..6d1438d 100644 --- a/src/Luban.Job.Cfg/Source/Cache/FileRecordCacheManager.cs +++ b/src/Luban.Job.Cfg/Source/Cache/FileRecordCacheManager.cs @@ -73,6 +73,7 @@ namespace Luban.Job.Cfg.Cache } private readonly ConcurrentDictionary<(string TableFullName, string DataType), (DefTable Table, List Records, string Md5)> _tableCaches = new(); + public bool TryGetRecordOutputData(DefTable table, List records, string dataType, out string md5) { if (_tableCaches.TryGetValue((table.FullName, dataType), out var cacheInfo)) @@ -82,6 +83,7 @@ namespace Luban.Job.Cfg.Cache if (cacheAss.TimeZone == curAss.TimeZone && cacheAss.TargetPatch == null && curAss.TargetPatch == null && !cacheAss.NeedL10nTextTranslate && !curAss.NeedL10nTextTranslate + && cacheAss.OutputCompactJson == curAss.OutputCompactJson && records.Count == cacheInfo.Records.Count && records.SequenceEqual(cacheInfo.Records)) { md5 = cacheInfo.Md5; diff --git a/src/Luban.Job.Cfg/Source/Defs/DefAssembly.cs b/src/Luban.Job.Cfg/Source/Defs/DefAssembly.cs index f7d3a94..962a87b 100644 --- a/src/Luban.Job.Cfg/Source/Defs/DefAssembly.cs +++ b/src/Luban.Job.Cfg/Source/Defs/DefAssembly.cs @@ -49,6 +49,8 @@ namespace Luban.Job.Cfg.Defs public TimeZoneInfo TimeZone { get; } + public bool OutputCompactJson { get; init; } + public DefAssembly(string patchName, TimeZoneInfo timezone, List excludeTags, IAgent agent) { this._patchName = patchName; diff --git a/src/Luban.Job.Cfg/Source/GenArgs.cs b/src/Luban.Job.Cfg/Source/GenArgs.cs index 62269d8..9abe87f 100644 --- a/src/Luban.Job.Cfg/Source/GenArgs.cs +++ b/src/Luban.Job.Cfg/Source/GenArgs.cs @@ -29,6 +29,9 @@ namespace Luban.Job.Cfg [Option("data_file_extension", Required = false, HelpText = "data file name extension. default choose by gen_type")] public string DataFileExtension { get; set; } + [Option("output_compact_json", Required = false, HelpText = "output compact json data. drop blank characters. ")] + public bool OutputCompactJson { get; set; } + [Option('s', "service", Required = true, HelpText = "service")] public string Service { get; set; } diff --git a/src/Luban.Job.Cfg/Source/JobController.cs b/src/Luban.Job.Cfg/Source/JobController.cs index 4260262..8972206 100644 --- a/src/Luban.Job.Cfg/Source/JobController.cs +++ b/src/Luban.Job.Cfg/Source/JobController.cs @@ -143,7 +143,8 @@ namespace Luban.Job.Cfg var excludeTags = args.ExportExcludeTags.Split(',').Select(t => t.Trim().ToLowerInvariant()).Where(t => !string.IsNullOrEmpty(t)).ToList(); var ass = new DefAssembly(args.PatchName, timeZoneInfo, excludeTags, agent) { - UseUnityVectors = args.UseUnityVectors + UseUnityVectors = args.UseUnityVectors, + OutputCompactJson = args.OutputCompactJson, }; ass.Load(args.Service, rawDefines); diff --git a/src/Luban.Job.Cfg/Source/Utils/DataExporterUtil.cs b/src/Luban.Job.Cfg/Source/Utils/DataExporterUtil.cs index d2912d3..25aa1d4 100644 --- a/src/Luban.Job.Cfg/Source/Utils/DataExporterUtil.cs +++ b/src/Luban.Job.Cfg/Source/Utils/DataExporterUtil.cs @@ -45,7 +45,7 @@ namespace Luban.Job.Cfg.Utils var ss = new MemoryStream(); var jsonWriter = new Utf8JsonWriter(ss, new JsonWriterOptions() { - Indented = true, + Indented = !table.Assembly.OutputCompactJson, SkipValidation = false, Encoder = System.Text.Encodings.Web.JavaScriptEncoder.Create(System.Text.Unicode.UnicodeRanges.All), }); diff --git a/src/LubanAssistant/LubanAssistant.csproj b/src/LubanAssistant/LubanAssistant.csproj index a56cff4..3d26322 100644 --- a/src/LubanAssistant/LubanAssistant.csproj +++ b/src/LubanAssistant/LubanAssistant.csproj @@ -26,18 +26,41 @@ false LubanAssistant LubanAssistant - 3 v4.7.2 VSTO40 - true - HomeSite + False + true + publish\ + + zh-chs + 1.0.0.3 + true + false + 0 + days + LubanAssistant + focus creative games + https://github.com/focus-creative-games/luban + LubanAssistant + + 3 + + False + Microsoft .NET Framework 4.7.2 %28x86 和 x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + False - Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 and x64%29 + Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 和 x64%29 true @@ -612,6 +635,9 @@ Resources.resx + + + @@ -667,10 +693,10 @@ true - LubanAssistant_TemporaryKey.pfx + focus_creative_games.pfx - DB8575295993B72B55091F842E5704CA3A263CD5 + 90F0DE4632F75E2AABB577005E67BDCB425BF442 @@ -681,8 +707,8 @@ - - + +