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:
KazWolfe 2023-10-05 10:01:03 -07:00 committed by GitHub
parent 59606ff854
commit 2083ccda00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 417 additions and 221 deletions

View file

@ -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; }