feat: 解决 2026.10.06 Opcode 冲突与去重映射,补齐 M4 主动发包配置与构建分发

This commit is contained in:
2026-10-14 00:31:37 +08:00
parent 8008519d8b
commit 2e1f00087a
3 changed files with 4860 additions and 0 deletions
+1
View File
@@ -21,6 +21,7 @@
<Private>false</Private> <Private>false</Private>
</Reference> </Reference>
<None Update="ICRebuild.json" CopyToOutputDirectory="PreserveNewest" /> <None Update="ICRebuild.json" CopyToOutputDirectory="PreserveNewest" />
<None Update="opcodes.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup> </ItemGroup>
<Target Name="ValidateRuntime" BeforeTargets="ResolveReferences"> <Target Name="ValidateRuntime" BeforeTargets="ResolveReferences">
<Error Condition="!Exists('$(HooksDevPath)\Dalamud.dll')" Text="HooksDevPath must contain the Dalamud API 15 runtime DLLs." /> <Error Condition="!Exists('$(HooksDevPath)\Dalamud.dll')" Text="HooksDevPath must contain the Dalamud API 15 runtime DLLs." />
+31
View File
@@ -1083,5 +1083,36 @@ Test("stage 3 M4 ActivePacketDispatcher enforces rate limit, queue bounds, sessi
Check(dispatcher.Pump(session,NativeSender)?.Id==tx5); Check(dispatcher.Pump(session,NativeSender)?.Id==tx5);
Check(dispatcher.Snapshot().Single(s=>s.Id==tx5) is {State:SendTransactionState.RejectedNative,NativeResult:0}); Check(dispatcher.Snapshot().Single(s=>s.Id==tx5) is {State:SendTransactionState.RejectedNative,NativeResult:0});
}); });
Test("opcodes.json loads cleanly without conflicts and resolves dual-version audited opcodes",()=>
{
var path=Path.Combine(AppContext.BaseDirectory,"opcodes.json");
if(!File.Exists(path)) path=Path.Combine(AppContext.BaseDirectory,"..","..","..","opcodes.json");
if(!File.Exists(path)) path="opcodes.json";
Check(File.Exists(path));
var json=File.ReadAllText(path);
// 2026.10.06.0000.0000 audit verification
var mapAudited=new OpcodeMap();
mapAudited.Load(json,PacketParser.AuditedClientVersion,"local");
Check(mapAudited.ResolveOpcode(PacketParser.AuditedClientVersion,PacketDirection.Down,"DOWN_ActorControlTarget")==200);
Check(mapAudited.ResolveOpcode(PacketParser.AuditedClientVersion,PacketDirection.Down,"DOWN_ActorControlSelf")==486);
Check(mapAudited.ResolveOpcode(PacketParser.AuditedClientVersion,PacketDirection.Down,"DOWN_ActorControl")==408);
Check(mapAudited.ResolveOpcode(PacketParser.AuditedClientVersion,PacketDirection.Down,"DOWN_Effect")==189);
Check(mapAudited.ResolveOpcode(PacketParser.AuditedClientVersion,PacketDirection.Down,"DOWN_StatusEffectList")==718);
Check(mapAudited.ResolveOpcode(PacketParser.AuditedClientVersion,PacketDirection.Down,"DOWN_EffectResult")==242);
Check(mapAudited.ResolveOpcode(PacketParser.AuditedClientVersion,PacketDirection.Down,"DOWN_InventoryTransaction")==136);
Check(mapAudited.ResolveOpcode(PacketParser.AuditedClientVersion,PacketDirection.Down,"DOWN_InventoryTransactionFinish")==813);
Check(mapAudited.ResolveOpcode(PacketParser.AuditedClientVersion,PacketDirection.Up,"UP_ActionSend")==872);
Check(mapAudited.ResolveOpcode(PacketParser.AuditedClientVersion,PacketDirection.Up,"UP_PingReq")==137);
// 2026.09.15.0000.0000 baseline verification
var mapBase=new OpcodeMap();
mapBase.Load(json,PacketParser.BaselineClientVersion,"local");
Check(mapBase.ResolveOpcode(PacketParser.BaselineClientVersion,PacketDirection.Down,"DOWN_ActorControlTarget")==856);
Check(mapBase.ResolveOpcode(PacketParser.BaselineClientVersion,PacketDirection.Down,"DOWN_ActorControlSelf")==516);
Check(mapBase.ResolveOpcode(PacketParser.BaselineClientVersion,PacketDirection.Down,"DOWN_ActorControl")==607);
Check(mapBase.ResolveOpcode(PacketParser.BaselineClientVersion,PacketDirection.Down,"DOWN_Effect")==787);
Check(mapBase.ResolveOpcode(PacketParser.BaselineClientVersion,PacketDirection.Up,"UP_ActionSend")==913);
});
Console.WriteLine($"{passed} tests passed."); Console.WriteLine($"{passed} tests passed.");
+4828
View File
File diff suppressed because it is too large Load Diff