mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 13:23:40 +01:00
Remove internal dependencies on opcodes (#1464)
- Removes the opcode lists from internal API entirely - Move NetworkHandlers to use packet handler sigs - Remove opcode data from NetworkMonitorWidget
This commit is contained in:
parent
59606ff854
commit
2083ccda00
7 changed files with 417 additions and 221 deletions
|
|
@ -37,26 +37,10 @@ internal sealed class DataManager : IDisposable, IServiceType, IDataManager
|
|||
{
|
||||
this.Language = (ClientLanguage)dalamud.StartInfo.Language;
|
||||
|
||||
// Set up default values so plugins do not null-reference when data is being loaded.
|
||||
this.ClientOpCodes = this.ServerOpCodes = new ReadOnlyDictionary<string, ushort>(new Dictionary<string, ushort>());
|
||||
|
||||
var baseDir = dalamud.AssetDirectory.FullName;
|
||||
try
|
||||
{
|
||||
Log.Verbose("Starting data load...");
|
||||
|
||||
var zoneOpCodeDict = JsonConvert.DeserializeObject<Dictionary<string, ushort>>(
|
||||
File.ReadAllText(Path.Combine(baseDir, "UIRes", "serveropcode.json")))!;
|
||||
this.ServerOpCodes = new ReadOnlyDictionary<string, ushort>(zoneOpCodeDict);
|
||||
|
||||
Log.Verbose("Loaded {0} ServerOpCodes.", zoneOpCodeDict.Count);
|
||||
|
||||
var clientOpCodeDict = JsonConvert.DeserializeObject<Dictionary<string, ushort>>(
|
||||
File.ReadAllText(Path.Combine(baseDir, "UIRes", "clientopcode.json")))!;
|
||||
this.ClientOpCodes = new ReadOnlyDictionary<string, ushort>(clientOpCodeDict);
|
||||
|
||||
Log.Verbose("Loaded {0} ClientOpCodes.", clientOpCodeDict.Count);
|
||||
|
||||
|
||||
using (Timings.Start("Lumina Init"))
|
||||
{
|
||||
var luminaOptions = new LuminaOptions
|
||||
|
|
@ -130,17 +114,6 @@ internal sealed class DataManager : IDisposable, IServiceType, IDataManager
|
|||
/// <inheritdoc/>
|
||||
public ClientLanguage Language { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of server opcodes.
|
||||
/// </summary>
|
||||
public ReadOnlyDictionary<string, ushort> ServerOpCodes { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of client opcodes.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public ReadOnlyDictionary<string, ushort> ClientOpCodes { get; private set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public GameData GameData { get; private set; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue