From 10d91031dd53bf207fa68ef62e714f459bdc171c Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Tue, 28 Apr 2020 18:03:37 +0200 Subject: [PATCH] feat: add ClientOpCodes dict to DataManager --- Dalamud/Data/DataManager.cs | 21 +++++++++++++++++---- Dalamud/Interface/AssetManager.cs | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Dalamud/Data/DataManager.cs b/Dalamud/Data/DataManager.cs index f90f5ea22..090a522c1 100644 --- a/Dalamud/Data/DataManager.cs +++ b/Dalamud/Data/DataManager.cs @@ -22,7 +22,14 @@ namespace Dalamud.Data /// This class provides data for Dalamud-internal features, but can also be used by plugins if needed. /// public class DataManager { + /// + /// OpCodes sent by the server to the client. + /// public ReadOnlyDictionary ServerOpCodes { get; private set; } + /// + /// OpCodes sent by the client to the server. + /// + public ReadOnlyDictionary ClientOpCodes { get; private set; } /// /// An object which gives access to any of the game's sheet data. @@ -55,13 +62,19 @@ namespace Dalamud.Data { try { - Log.Verbose("Starting data download..."); + Log.Verbose("Starting data load..."); - var opCodeDict = + var zoneOpCodeDict = JsonConvert.DeserializeObject>(File.ReadAllText(Path.Combine(baseDir, "UIRes", "serveropcode.json"))); - this.ServerOpCodes = new ReadOnlyDictionary(opCodeDict); + ServerOpCodes = new ReadOnlyDictionary(zoneOpCodeDict); - Log.Verbose("Loaded {0} ServerOpCodes.", opCodeDict.Count); + Log.Verbose("Loaded {0} ServerOpCodes.", zoneOpCodeDict.Count); + + var clientOpCodeDict = + JsonConvert.DeserializeObject>(File.ReadAllText(Path.Combine(baseDir, "UIRes", "clientopcode.json"))); + ClientOpCodes = new ReadOnlyDictionary(clientOpCodeDict); + + Log.Verbose("Loaded {0} ClientOpCodes.", clientOpCodeDict.Count); var luminaOptions = new LuminaOptions diff --git a/Dalamud/Interface/AssetManager.cs b/Dalamud/Interface/AssetManager.cs index b2e2311d5..2b1d61adf 100644 --- a/Dalamud/Interface/AssetManager.cs +++ b/Dalamud/Interface/AssetManager.cs @@ -14,6 +14,7 @@ namespace Dalamud.Interface private static readonly Dictionary AssetDictionary = new Dictionary { {AssetStoreUrl + "UIRes/serveropcode.json", "UIRes/serveropcode.json" }, + {AssetStoreUrl + "UIRes/clientopcode.json", "UIRes/clientopcode.json" }, {AssetStoreUrl + "UIRes/NotoSansCJKjp-Medium.otf", "UIRes/NotoSansCJKjp-Medium.otf" }, {AssetStoreUrl + "UIRes/logo.png", "UIRes/logo.png" }, {AssetStoreUrl + "UIRes/loc/dalamud/dalamud_de.json", "UIRes/loc/dalamud/dalamud_de.json" },