feat(parity): replicate skill execution, affect sync, packet send methods, and monster color oracle (pass34)

This commit is contained in:
shen
2026-10-08 01:55:39 -07:00
parent a7f55b29d5
commit 9a635932d6
17 changed files with 387 additions and 33 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"reference": "upstream/ava2-client/UserInterface/Packet.h preprocessed with AVA2 Windows feature headers",
"checked": 240,
"checked": 243,
"mismatches": [],
"unmatched": []
}
+3 -1
View File
@@ -282,7 +282,9 @@
"port_file": "src/python_native_modules.cpp",
"windows_methods": 24,
"missing": [],
"extra": [],
"extra": [
"GetMonsterColor"
],
"placeholder": []
},
{
+28
View File
@@ -755,5 +755,33 @@ Validation: macOS build and Android arm64 libmain.so pass. Five targeted CTests
- Checked packet constants: **240**, 0 mismatches, 0 unmatched.
- `python3 tools/audit_windows_parity.py`: **0 placeholder bindings**.
- `python3 tools/audit_ava2_python_interfaces.py`: **46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods**.
## 2026-10-08 pass34 — Skill execution & affect sync, packet constants & send methods, monster color oracle parity
- **Packet Constants & Structs Parity (`src/eter_net/Packet.h`)**:
- Added `HEADER_CG_DIRECT_ENTER = 9`, `HEADER_CG_SHOOT = 54`, `HEADER_CG_STATE_CHECKER = 94` to packet constants, bringing checked constants up to **243/243 (100% parity)**.
- Defined upstream wire structs: `TPacketCGUseSkill`, `TPacketCGPosition`, `TPacketCGTarget`, `TPacketCGShoot`, and `TPacketCGSyncPositionElement`.
- **PythonNetworkStream Send Methods Parity (`src/eter_net/PythonNetworkStream.h` & `.cpp`)**:
- Implemented `SendUseSkillPacket(uint32_t skillIndex, uint32_t targetVID = 0)`.
- Implemented `SendAddFlyTargetingPacket(uint32_t targetVID, int32_t x, int32_t y)`.
- Implemented `SendTargetPacket(uint32_t vid)`.
- Implemented `SendShootPacket(uint32_t uSkill)`.
- Implemented `SendCharacterPositionPacket(uint8_t iPosition)`.
- Implemented `SendSyncPositionElementPacket(uint32_t victimVID, int32_t victimX, int32_t victimY)`.
- **NonPlayer Monster Color Oracle & Native Binding Parity (`src/nonplayer_data.h`, `.cpp`, `src/python_native_modules.cpp`)**:
- Added `monsterColor` field to `MobRecord` extracted from wire offset `217 + prefixShift + resistShift` across all 5 mob table revisions (`r235`, `r255`, `r256`, `r262`, `r263`).
- Added `GetMonsterColor(vnum)` to `NonPlayerData` and exported native binding `nonplayer.GetMonsterColor(vnum)`.
- Corrected `nonplayer.GetRaceNumByVID` to return `-1` when actor/mob is null (matching upstream `CPythonNonPlayer::GetTable` nullptr fallback).
- Added oracle test assertions verifying `dwMonsterColor` wire parsing across revisions.
- **Skill Execution, Combo & Affect Synchronization Parity (`src/python_gameplay_modules.h`, `.cpp`, `NetworkActorManager.h`, `.cpp`)**:
- Implemented `ClickSkillSlot(skillSlot)` with full upstream checks (guild skills, combo toggle, toggle off, cooltime with `CTimer::Instance().GetCurrentSecond()`, target requirement, and casting speed formula) calling `SendUseSkillPacket` and `RunUseSkillEvent`.
- Implemented `UseGuildSkill(skillSlot)` with guild war validation (`IsDoingGuildWar`) and cooldown tracking.
- Implemented `SetPlayerAffect(affect)` and `ResetPlayerAffect(affect)` dispatching toggle skill activation/deactivation (`ActivateSkillSlot`/`DeactivateSkillSlot`) and notifying Python game window.
- Added `SetAffectChangeHandler` callback mechanism in `NetworkActorManager` to sync main player affects from `AppendActor`, `UpdateActor`, and `RemoveActor` without creating circular dependencies.
- Added `ActorInstance::SetComboType(uint16_t)` and updated `/combo` network command handler to call `SetComboSkillFlag` matching upstream `PythonNetworkStreamCommand.cpp`.
- Updated `player_window_call` to use `PyCallClassMemberFunc` with safe `PyErr_Clear()`.
- **Results**:
- Checked packet constants: **243/243 (100%)**, 0 mismatches, 0 unmatched.
- `python3 tools/audit_windows_parity.py`: **0 placeholder bindings**.
- `python3 tools/audit_ava2_python_interfaces.py`: **46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods**.
- CTest suite: **41/41 tests passed (100%)**.
- Android arm64 `libmain.so` and macOS arm64 `ava2_client` build cleanly.