mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 05:13:40 +01:00
Merge branch 'master' into sestring_payloads_refactor
# Conflicts: # Dalamud/Dalamud.cs # Dalamud/Game/Internal/Gui/ChatGui.cs
This commit is contained in:
commit
68f3862efe
92 changed files with 5004 additions and 1803 deletions
|
|
@ -22,8 +22,6 @@ namespace Dalamud.Data
|
|||
/// This class provides data for Dalamud-internal features, but can also be used by plugins if needed.
|
||||
/// </summary>
|
||||
public class DataManager {
|
||||
private const string DataBaseUrl = "https://goaaats.github.io/ffxiv/tools/launcher/addons/Hooks/Data/";
|
||||
|
||||
public ReadOnlyDictionary<string, ushort> ServerOpCodes { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -53,20 +51,14 @@ namespace Dalamud.Data
|
|||
this.language = language;
|
||||
}
|
||||
|
||||
public async Task Initialize()
|
||||
public async Task Initialize(string baseDir)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.Verbose("Starting data download...");
|
||||
|
||||
using var client = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri(DataBaseUrl)
|
||||
};
|
||||
|
||||
var opCodeDict =
|
||||
JsonConvert.DeserializeObject<Dictionary<string, ushort>>(
|
||||
await client.GetStringAsync(DataBaseUrl + "serveropcode.json"));
|
||||
JsonConvert.DeserializeObject<Dictionary<string, ushort>>(File.ReadAllText(Path.Combine(baseDir, "UIRes", "serveropcode.json")));
|
||||
this.ServerOpCodes = new ReadOnlyDictionary<string, ushort>(opCodeDict);
|
||||
|
||||
Log.Verbose("Loaded {0} ServerOpCodes.", opCodeDict.Count);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue