Files
AVA2/docs/WINDOWS-PARITY.md

146 KiB
Raw Permalink Blame History

Current status (2026-10-13): module audit and first behavior repair batch. Earlier sections below are historical snapshots, including placeholder counts and gaps since fixed. They are not the current backlog.

AVA2 Windows parity audit — 2026-10-05

Full 1:1 behavior is NOT implemented. The original AVA2 C++/Python snapshot is the reference; successful compilation and visible original Python screens do not establish gameplay parity.

Corrected in this pass

Difference Correction Evidence
Host unconditionally overwrote account roster/empire with four preview characters Preview roster only behind explicit --preview-data Source guard; authenticated bridge loopback
net.DirectEnter returned success without doing anything Reconnect to selected character's wire IPv4/port; preserve login key and encryption keys, reset handshake and packet sequence for new connection Separate selection/character listeners, old socket EOF, fresh Login2 and select packet
Direct entry had no original loading callback timing On reconnected selection, call SetLoadingPhase, allow original loading script to send selection; suppress second loading callback on phase 4 Loopback asserts one callback and proper selection sequence
Player began with invented Warrior name, HP, money, level-20 skills and quick slots Empty name, zero/unpopulated points, empty skills/quick slots until populated Python state tests
Character creation/deletion fabricated server success Reject unported real-server exchange explicitly; preview simulation remains gated by preview roster Code inspection; no real create/delete parity claim
Give-item count truncated to WORD; refine index/native fields differed from reference Explicit little-endian 12-byte give-item with DWORD count and 5-byte refine with BYTE index Golden packets, including count 70000 and index -1
Use-to-item default window became zero Encode original INVENTORY=1 for both positions Golden packet
Script button field mismatch Explicit DWORD little-endian encoding Golden packet
Cancel/retry could wait for blocking DNS worker join Resolver owns shared result and runs detached, abandoned results cannot mutate client Cancellation/retry loopback; DNS outage latency still requires platform testing

Remaining substantial differences

  • docs/WINDOWS-PARITY-INVENTORY.json contains 681 static placeholder method bindings. This counts bindings, not distinct gameplay features; it also includes configuration/diagnostic APIs. Non-placeholder functions can still have behavioral differences.
  • Native PythonNetworkStream queues gameplay bytes separately from LoginClient; loading currently pauses login transport. Full loading/game receive dispatch, ciphertext transport, packet sequences and map handoff are not integrated end to end.
  • Host contains local map/actor/combat/loot demonstrations and phase shortcuts. These do not reproduce authoritative server gameplay. --phase game, --until-game and screenshots are development previews, not evidence of server entry.
  • Original UI scripts run over partial native bridges. Event routing, IME/text, layout/font/resource behavior and original window lifecycle need Windows comparison.
  • Terrain, GR2 rendering, effects, trees, shadows, collision, audio and render targets use replacement implementations. Asset loading or generated draw commands do not establish original visual/animation parity.
  • Inventory, quick slots, skills, exchange/storage and AVA2 extended systems have partial models, hardcoded paths and placeholder APIs. Character creation/deletion, empire selection, logout/warp and server-driven updates remain incomplete.
  • FoxFS, encrypted pack metadata application and feature mismatches (wolfman/bank/support) remain unresolved.
  • No isolated real AVA2 server session or Android device equivalence test was performed. Android native library build does not prove APK/runtime behavior.

Verification

macOS Debug build succeeds. The 14 noninteractive tests pass, including original protocol/cipher oracles, five bridge fixture scenarios (success/retry/cancel/refused/direct entry), UI tree and packet golden tests. Full 15-test run: ava2.render_3d times out at 15 seconds after generating map object draws; this visual test remains unverified. Android arm64 native library builds. Original 925 reference hashes remain unchanged.

Reproduce: python3 tools/audit_windows_parity.py, python3 tools/verify_baseline.py, cmake --build build/dev -j8, ctest --test-dir build/dev --output-on-failure --timeout 15.

Next required integration

Connect the original loading/game dispatcher and send queue to the actual encrypted socket, then verify login → redirected character connection → map entry against an isolated AVA2 server. After that, compare server-driven movement/combat/loot/inventory and original UI behavior scenario by scenario against Windows. No subsystem should be marked 1:1 solely because its method names or packet constants match.

AVA2-only comparison and corrections — second pass

Comparison inputs are exclusively upstream/ava2-client (AVA2 Windows source and its active macro headers) and this project's src. No other cross-platform client is used as a behavioral oracle.

Windows reference Difference found in AVA2 port Applied correction
Packet.h phase enum Port treated Loading/Game as 5/6, and mixed UI-only Logo/Create into wire phases Wire Loading=4, Game=5, Dead=6; retain complete original phase numbering
Packet.h non-GAIDEN item headers Port used ItemSet=21 and omitted ItemSet2=21 ItemSet=20, ItemSet2=21 and separate receive dispatch
GameType.h item constants Port used 3 sockets, 7 attributes, 5 glove attributes Original 8 sockets, 15 attributes, 7 glove attributes; packed 3-byte attributes
Packet.h item structs with GLOVE/NEW_NAME enabled and ELEMENT/SOULBIND disabled Port read only header/position/vnum/count/three sockets Full original 135-byte ItemSet, 144-byte ItemSet2 and 131-byte ItemUpdate
PythonNetworkStreamPhaseGameItem.cpp ItemSet receive discarded data; ItemUpdate omitted; Python getters ignored window Preserve window/cell, flags, anti-flags, all sockets/attributes/glove attributes and name; update count without losing vnum; getters honor window
PythonNetworkStreamPhaseGame.cpp and PhaseGameItem.cpp Inventory refresh/highlight absent; item-use played invented potion sound Batch inventory refresh; original highlight/switchbot callbacks; item-use requests inventory refresh
PhaseGameItem.cpp storage/mall Port read basic ItemSet and copied only three sockets Read original ItemSet2; preserve full item metadata
Packet.h exchange/ground item structs Exchange omitted tradable arg4 and included disabled element fields/wrong name length; ground item omitted active extended data Align exchange to active AVA2 Windows fields and 25-byte name; include ground item sockets/attributes/count/ownerTime
PhaseGame.cpp SendChatPacket/SendWhisperPacket Missing trailing NUL and wrong length; missing empty/oversize guards NUL-terminated wire text and lengths, original 512/255-byte limits; chat restricted to Game
PhaseGameItem.cpp SendSafeBoxMoneyPacket Port sent header 78, which Windows assigns to PARTY_PARAMETER Disable storage-money send as original Windows does; emit no bytes
PythonApplicationModule.cpp EnableTestServerFlag ignored and IsEnableTestServerFlag absent Implement original false → true flag and getter

Verification tools:

  • tools/audit_ava2_packet_constants.py: preprocesses AVA2 Windows headers and compares 116 existing port constants. Zero mismatches and zero unmatched constants after explicit naming aliases. This is not coverage of every Windows packet.
  • tools/generate_ava2_item_oracle.py: extracts original declarations with their feature guards; compile-time tests check original item/exchange sizes and item field offsets using Win32-width aliases.
  • tools/audit_ava2_python_interfaces.py: compares active method tables from 29 AVA2 Windows modules. One missing binding (eventMgr.Update) and 752 shared method names still bound to placeholder handlers. A matching name alone does not imply matching arguments or behavior. This count is narrower than the earlier 994 raw bindings.
  • Runtime fixture exercises fragmented ItemSet, ItemSet2 on a separate window, ItemUpdate, eighth socket, fifteenth attribute (negative value), seventh glove attribute, highlight/refresh callbacks, storage ItemSet2, wire Game phase and disabled storage-money sends.

Current verification: macOS Debug build and all 16 noninteractive CTest targets pass; Android arm64 libmain.so builds. Previously timing-out ava2.render_3d was excluded, not counted as passed. 925 original AVA2 hashes remain intact.

Remaining: full encrypted game transport/map handoff; other packet layouts/handlers; server time synchronization; original client chat commands and repeated slash-command handling; eventMgr.Update; remaining placeholder method behavior; complete inventory window validation and Python metadata APIs; authoritative gameplay and visual equivalence. Current item-window storage is partial and has not been exercised against a real AVA2 server.

AVA2-only corrections — loading/game transport and state

This is the latest status; earlier sections retain the previous audit snapshots.

Corrected against AVA2 Windows:

  • LoginSession continues decrypting after phase 4 and hands complete plaintext to the game dispatcher, including bytes arriving in the same TCP read as the phase transition. LoginClient continues receiving/flushing after loading rather than pausing forever.
  • The native game send queue retains packet boundaries. Each packet is forwarded through the established cipher and continuing original sequence table; padding is consumed by the game parser. PING/PONG works after loading.
  • StartGame now sets a request consumed by the next network update, which calls SetGamePhase. It neither invents a Game wire phase nor sends EnterGame automatically. The latter is the explicit original UI operation.
  • EnterGame includes the active ENABLE_MULTILANGUAGE_SYSTEM language byte. Main-character receive synchronizes name/VID, invokes loading LoadData(x,y), sends the original EUROPE ClientVersion2 timestamp 1215955205 and executable filename, and supports the original BGM-volume packet. BGM receive stores metadata rather than prematurely playing music; original default volume is 0.02.
  • Game server EOF invokes the stream handler's original SetLoginPhase callback. Disconnect/reconnect clears game buffers, player identity/status/inventory/skills/quick slots and actors. Phase-handler replacement is safe against reentrant Python destructors, and native references are released before Python finalization.
  • Game handshake invokes original OnHandShake. DirectEnter suppresses duplicate handshake/login-screen callbacks as Windows does. IsConnect reports the game socket, not the separate auth socket.
  • Original point-change header is a four-byte int, not a BYTE. The corrected 25-byte parser updates only the main actor's points; the 255-entry int64 points packet populates all status values. Status refresh is batched. Secondary level/skill/energy/pickup-effect handling remains incomplete.
  • Server time header 106 uses four-byte Windows time_t (StdAfx.h defines _USE_32BIT_TIME_T). app.GetGlobalTime advances the received base in milliseconds; GetGlobalTimeStamp advances it in wall-clock seconds, matching PythonApplication.cpp. Wrap semantics are covered by deterministic tests. ELTimer's separate handshake/movement clock and frame-based GetTime remain separate pending work.
  • Added the correctly cased eventMgr.Update: validates coordinates and stores (x,-y,z), matching CGameEventManager::SetCenterPosition. The original Update body is empty; screen-waving consumption remains unported.
  • Game receive/send buffers are bounded and undersized dynamic packet lengths are rejected rather than allocating from unsigned underflow.

Verification:

  • 17 noninteractive CTest targets pass (the existing render_3d visual test remains excluded following its earlier timeout).
  • The Python bridge fixture now covers eight scenarios: success, password retry, cancel, connection refusal, DirectEnter, live encrypted game data, remote game EOF and BGM-volume loading.
  • The game peer independently validates ClientVersion2, multilingual EnterGame, packet sequence continuation, encrypted PONG and chat. It delivers fragmented main-character/time/255 points/main-vs-other point changes/item data and checks their Python-visible effects. It is a loopback protocol fixture, not a real map/server session.
  • Original declaration oracles additionally check point-change, points, time, multilingual EnterGame and BGM-volume layouts. 118 existing port constants align with AVA2 Windows.
  • 29 active Windows extension method tables: zero missing method names; 749 overlapping bindings remain placeholders. Constants, argument signatures and behavior still need implementation/review.
  • Android arm64/API26 native library builds; 925 original reference hashes remain unchanged.

Remaining for genuine playable equivalence: full AVA2 packet coverage and error/disconnect recovery for unsupported packets, map Warp/global-to-local coordinate transformation and original loading resources, actor/combat/skills/quest/UI/render behavior, locale/codepage and metadata APIs, full pack handling, isolated real AVA2 server validation and Android APK/device verification. Socket integration does not establish those behaviors.

2026-10-08: rendering performance optimizations (Frame Pacing, UI Box Culling, Render Scale, Scratch Buffers)

Ported high-impact rendering optimizations identified in metin2-client audit across Phase 1 and Phase 2:

  1. Frame Pacing & FPS Cap: Added --fps-cap CLI flag and MT_FPS_CAP / AVA2_FPS_CAP environment variables. Defaults to 60 FPS for desktop interactive play and 0 (unthrottled) for automated --frames N test runs. Fixed-cadence pacing via std::this_thread::sleep_until and late re-anchoring eliminates frame delta oscillation on high-refresh ProMotion/120Hz/144Hz displays.
  2. UI Fast Box Culling: Implemented screen-boundary fast bounding box rejection in CWindow::Render(), CGraphicTextInstance::Render(), and CSlotWindow::OnRender() against logical screen resolution (0, 0, sw, sh) to eliminate redundant GPU draw calls and texture/vertex overhead for off-screen UI elements.
  3. 3D Render Scale Pipeline: Added --render-scale CLI flag and MT_RENDER_SCALE / AVA2_RENDER_SCALE environment variables (clamped 0.25..1.0, default 0.75 on Android, 1.0 on desktop). When render scale < 1.0, 3D world renders into reduced-resolution gpu_scene_texture (SDL_TEXTUREACCESS_TARGET) with hardware linear upscaling, while 2D UI remains at 100% native resolution. Added Gr2SceneRenderer::SetLogicalSize to maintain accurate mouse picking and TextTail screen projections. Minimap radar rendering isolated to a dedicated 128x128 streaming texture.
  4. GPU Geometry Scratch Buffers: Replaced per-draw heap vector allocations (xverts, vertices, indices, sortedDraws) in Gr2SceneRenderer::RenderSceneGPU with persistent member scratch buffers, eliminating thousands of memory allocations and deallocations per second. Validation: Both macOS host and Android arm64 NDK 27 (build/android-core) compile cleanly; all 41 CTest unit tests pass; parity audits verify 0 placeholder bindings, 46 Windows module signatures, and 395 packet constants.

2026-10-05: character wire layout and retained state

Compared exclusively with upstream AVA2 Windows Packet.h and PythonNetworkStreamPhaseGameActor.cpp. Equipment parts are six (including arrow type), shining parts three. Corrected AdditionalInfo to 75 bytes (conqueror level, language, shining) and Update to 56 bytes (conqueror level, shining). Retain arrow type, sash, conqueror level, state flags and affect/shining arrays in actor state; accept zero speed updates. Ignore mismatched additional-info VID as Windows does; bound name reads. Generated oracle now extracts original equipment/shining enums and character declarations with active Windows feature guards; asserts sizes and offsets. Fragmented literal-length additional-info/update followed by ping verifies framing and unmatched VID handling. Validation: macOS build passed; 17 nonvisual CTests passed; Android arm64 libmain.so built. The existing render_3d test remains excluded due to its unresolved timeout. No real server/device verification. Remaining: actual shining/affect rendering, race/equipment model mapping, map coordinate conversion, alternate actor packets, renewal death layout, and the broader Python/gameplay placeholder inventory. This milestone does not establish full Windows parity.

2026-10-05: renewal death protocol and direct death state

AVA2 Windows Packet.h enables RENEWAL_DEAD_PACKET: header + VID + three BYTE revival delays = 8 bytes. Corrected port declaration and receive framing. The independent oracle extracts the original guarded enum/declaration and verifies size/offset. A fragmented literal death packet followed by ping checks alignment. ActorInstance::Die now sets death state and plays death motion directly rather than simulating 99999 damage; a high-HP regression checks unconditional death. For a known main actor, game-window OnGameOver receives one tuple containing the three delays. Retained duel-mode field suppresses that callback when set, but original duel packet/state handling is still unported, so the duel exception is not yet verified end to end. Original NotifyDeadMainCharacter clears auto-attack target; the port's target/auto-attack system remains incomplete and this side effect is pending. UI callback needs live game verification. Validation: macOS and Android arm64 library builds passed; 17 nonvisual CTests passed (death-parity-tests.log). Existing render_3d timeout remains excluded. No server/device changes; reference AVA2 files untouched. Full Windows parity remains incomplete.

2026-10-05: alternate actor wire paths and pet staging

Implemented AVA2 Windows CHARACTER_ADD2 (120, 85 bytes) and CHARACTER_UPDATE2 (117, 52 bytes) layouts/dispatch. Original declarations extracted into oracle; compile assertions compare sizes and equipment/mount/shining offsets. Decode equipment, arrow, sash, flags, speed, guild, empire, mount and shining as present in each packet. Invisible races 20025/20038/20039 are filtered in Add2 and AdditionalInfo as the Windows handlers do. Original ENABLE_NEW_PET_SYSTEM is active: type 10 now waits for AdditionalInfo alongside PC/NPC. Literal split-packet tests verify Add2/Update2 framing, invisible filtering and pet staging. Windows Update2 has no conqueror field, and its update-data constructor leaves conqueror level uninitialized. Port deliberately preserves previously received level rather than reproducing undefined memory. Remaining Add2 differences: NPC mob_proto name override, global/local map coordinates, actor model/equipment loading and visual effects. These still prevent a full parity claim. Validation: macOS build and 17 nonvisual CTests passed; Android arm64 libmain.so build passed; 925 AVA2 reference hashes unchanged. render_3d remains excluded for unresolved timeout; no live server/device checks.

2026-10-05: atlas queries, map bases and network coordinate conversion

Reference: AVA2 GameLib/MapManager::__LoadMapInfoVector, UserInterface/PythonBackground::Warp/GlobalPositionToLocalPosition/LocalPositionToGlobalPosition and PythonBackgroundModule wrappers. Added atlas parser (25600 per terrain cell, first matching map, exclusive end boundaries, explicit Win32 coordinate wrap). Atlas text comes through the existing case-insensitive pack mount, using app locale path with AtlasInfo.txt fallback. Implemented Python GlobalPositionToMapInfo return (name,baseX,baseY), unknown ('',0,0), GlobalPositionToLocalPosition and WarpTest x100 units. Main-character loading now selects/loads atlas map and establishes base before publishing local player position while LoadData continues to receive original global coordinates. Add/Add2/Move/Sync/GroundItem receive coordinates become local; outgoing Move becomes global. Background warp recreates terrain/base state before lookup. Removed incorrect village-block 001003 fallback and stopped reporting failed map names as loaded. Known map load failure raises an explicit error rather than entering with the wrong map; Windows exits its application on this failure, so the application shutdown policy is not identical yet. Tests: map range edges, coordinate round trips/negative values, Python atlas lookups and a real metin2_map_a1 center-block load with nonzero base. Main player local coordinates and outgoing movement global bytes verified. macOS build and 17 nonvisual CTests passed; Android arm64 libmain.so built. render_3d remains excluded for unresolved timeout. Remaining: multi-block terrain streaming, map-specific texture/environment loading, camera height/ShowMapName/minimap/portal/target reset and complete warp-to-another-server flow. Map resource lookup still includes a developer absolute path and must move entirely to portable pack resources. Full parity remains incomplete; this does not prove rendered-map or real-server behavior.

2026-10-05: actual mob_proto loading and nonplayer data APIs

Implemented AVA2 PythonNonPlayer::LoadNonPlayerData MMPT/MCOZ/XTEA key path, with bounds-checked LZO1X safe decompression. LZO source imported unchanged from AVA2 Tools/DumpProto/lzo, provenance in third_party/ava2-lzo/AVA2-PROVENANCE.md; only lzo1x_d2.c compiled. Decode packed Win32 235/255-byte records; actual English fixture uses 255. Preserve first record on repeated inserts, clear per runtime initialization. Versions 256/262/263 remain rejected until their changed layouts are implemented; original autodetection supports them, so loader parity is not complete. Replaced nonplayer placeholders for names, click events, VID race/level/grade, HP, race flags, level, damage, exp, damage multiplier, ST/DX, stone classification, regen, gold and resist data. Added price tuple and ordered prefix search matching original lowercase-name-only comparison (query itself is unchanged). Corrected click-event 0..4 and resist 0..10/MAX11 constants. Actor append uses decrypted mob names instead of invented Mob_; AdditionalInfo/Add2 apply the original NPC exclusion/range policy before overriding server names. Validation: real encrypted English binary loads; Wild Dog level1/HP126/damage20..24. Binary gold0..0 differs from adjacent text858..890; independent Python fixture cipher plus LZO decode confirmed original byte offsets and values. Name search, missing VID -1, malformed header rejection and native NPC name policy tested. macOS and Android arm64 builds passed; 17 nonvisual CTests passed; 925 reference hashes unchanged. Original binary remains authoritative. render_3d timeout still excluded; no live server/device verification. Remaining: all alternate proto layouts, complete render/model data usage and wider gameplay APIs.

2026-10-05: all original mob record versions

Extended mob_proto decoding to all five formats accepted by AVA2 TMobTableAll: 235,255,256,262,263. Account for bLvlPct insertion in r262/r263 and additional resistance bytes before click event/fDamMultiply. Preserve the original index-based first-eleven resistance copy, including its claw index behavior in r262/r263; do not silently remap semantic indices. The oracle generator now extracts original SMobSkillLevel and all five SMobTable declarations directly from upstream PythonNonPlayer.h under fixed-width Win32 aliases. Compile assertions prove all five sizes; new ava2.nonplayer_oracle constructs each original structure with distinct values, produces valid LZO literal containers both unencrypted and XTEA encrypted, loads through the production parser, and compares names/type/rank/level/gold/exp/HP/regen/race/ST/DX/damage/click/multiplier/resists. Truncated container rejection preserves existing records. This supersedes the previous limitation rejecting r256/r262/r263; other unrepresented fields and model integration remain incomplete. Validation: macOS and Android arm64 builds passed; 18 nonvisual CTests passed. Existing render_3d timeout remains excluded. 925 reference hashes unchanged; no live server/device verification. Additional inspection found quickslot receive handlers currently discard updates and local requests modify state without server acknowledgement; this is a remaining gameplay alignment gap.

2026-10-05: quickslot authoritative updates and paging

Compared with AVA2 PythonPlayer.cpp and PythonNetworkStreamPhaseGameItem.cpp. Implemented four pages/eight visible slots while retaining all36 server slots. Add/delete/move/add-to-empty/remove-by-value requests emit original CG16/17/18 packets and do not mutate state; GC28/29/30 updates apply add/delete/swap and schedule inventory refresh. Remove-by-value includes hidden slots32..35, whereas RequestDeleteGlobalQuickSlot retains the original visible-range32 guard. Implemented page wrap and local/global lookup conversion, player.SetGameWindow owned reference with teardown cleanup, immediate page RefreshInventory and emotion callback; inventory quickslot uses INVENTORY1 and registered cell. Corrected invalid-argument handling for affected quickslot getters/use. Regression includes no-main request suppression; a live native actor fixture; exact add/delete/move/empty packet bytes; split server add followed by swap/delete; callback batching; hidden slot35 removal without early mutation; item-use bytes; emotion callback; negative/overflow page values; death request suppression. macOS and Android arm64 builds passed, 18 nonvisual CTests passed, 925 reference hashes unchanged. Existing render_3d timeout remains excluded and no real server/device check was run. Limitations: full ActorInstance::CanAct needs original stun/paralysis/faint/sleep state; current quickslot send guard covers absent actor/death only. Skill quickslot action still uses the existing incomplete skill callback path instead of full original ClickSkillSlot mechanics. Shared inventory/skill action gating and item metadata remain separate parity gaps. This milestone does not establish complete quickslot/combat or full-client parity.

2026-10-05: action predicate, stun packet and stun affect

Reference: AVA2 GameLib/ActorInstanceBattle::CanAct, ActorInstance::Stun/SetSleep/SetFaint/SetParalysis, UserInterface/InstanceBaseEffect::SetAffect, NetworkStreamPhaseGame::RecvStunPacket. Added action flags and exact five-condition predicate (dead/stun/paralysis/faint/sleep). Quickslot send uses CanAct. GC_STUN13 now enters death for main actor, sets persistent stun for other actors; no OnGameOver callback is emitted by this packet, matching original. Actor spawn and update apply AFFECT_STUN bit5 to sleep, matching the original active branch rather than the commented FAINT/SLEEP cases; clearing that bit restores sleep-related action permission. Tests verify every predicate flag, clearing flags, network affect update suppressing a quickslot request then restoring it on clear, remote-stun versus main-stun behavior and death suppression. macOS and Android arm64 builds passed; 18 nonvisual tests passed; 925 reference hashes unchanged. render_3d remains excluded; no live server/device checks. Remaining: complete affect lifecycle/visual attachment, shaman paralysis producers, revival/reuse semantics, movement/attack/skill action gates, and the incomplete skill/combat implementations. Flags and predicate alone do not establish full runtime status/combat parity.

2026-10-05: attack/inventory send guards and distinct drop APIs

Reference: AVA2 NetworkStreamPhaseGameItem/PhaseGame and PythonNetworkStreamModule. Applied original main-instance CanAct guard to attack, item use, move, pickup, old/new drop and item-use-to-item. Deliberately left operations without this original guard (e.g. give/refine/on-click) unchanged; this is not a blanket phase restriction. Corrected legacy drop payload semantic to elk DWORD and split new drop into header20/position/gold DWORD/count DWORD (12 bytes). Old AVA2 header224 is retained (8 bytes). Python old API accepts cell or window+cell, always elk0; new accepts cell+count or window+cell+count. Added previously empty SendElkDropPacket and SendGoldDropPacketNew using RESERVED_WINDOW0/cell0; new gold drop count0. Oracle compares original drop declarations' sizes/count offset. Exact-byte tests include item count70000 and gold123456, plus seven suppressed send paths during stun affect. Replaced outdated test call supplying count to legacy Python API. Validation: macOS and Android arm64 builds passed; 18 nonvisual tests passed; 925 original reference files unchanged. Existing render_3d timeout remains excluded; no live server/device verification. Remaining: equip-use/move restrictions during exchange/shop/attack and item sounds, movement/skill state transitions, full item metadata/action logic, and wider client parity. These sender changes do not establish complete combat/inventory parity.

2026-10-05: registered skill mapping and level packet synchronization

Reference: AVA2 Packet.h, PythonPlayer::SetSkill/GetSkillSlotIndex/SetSkillLevel_ and NetworkStreamPhaseGame::RecvSkillLevel/New. Added GC72 legacy256-byte and GC76 new1531-byte handlers with Win32 int32 tNextRead (original handler ignores read time). New handler resets slots7/8, uses current active ENABLE_78_SKILLS and disabled wolfman ranges221..228/236..243 plus112..119, then updates mapped skill grades/levels; highest later matching skill overwrites special slot as original loop does. Added batched RefreshSkill/RefreshStatus. Corrected player.SetSkill to original two arguments and preserve existing level instead of inventing level1. Retain original reverse-map behavior (including stale mappings when a slot is reassigned), expose real GetSkillSlotIndex, convert master/grandmaster/perfect level offsets19/29/39, and replace efficiency placeholders with original international/Ymir skill-power tables and >40 guard. SetSkill mapping is required; unknown IDs are not invented. Oracle extracts original skill declarations and verifies both packet sizes/6-byte skill records. Literal split1531-byte fixture verifies no early refresh, grade conversions, power values, special slot overwrite and wolfman exclusion; legacy256-byte fixture verifies grade-1/update. macOS and Android arm64 builds passed; 18 nonvisual CTests passed; 925 reference hashes unchanged. Existing render_3d timeout remains excluded, no live-server/device checks. Remaining: actual skill definitions/registration bootstrap, cooldown handling, click/target/resource checks, skill motion/effect execution and complete locale selection. Old GC72 follows release receive behavior; original debug build asserts that this deprecated packet should not be used. This does not establish playable skills or complete Windows parity.

2026-10-05: skill cooldown slot mapping and getter semantics

Compared with AVA2 PythonPlayer GetSkillCoolTime/GetSkillElapsedCoolTime, PythonPlayerSkill::__CheckRestSkillCoolTime and PythonPlayerModule wrapper. Cooldown now lives on registered PlayerSkill slots rather than a separate map incorrectly queried by slot but populated by skill ID. Native SetSkillCoolTime resolves original reverse skill mapping and ignores unknown IDs. GetSkillCoolTime retains total/elapsed after expiry and reports elapsed from time0 for untouched valid slots; invalid slots return0/0. IsSkillCoolTime uses elapsed<total and the original debug ToggleCoolTime setting. ResetPlayerState clears stored cooldown along with skill registration. Added deterministic SkillCooldown primitive and explicit-time native hook for boundary tests. Tests cover exact expiry boundary, retaining total/elapsed after expiry, disable/re-enable behavior, skill101 mapped to slot6, invalid slot255 and connection-reset cleanup. macOS and Android arm64 builds passed; 18 nonvisual CTests passed; 925 original reference hashes unchanged. render_3d remains excluded for unresolved timeout. Remaining: original CTimer frame clock integration (current bridge uses SDL monotonic seconds), skill-data cooldown formula/casting-speed adjustment, successful-use event/callback integration and active-skill effect lifecycle. Native demo duration remains externally supplied; these corrections do not establish full original skill execution or client parity. IsSkillActive is still a placeholder and was not treated as completed.

2026-10-05: affect add/remove wire callbacks and energy expiry

Compared exclusively against AVA2 Windows Packet.h, RecvAffectAddPacket/RecvAffectRemovePacket and PythonPlayer affect mapping. Added GC126 (22 bytes) and GC127 (6 bytes) with explicit Win32 int32 values/durations and packed 21-byte affect element. Add calls BINARY_NEW_AddAffect(type, apply, value, duration); remove calls BINARY_NEW_RemoveAffect(type, apply). Energy apply128 updates POINT_ENERGY_END_TIME129 using server timestamp plus duration and schedules RefreshStatus; removal retains the original absence of energy reset/status refresh. Preserve original 32-bit signed callback interpretation and addition wrap. Implemented the original 18 active affect-to-skill mappings, including conqueror skill182, and unknown-index result0; disabled wolfman mappings remain excluded. These packets notify buff UI, not skill activation: original toggle activation belongs to character affect-bit processing with loaded skill definitions, which remains unfinished. Oracle extracts the actual anonymous upstream affect typedefs and checks original packet sizes. Regression verifies split-packet buffering, negative apply value, add/remove callbacks, energy expiry, refresh count and mapping entries. macOS and Android arm64 builds passed; 18 nonvisual CTests passed; all925 original reference hashes unchanged. render_3d remains excluded for its unresolved timeout; no live server/device or visible buff UI validation was performed. Remaining: skill definitions/registration, character affect and toggle activation lifecycle, cooldown formula/frame clock, skill execution/target checks, wider rendering/gameplay parity. This milestone does not establish complete Windows parity.

2026-10-05: skill module constants restored

Compared directly with AVA2 Windows PythonSkill.h and initskill. Replaced ten zero placeholders with original type0..5, grade count3, effect count4, grade step20 and grade gap25. This restores the values consumed by UI classification and grade loops; it does not implement the underlying skill data/actions. Constants reside in skill_constants.h. Windows oracle extracts the original type enum and numeric grade definitions; compile assertions compare every exported value to that source, and Python regression checks all ten actual module attributes. Validation: macOS and Android arm64 builds passed; 18 nonvisual tests passed; 925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Further inspection confirms app.LoadLocaleData is still a no-op and skill type/name/description/conditions/formulas remain placeholders; IsToggleSkill/IsStandingSkill still incorrectly infer flags from hardcoded IDs. Next work must load original SkillDesc/SkillTable data through the locale lifecycle, replace those ID guesses with data flags, then connect toggle activation. Full skill execution/rendering and complete client parity remain outstanding.

2026-10-05: skill description data and real metadata/flag queries

Added SkillDescriptions model and native packed-file loader using the existing case-insensitive bounded pack reader. Compared with AVA2 Windows RegisterSkillDesc: job lookup/lowercase, three grade names with empty-name fallback, exactly three condition columns (fourth ignored), case-sensitive attribute names and duplicate-row OR semantics. Disabled wolfman/78skill job names remain absent as guarded in the actual source. Unknown job still leaves default inserted record. Truncated mandatory columns avoid original unsafe reads; motion grade count greater than4 rejects loading. This is a partial description parser, not a complete skill loader. GetSkillName/Description/Type/ConditionDescriptionCount/ConditionDescription now query actual records. Unknown name returns NoneSkill; other missing-record getters raise RuntimeError. Out-of-range/negative condition indexes return None. IsToggleSkill/IsStandingSkill/IsUseHPSkill use loaded attribute bits and no longer guess from IDs. Real English data proves skill122 Combo is toggle, while skill19 Strong Body is standing and not toggle, contrary to the previous ID guess. Runtime creation resets description records. Tests load actual locale/en/SkillDesc.txt through the native loader, verify literal names/grades/descriptions/conditions/types/flags/errors, and check reset cleanup. Synthetic rows verify duplicate OR semantics, case-sensitive unknown attributes, ignored fourth condition and disabled wolfman insertion semantics. macOS and Android arm64 builds passed; 18 nonvisual CTests passed; 925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Outstanding integration: app.LoadLocaleData remains a no-op, so production startup does not yet invoke this new description loader. Regression invokes it explicitly; no automatic-load claim is made. SkillDesc icons, weapons, motion metadata, affect formulas and limits are not yet represented; SkillTable, legacy RegisterSkill files, locale item/other loaders, formula evaluation and full skill/character-affect execution remain incomplete. No live server/device/visible skill UI verification; overall parity goal remains active.

2026-10-05: SkillDesc motion, weapons, limits and affect records

Extended the original description model with weapon OR masks, motion/no-motion state, four grade motion indexes with original WORD wrap and grade gap25, target/motion-loop formula strings, affect description/min/max formula records, BYTE level limit/max level and default level-up point1. Preserve original duplicate affect append behavior rather than clearing it. Preserve original ARROW logical-OR mask1 and disabled claw mapping; EMPTY_HAND uses original active WEAPON_NONE11. Grade count>4 returnsfalse; malformed negative count avoids original before-array write by clamping0. Replaced GetSkillMaxLevel/LevelLimit/LevelUpPoint/AffectDescriptionCount placeholders with real description queries and missing-record RuntimeError. Synthetic regression checks WORD/BYTE wrap, empty max-level fallback to converted limit44, weapon mask, repeated affect append and stored formulas. Real English fixture checks four exported Python getters. macOS and Android arm64 builds passed; 18 nonvisual tests passed;925 reference files unchanged. render_3d remains excluded for unresolved timeout. Still pending: locale startup invocation, full SkillTable merge and formula evaluation, icon/resource registration and legacy RegisterSkill files, full skill execution and character-affect lifecycle. Description loader remains explicitly invoked by regression, not connected to app.LoadLocaleData. Stored formula text does not imply formula execution. No real server/device/visual validation; overall Windows parity remains incomplete.

2026-10-05: original SkillTable merge rules

Added exact27-column table parsing and native packed-file loader; only existing description IDs merge. Stored original SP cost, cooldown, continuation SP, duration and target range. Nonempty costs/cooldown/range preserve previous values when empty; duration always overwrites. Max level updates only for incoming value>1 with BYTE conversion; level limit checks previous limit>1 as original, not the incoming value. Implemented first-affect formula override: sequential substring number/atk/mwep replacement into min/max forms; skill1 appends literal *3, scalar formula clears max. Preserve original exceptions34 and151..157 and CHEONMA disable option. No alternate table flags/skill names imported. This stores formulas and does not evaluate them. Regression loads actual English table after description, checks synthetic min/max substitutions, unsigned/BYTE conversions, previous-limit condition, empty-field retention/clearing, skill1 multiplier, skill34 exception and CHEONMA/scalar behavior. macOS and Android arm64 builds passed;18 nonvisual CTests passed;925 original reference files unchanged. render_3d remains excluded for unresolved timeout. Still outstanding: app.LoadLocaleData startup integration, formula evaluation and player variable bindings, icons and legacy skill files, skill use/cooldown resource/target/motion lifecycle, full rendering/gameplay parity. Tests invoke native loaders explicitly; no production startup or live server/device behavior claim. Overall goal remains active.

2026-10-05: original AVA2 formula evaluator portable library

Imported AVA2 EterBase/Poly exclusively into third_party/ava2-poly with provenance. Only replaced ../StdAfx.h in cpp files with standard includes; parser, evaluation, symbol tables and random semantics remain original. Added PIC ava2_poly library linked to embedded runtime for subsequent skill formula integration. Original reference files remain immutable. New ava2.skill_poly regression exercises arithmetic precedence/parentheses, actual k/str variable binding after Analyze, min/max/floor functions and forced random endpoints. macOS and Android arm64 builds passed;19 nonvisual tests passed (new formula test raises previous18 count);925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Not yet integrated into gameplay: skill formula getters and player status/min/max variable mapping still pending, along with locale startup loading and skill execution. Linking the library and passing core tests does not establish working Python skill formulas or playable skills. Full Windows parity goal remains active.

2026-10-05: four Python skill formula queries

Connected GetSkillCoolTime/NeedSP/ContinuationSP/Duration to actual merged formula fields and original CPoly Analyze/Eval. Implemented original free-value case-sensitive status aliases, k/SkillPoint skill level, ar division100 and JeungJi prefix0. Added native player status lookup. Unknown state names deterministically return0 instead of reproducing original uninitialized GetState result; nonfinite results return0, finite return values truncate and wrap explicit32 bits before Python signed interpretation. Derived player status calculations are still a separate gap; lookup currently uses retained status points. Real English data tests verify cooldown12, SP90 at0.5 and truncation52 at0.125, empty continuation/duration0. Native formula regression verifies STR20 and hit rate80 binding, JeungJi0 and unknown-variable handling. Original CPoly accepts some malformed strings (1+ evaluates2); preserve evaluator behavior rather than assuming stricter parsing. macOS/Android arm64 builds passed;19 nonvisual tests passed;925 references unchanged. render_3d remains excluded for unresolved timeout. Pending: min/max status maps and formatted affect descriptions, startup locale loading, derived status calculations, skill cast/cooldown lifecycle and wider rendering/gameplay parity. Runtime tests explicitly load description/table; no live server/device or full playable skill claim. Full goal remains active.

2026-10-05: formatted skill affect descriptions

Replaced GetSkillAffectDescription placeholder with original free-value min/max formula evaluation, absolute values, floor both values when description contains %.0f, and printf float formatting of two values. Retain 65-byte original buffer capacity with explicit termination for defined host behavior. Negative/out-of-range indexes return None as original null string wrapper. Format validation accepts original float formats (including %0.f) and escaped percent, rejects incompatible/write conversions or more than two arguments instead of reproducing varargs UB. Actual English table regression binds minATK100/maxATK200/STR20 and verifies skill1 at0.5 produces literal Total Attack Power 450-855 after original formula rewrite/multiplier. Tests also verify negative/out-of-range queries. macOS/Android arm64 builds passed;19 nonvisual CTests passed;925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Limitations: only original non-Arabic formatting branch is implemented; Arabic replacement branch remains pending. Existing free-state points are retained values, not complete derived combat calculations. Min/max variable maps, new affect data API, startup locale loading, icons, actual skill use and rendering remain outstanding. No visible skill tooltip/live server/device verification. Overall Windows parity remains incomplete.

2026-10-05: point bounds and original empty new-affect API

Compared PythonPlayer SetStatus/GetStatus and PythonSkill new-affect loaders/query wrappers. Native and Python status get/set now honor original POINT_MAX_NUM255: negative/255+ values return0 and writes are ignored. Native skill formula lookup shares the bound. This only aligns bounds, not derived battle status updates. GetNewAffectDataCount now validates actual skill existence and returns0 for the original loader state. Original RegisterSkillDesc clears the new-affect vector and neither active description/table loader populates it. GetNewAffectData validates arguments/skill then raises RuntimeError for any index, matching this empty state; removed unconditional dummy0 behavior. Do not synthesize new effects from legacy affect records. Tests check invalid status writes/reads, valid skill empty count, negative/zero new-affect indexes and missing-skill exceptions. macOS/Android arm64 builds passed;19 nonvisual CTests passed;925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Inspection confirms original SetStatus recomputes hit/evade/weapon/attack points for several triggers, with weapon metadata/race/sash dependencies. Those calculations remain unimplemented along with locale startup, skill use and full rendering. No live-server/device proof. Full parity goal remains active.

2026-10-05: item text resources resolve against mounted pack

Inspection found item database seeding reads item_list/item_names through guessed working-directory paths, including ../ and build/dev paths. Replaced those direct filesystem reads with existing bounded, case-insensitive ReadPackedText against the configured AVA2 pack root. Item10 name/icon query now works with process working directory set to system temporary directory; regression verifies Sword+0 and icon/item/00010.tga, then restores working directory. macOS and Android arm64 builds passed;19 nonvisual CTests passed;925 original reference hashes unchanged. render_3d remains excluded for unresolved timeout. This corrects resource resolution only. Existing seven seeded item definitions, guesses based on item_list type, hardcoded English path and supplemental item_names still differ from original authoritative item_proto/locale lifecycle. Item proto loading, metadata/getters, derived battle calculations, startup locale and wider gameplay/rendering parity remain incomplete. No live device/server verification. Goal remains active.

2026-10-05: original item_proto decode and Python load bridge

Added fixed-width ItemProto decoder with AVA2 original key173217/72619434/408587239/27973291, MIPX version1/MIPT headers, MCOZ XTEA/LZO, bounded decompression and count/stride validation. Implements active socket8 record layouts172/176/178; current real file is176. Retains names/types/subtypes/size, range/refined ID, six values, two limits and three applies. Invalid/truncated input preserves stored records. Replaced item.LoadItemTable no-op with packed-file decode and update of existing item metadata, preserving item-list icon/model resources. Original Python wrapper returns None even on load failure. Native decoder test loads actual English file and verifies Sword+0/type1/size2 plus truncated rejection. Python bridge test invokes load from temporary working directory and verifies item query. macOS/Android arm64 builds passed;19 nonvisual tests passed;925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Remaining: independent original-structure oracle and synthetic172/178 cases; full record flags/prices/sockets/refine details, range lookup, all limits/applies getters and load/reset semantics. Existing seeded metadata remains before explicit load and some fields/descriptions still fabricated; app.LoadLocaleData does not yet trigger loading. Not a complete item system or startup parity claim. Derived combat calculations, skills, rendering and full goal remain incomplete; no device/server verification.

2026-10-05: item limits/applies, selection fallback and two-handed speed

GetLimit/GetAffect now return all two limits/three applies from loaded item_proto. Preserve original BYTE index conversion (256 maps to0); invalid converted indexes raise RuntimeError. Missing selected data raises RuntimeError instead of silently returning zeros. Item-list-only records still use existing partial metadata pending full loader replacement. Implemented app.SetTwoHandedWeaponAttSpeedDecreaseValue, default/reset0, and original APPLY_ATT_SPEED7 subtraction for weapon subtype3. Restored Python SelectItem fallback60001 and preservation of previous selection when both requested/fallback IDs are absent. This fixes the refine dialog regression caused by invalid selection0 reaching the now-strict limit getter. Range-based selection is still pending. Regression compares both limits/all three applies to decoded real records, verifies BYTE wrap/index exceptions, real two-handed weapon attack-speed deduction9, fallback selection and full refine dialog lifecycle. macOS/Android arm64 builds passed;19 nonvisual CTests passed;925 reference files unchanged. render_3d remains excluded for unresolved timeout; no live server/device/visual validation. Independent item-structure oracle, other metadata/getters, startup locale loading, derived combat and full parity remain incomplete.

2026-10-05: selected refine fields and range/Wiki selection

GetRefinedVnum now reads the selected record's original DWORD field and takes no required argument, replacing the vnum%10/vnum+1 guess. Added WORD refine-set decoding and real GetRefineSet. SelectItemWiki returns1/0 and preserves selection on failure without regular SelectItem's60001 fallback. Corrected regression calls that previously required the wrong argument-taking API. Added original range selection: exact map entries win; otherwise traverse ranges in successful file load order with strict base<id<base+range and uint32 endpoint arithmetic. Duplicate loaded range entries retain their ordering and reference the latest base record as original pointers do. Failed loads leave records/ranges unchanged. Regular/Wiki selection use the range result's base record. Tests verify actual Sword+0 refinement11, Sword+9 refinement0, decoded refine set, Wiki success/failure preservation, overlapping range order and exclusive endpoints. macOS/Android arm64 builds passed;19 nonvisual tests passed;925 references unchanged. render_3d remains excluded for unresolved timeout. Synthetic range model checks do not replace the pending full original item-structure/container oracle. Full metadata, locale startup, combat, skills and rendering parity remain incomplete; no live-device/server verification.

2026-10-05: selected item prices and flags

Decode original anti/general/wear/immune DWORD flags and buy/sell DWORD prices. Replaced item.GetIBuyItemPrice/GetISellItemPrice with original Python long return semantics and IsAntiFlag/IsFlag/IsWearableFlag with any-intersection mask checks. Negative Python mask uses original DWORD conversion. Is1GoldItem now checks original ITEM_FLAG_COUNT_PER_1GOLD bit3. Missing selected data raises RuntimeError; list-only default records return zero fields until authoritative proto loading. Actual English Sword+0 regression compares both prices and flag queries against decoded data, checks individual low31 bits, negative mask and zero mask. macOS/Android arm64 builds passed;19 nonvisual CTests passed;925 original reference files unchanged. render_3d remains excluded for unresolved timeout. These getter tests do not replace pending independent original-structure layout validation. Inventory/player price/flag APIs, other metadata, startup locale, derived combat, skill execution and wider rendering parity remain incomplete; no live server/device validation.

2026-10-05: independent item prototype structure/container oracle

Generator extracts original ItemData.h limit/apply/three table typedefs and capacity constants, with explicit Win32 long32 types. Static assertions verify active sizes172/176/178. New ava2.item_proto_oracle constructs each actual original structure with distinct signed limits/applies/values, high-bit unsigned prices/flags, refine tail and range. Literal LZO containers test plaintext and original-key encrypted MIPX paths; truncation preserves records/ranges. Covers all currently represented fields independently of the production parser's offsets. Inspection additionally found original active ENABLE_PROTOSTRUCT_AUTODETECT leaves dwStride0 for MIPT; Process has no case0 and retains zeroed destinations. Corrected prior invented176 interpretation to original zero record behavior after valid decompression. Added plaintext/encrypted MIPT regression. This supersedes earlier claims of ordinary MIPT record decoding; original MIPX remains the actual resource format. Bounds checks avoid reproducing malformed-input out-of-bounds reads. macOS/Android arm64 builds passed;20 nonvisual CTests passed, including new independent oracle;925 reference files unchanged. render_3d remains excluded for unresolved timeout. Unrepresented sockets/weight/additional flags, icons/descriptions/load/reset semantics, player inventory metadata, locale startup, derived combat, skill execution and rendering remain outstanding. Full Windows parity goal remains active; no live server/device validation.

2026-10-05: full common item record fields and prototype socket query

Retain internal name, weight, all eight signed prototype sockets and alter-to-magic/specular/gain-socket bytes, completing the common active r156 destination fields. Original r158-only wWearableFlag is not copied by TItemTableAll into active r156, so the port also ignores it. These prototype sockets are distinct from per-instance inventory sockets. Replaced item.GetSocket placeholder with selected prototype data, original BYTE index conversion and out-of-range -1. Expanded independent Windows record oracle across all three formats/plaintext/encryption with distinct negative sockets and nonzero byte fields. Python regression compares all eight real Sword+0 sockets and tests index8/-1/256 semantics. macOS/Android arm64 builds passed;20 nonvisual CTests passed;925 references unchanged. render_3d remains excluded for unresolved timeout. Complete common record decoding does not establish the full item system: fabricated initial metadata, item descriptions/icons/load/reset lifecycle, player inventory APIs, locale startup, derived combat, skill use and rendering remain incomplete. No live server/device or visual validation; full alignment goal remains active.

2026-10-05: inventory item metadata queries

Replaced player.GetItemFlags, IsAntiFlagBySlot, GetItemTypeBySlot and GetItemSubTypeBySlot placeholders with the AVA2 PythonPlayerModule/PythonPlayer behavior. Flags and anti-flags come from server item instances, independently of prototype flags; type/subtype resolve exact/range prototype records without changing selected item. Preserve Win32 signed DWORD return and BYTE/WORD window/cell conversion. Apply active SItemPos bounds: inventory262, equipment228, dragon-soul1152, special180, switchbot6, change-equipment102; safebox/mall/separate belt windows are invalid here. Regression covers high-bit signed flags, both argument forms, negative masks, window isolation, integer wrapping, invalid boundaries and flags from decoded extended item packets. macOS and Android arm64 builds passed;20 nonvisual CTests passed;925 references unchanged. Existing render_3d timeout, locale startup and wider gameplay/rendering gaps remain unresolved; full alignment remains active.

2026-10-05: item grade and refine eligibility

player.GetItemGrade now follows AVA2 PythonPlayerModule: resolve the requested inventory window/cell, select its item with normal 60001 fallback, preserve failed-selection behavior, and read the final decimal character of the selected locale name instead of guessing vnum%10. It also preserves the observable selected-item change. player.CanRefine now returns original eligibility codes instead of None. Check worn inventory/equipment slots first (6), require USE/TUNING scroll, select target with original fallback, reject rods (7), and return 1/5 according to prototype dwRefinedVnum. Invalid scroll returns0. Reused active position bounds for target lookup. Other invented IsRefineGradeScroll/GetItemRefineInformation helpers and broader refine UI/server transaction handling remain outstanding. Tests use real loaded scroll/rod/Sword+0/+9 prototypes, two inventory windows, selection side effects, worn-slot ordering and next-grade rejection. macOS/Android arm64 builds passed;20 nonvisual CTests passed;925 original references unchanged. render_3d timeout and wider locale/skills/combat/rendering parity remain unresolved.

2026-10-05: item use classifications

Replaced six item placeholders: IsRefineScroll (USE/TUNING), IsDetachScroll (USE/DETACHMENT), IsKey (TREASURE_KEY), IsMetin (METIN), CanAddToQuickSlotItem (USE/QUEST), GetUseType (original active subtype strings, NOT_USE_TYPE/USE_UNKNOWN_TYPE). All select their requested item, apply original fallback and preserve selected-pointer side effects. Soulbind/element inactive cases remain absent; active attribute67 and costume cases included. Regression samples every distinct type/subtype in the real item table, verifies classification and use strings, and checks selected refined-vnum state. macOS/Android arm64 builds and20 nonvisual CTests passed; expanded Python query regression passed;925 baseline references unchanged. Locale startup, fake seed metadata, wider item transaction/skill/combat/rendering behavior remain incomplete; render_3d timeout unresolved.

2026-10-05: inventory sell price

player.GetISellItemPrice now resolves inventory instance count and exact/range prototype sell price without changing item selection. Active COUNT_PER_1GOLD flag uses unsigned count/price; ordinary items use DWORD count*price. Return preserves original signed Win32 int overflow and invalid-position/missing-prototype zero. Corrupt zero divisor raises ZeroDivisionError instead of reproducing the original native division fault. Regression checks all loaded real prototype records with maximal DWORD stack count (excluding zero divisors), plus invalid-window/cell cases. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Full parity remains incomplete, including valuable-item warnings, locale startup, item transactions, skills/combat and rendering; render_3d timeout remains unresolved.

2026-10-05: valuable inventory item predicate

Replaced player.IsValuableItem zero placeholder with original selected-item lookup/fallback and predicate: any nonzero instance socket among Packet.h METIN_SOCKET_COUNT=6, or prototype sell price strictly greater than5000. Stored sockets6/7 do not contribute; count does not multiply the price threshold. Preserve selected-item side effect and missing-data exception. Regression uses real cheap/expensive prototypes, maximal stack count, individually negative values in all eight sockets, both position argument forms and selected refined-vnum. macOS/Android arm64 builds and20 nonvisual CTests passed;925 original references unchanged. Predicate availability does not prove full warning UI/transaction flows; locale startup, broader item/skill/combat and rendering parity remain incomplete, with render_3d timeout unresolved.

2026-10-05: inventory index/count position semantics

player.GetItemIndex/GetItemCount now use the active original SItemPos validity rules per window rather than the ordinary inventory array's size. This restores access to dragon-soul cells beyond ordinary inventory capacity and rejects invalid equipment/special/switchbot/change-equipment cells and storage windows. Preserve BYTE/WORD argument conversion and original signed Win32 DWORD-to-int returns. Invalid argument counts now raise rather than returning zero with a pending Python error. Regression seeds every supported window's last valid/first invalid cell, high-bit vnums/counts, invalid storage window and wrapped window/cell arguments. macOS/Android arm64 builds and20 nonvisual CTests passed;925 original references unchanged. Socket/attribute position conversion and remaining slot classification/transaction/locale/skills/combat/rendering remain outstanding; render_3d timeout unresolved.

2026-10-05: instance socket/attribute position semantics

player.GetItemMetinSocket/GetItemAttribute now apply active per-window SItemPos bounds and BYTE/WORD window/cell conversion, restoring dragon-soul high-cell access and excluding invalid cells. Preserve all eight signed sockets and fifteen BYTE/SHORT attributes; invalid socket/attribute indices still return zero rather than wrapping. Invalid argument signatures return Python exceptions without the former pending-error/return-value mismatch. Expanded every-window boundary fixtures with socket7=-123 and attribute14=(255,-32768), plus legacy inventory argument forms, wrapped positions, negative and first-invalid field indices. macOS/Android arm64 builds and20 nonvisual CTests passed;925 original reference files unchanged. Remaining slot classification, item transactions, locale startup, skills/combat and rendering gaps remain; render_3d timeout unresolved, full alignment active.

2026-10-05: equipment/costume/belt slot classifications

Corrected PythonPlayerModule predicates using active GameType.h constants: IsEquipmentSlot180..228 inclusive (distinct from internal IsEquipCell180..215); IsDSEquipmentSlot inventory-only216..228 inclusive; IsCostumeSlot199..203 inclusive; IsBeltInventorySlot246..261 with WORD cell conversion. Preserve original inclusive endpoint quirks and BYTE DS window conversion. Invalid argument parsing now returns an exception correctly. Regression checks all cells -1..299, endpoint/window restrictions and wrapped window/belt positions. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Full locale/item transaction/skill/combat/rendering parity remains incomplete; render_3d timeout unresolved.

2026-10-05: item count aggregation windows

GetItemCountByVnum now sums only original inventory cells0..261 using retained instance data. GetItemCountByTT now sums upgrade-storage cells0..179 (aSSUItem), replacing its incorrect alias to ordinary inventory. Both preserve unsigned DWORD accumulation and signed Win32 Python return, avoiding signed C++ overflow. Invalid arguments raise correctly. Regression separates inventory/upgrade/book storage, excludes first-invalid cells and exercises high-bit vnum and overflow (0xffffffff+3=2). macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Remaining locale/item transactions/skills/combat/rendering parity is incomplete; render_3d timeout unresolved.

2026-10-05: instance identity and custom names

Replaced player.IsSameItemVnum/GetItemNewName placeholders. Identity compares the requested DWORD vnum to the item at its validated BYTE/WORD position; empty/invalid positions resolve vnum0. Custom names read retained server instance name, with invalid-position/wrong-arity caret sentinel and bounded string extraction. Preserve original argument order and wrapped positions without changing selected prototype. Regression covers inventory/special-window identity, mismatch, wrapped positions, empty invalid cells and custom instance names. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Full locale/item transaction/skills/combat/rendering parity remains incomplete; render_3d timeout unresolved.

2026-10-05: stone attachment eligibility

Replaced player.CanAttachMetin None placeholder with original worn-equipment rejection, direct prototype lookup/error, wear-flag intersection, rod rejection and eight-socket silver/gold subtype matching. Preserve original codes0..5 and lookup behavior without changing selected item; original does not independently validate stone type. Regression uses real matching stone/weapon prototypes and socket7, covering no socket, silver-only restriction, gold socket and equipment rejection ordering. Distributed table lacks a matching normal stone fixture; normal branch remains source-reviewed rather than independently exercised. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. This predicate does not complete stone transactions/UI or broader locale/skill/combat/rendering parity; render_3d timeout remains unresolved.

2026-10-05: detachment eligibility

Replaced player.CanDetach None placeholder with original USE/DETACHMENT selection/fallback, target selection and REFINEABLE flag plus first-six-socket unsigned >2 check. Original has no worn-equipment rejection in this predicate. Active sash-clean scroll value0=7 instead requires COSTUME/SASH and signed absorbed socket1>0. Preserve selected target side effect and missing-item exceptions. Regression uses real detachment scroll and refinable sword, rejects wrong scroll and empty sockets, and distinguishes all eight socket positions with negative values (original DWORD conversion). Sash path is source-reviewed but lacks a dedicated fixture. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Transaction/UI, locale, skills/combat and rendering gaps remain; render_3d timeout unresolved.

2026-10-05: key unlock eligibility

Replaced player.CanUnlock None placeholder with original key/target selected-item lookup, fallback and type checks (TREASURE_KEY21, TREASURE_BOX20). Original does not compare values or reject worn cells separately. Preserve original argument order, BYTE/WORD position conversion, missing selected-data errors and selected-target side effect. Regression uses real key/box prototypes, special storage target, wrong key/target and selected refined-vnum state. macOS/Android arm64 builds and20 nonvisual CTests passed;925 reference files unchanged. Full transaction/UI, locale, skills/combat/rendering parity remains incomplete; render_3d timeout unresolved.

2026-10-05: independently exercised sash-clean branch

Closed the earlier detachment-test gap using actual loaded USE/DETACHMENT value0=7 cleaner and COSTUME/SASH prototypes. Tests check signed absorbed socket1 at -1/0/1/INT32_MAX, require sash target type, reject a weapon even with positive absorbed socket, and verify selected target state. Expanded ava2.python regression passed;925 reference files unchanged. No production source changed, so prior macOS/Android build validation still applies. This verifies eligibility only; full sash UI/transactions and broader gameplay/rendering parity remain incomplete.

2026-10-05: remove invented refine behavior

IsRefineGradeScroll now reproduces the actual original switch fallthrough: every arity reaches no-message Py_BuildException, whose ScriptLib implementation clears errors and returns None. Selection/value code is unreachable. Removed guessed vnum/name rules; regression covers valid/invalid signatures and unchanged selection. This intentionally preserves source behavior rather than repairing the reference bug. Removed extra GetItemRefineInformation export and invented vnum+1/cost/probability calculation; original PythonPlayerModule and Python UI have no such API. Tests now assert its absence. Previous interrupted builds/tests were confirmed terminal and passing; final macOS/Android arm64 builds and20 nonvisual CTests passed,925 references unchanged. Actual server refine transactions, locale, skills/combat and rendering remain incomplete; render_3d timeout unresolved.

2026-10-05: item equipment classification

Replaced item.IsEquipmentVID zero placeholder with original selected-item lookup/fallback and CItemData::IsEquipment predicate (WEAPON/ARMOR only). Costume/rod/other item kinds do not count. Preserve selection side effect; regression samples every distinct real type/subtype and checks selected refined-vnum state. macOS/Android arm64 builds and20 nonvisual CTests passed;925 reference files unchanged. Full locale/item transactions/skill/combat/rendering parity remains incomplete, with render_3d timeout unresolved.

2026-10-06: net exchange/safebox/messenger/party/guild/quest senders

Compared PythonNetworkStreamModule.cpp wrappers and PythonNetworkStreamPhaseGame*.cpp / PythonNetworkStreamPhaseGameItem.cpp senders against src/python_net.cpp and PythonNetworkStream.cpp. Corrections: safebox item move was a wrong 4-byte struct; it is now the original 11-byte {header 77, TItemPos src, TItemPos dst, DWORD count} layout. Exchange senders gained the original main-actor action gate and default TItemPos {INVENTORY, 0xffff}; exchange ItemDel is a no-op returning true, as on Windows. Replaced about 45 net placeholders with verbatim-style wrappers and senders: exchange, safebox/mall checkout (2/3-arg switches; Mall raises Py_BuildException otherwise), messenger add by VID/name and remove (with target-board refresh), party invite/answer/remove/state/skill/parameter (remove only in Game phase), all 15 guild subheaders (comment refresh 1000 ms throttle; post comment BYTE length incl. NUL), answer make guild, quest input string/long string/confirm, script select item, target info load, refine-info request no-op. Added the CG headers/subheaders/length constants to Packet.h; the packet-constant audit now covers MESSENGER/GUILD CG subheaders (155 checked, 0 mismatches). Python interface audit placeholders 749 → 618. Tests: ava2.python golden-byte block for every new sender, outside-Game party remove, messenger board callback, guild throttle, argument failures, and exchange gate with a controlled main actor. Validation: macOS build passed; Android arm64 libmain.so built (SDL3 3.4.16 rebuilt for arm64 in a scratch prefix); 925 reference files unchanged. CTest: 16/20 nonvisual pass. ava2.python, window_tree, speedtree_forest, mark_manager fail identically on the unmodified baseline commit. The cause is the environment, not this change: assets now live at ../AVA2/TEST/1. Client DEV/pack_maker, while sources/tests still hardcode /Users/shen/... and cwd-relative ymir work/locale/UIScript. With a scratch run directory mirroring upstream/python-root plus ymir work, python_test (including the new block) passes. Remaining: SelectEmpire/ChangeName (select-phase LoginClient path), SendEmoticon (needs chat receive parsing), offline-shop AddItem/TakeMoney/ChangeTitle/Check/Button, party/guild member state (PartyExit/RemoveVID/GuildRemoveMember lookups always fail), other modules' placeholders, and configurable asset roots. render_3d remains excluded for its unresolved timeout.

2026-10-06 (pass 2): receive loop, chat/whisper, server commands

Compared CNetworkPacketHeaderMap/CheckPacket, GamePhase()/LoadingPhase() dispatch, RecvChatPacket/RecvWhisperPacket (ENABLE_MULTILANGUAGE_SYSTEM), ServerCommand (PythonNetworkStreamCommand.cpp), SendChatPacket/emoticon handling and PyCallClassMemberFunc semantics against src/eter_net and src/python_net.cpp. Corrections:

  • Receive loop: header sizes now come from Ava2GcPacketTable.inc, produced by tools/generate_ava2_gc_packet_table.py. The script evaluates the reference CMainPacketHeaderMap and GamePhase switch with clang i686-pc-windows-msvc, giving 138 mapped headers and 119 GamePhase handlers.
    • Zero padding is skipped. A dynamic size is read from the WORD at offset 1, and the loop waits until the whole packet has arrived.
    • An unmapped header triggers a trace, clears the buffer and requests quit, standing in for PostQuitMessage. main.cpp stops the loop.
    • A handler that returns false triggers a trace and clears the buffer, as RecvErrorPacket does.
    • In the Game phase, the loading-only headers 15/113/137/138 reach RecvDefaultPacket, which clears the buffer.
    • A GamePhase header with no port yet is skipped as exactly one packet and recorded, so the stream no longer desyncs.
  • Python callbacks use PyCallClassMemberFunc. A missing method is skipped, and an exception is printed instead of propagating as a C++ throw.
  • Chat:
    • types ≥ CHAT_TYPE_MAX_NUM (15) are dropped; COMMAND goes to ServerCommand;
    • an unknown VID is dropped;
    • for chatter types, the text after ": " is checked against ParseEmoticon;
    • RegisterChatTail is called except for SHOUT;
    • AppendChat runs only for PC actors;
    • with VID 0, SHOUT goes to AppendChat and every other type goes to the game window's GetLocaleString(type, text).
  • Whisper uses the original 31-byte header with bLanguage/bEmpire, enforced by static_assert:
    • CHAT/GM → OnRecvWhisper(type, name, "name : msg", lang, empire);
    • SYSTEM/ERROR → OnRecvWhisperSystemMessage;
    • anything else → OnRecvWhisperError.
  • ServerCommand (new src/eter_net/PythonNetworkStreamCommand.cpp, with a provenance header):
    1. ConsoleEnable returns early.
    2. BINARY_ServerCommand_Run is tried on the game window, or on the parser window when there is no game window. A true result stops processing.
    3. Tokens are split with SplitToken (quotes kept together, case preserved).
    4. The original strcmpi chain then runs. It covers gift, cube, Observer*, OfflineShopSetFlag, cards, Zodiac, mobile_auth, messenger_auth, setblockmode, quit, sms/nosms and combo.
    5. Unknown commands trace "Unknown Server Command".
  • New net functions: PreserveServerCommand/GetPreservedServerCommand, SetServerCommandParserWindow, RegisterEmoticonString (max 128) / SendEmoticon, EnableChatInsultFilter and SetEmpireLanguageMode, each with the original constructor-lifetime state.
  • player.IsObserverMode and HasMobilePhoneNumber now read the stream state.
  • SendChatPacket returns true for empty input or input of 512 bytes or more. A bare "/" repeats the last slash command. Tests: ava2.python now covers all of the above. That includes the cube/messenger_auth quoted tokens, Run=True short-circuit, the 31-byte whisper cases, a missing or raising callback, the "/" repeat, an unported header-36 skip with a partial wait, unknown header 250 → quit (cleared again by ResetConnection), and header 138 in the Game phase. Validation: macOS build clean; Android arm64 libmain.so built; 925 reference files unchanged; packet constant audit 155/0; interface audit 609 placeholders, down from 618. CTest -E render_3d gives 16/20, with the same four environment failures as before. Correction to pass 1: that pass reported python_test as passing, but it had actually stopped early. CreateCharacterWindow aborted on the missing ui/pattern texture, and the harness returns rc=0 when Python aborts, because app.Abort is a no-op. The run directory now needs a merged lowercase ymir work overlay of every pack_maker */ymir work, with PC first, then ETC, then root, then the rest; it also needs map → pack_maker/Maps and textureset → Maps/textureset. In that setup the full python_test reaches its final "passed" line. Always check the log for that line, not the exit code. Remaining:
  • 75 Windows GamePhase handlers are still unported; they are now skipped safely: 18, 36, 39, 40, 41, 43, 45, 46, 47, 48, 58, 61, 62, 63, 66, 68, 69, 71, 74, 75, 77–83, 89, 91–93, 95, 99, 110–112, 114, 115, 119, 121, 123–125, 130–132, 134, 141, 152, 153, 156, 171, 204, 205, 208, 209, 213–218, 220, 221, 230, 231, 235, 241, 242, 249, 252, 255.
  • Headers 96/97/98 appear in the switch but not in the header map, so they behave as unknown on Windows too.
  • The chat module is entirely placeholder (33/33), so AppendChat only reaches the callback.
  • Not ported: emoticon effect playback, the insult filter, the empire convert table (YMIR locale only, so a no-op for AVA2), emotions, StoneDetect, stamina, OfflineShop SetShopFlag and the combo skill slot level.
  • The Login/Select phases share one dispatcher.
  • app.Exit/Abort are no-ops.
  • Asset roots are hardcoded.
  • render_3d is still excluded because of its timeout.

2026-10-06 (pass 3): remaining GamePhase handlers

Ported 63 of the 75 skipped GamePhase() headers in the new src/eter_net/PythonNetworkStreamPhaseGameRecv.cpp. Each one follows the matching handler in PythonNetworkStreamPhaseGame.cpp, PhaseGameItem.cpp, PhaseGameActor.cpp or PhaseHandShake.cpp, with the AVA2 Locale_inc.h feature set. Wire reads and Python callbacks match the reference one for one.

  • Ported headers: 18, 36, 39–41, 43, 45, 46, 48, 58, 61–63, 66, 68, 69, 71, 77–80, 82, 83, 89, 91, 92, 95, 99, 110–112, 115, 119, 121, 123–125, 130–132, 134, 141, 152, 153, 204, 205, 208, 209, 213–216, 218, 231, 235, 241, 242, 249, 252 and 255.
  • Handshake and server time: 255 stores the server time sync and sends TIME_SYNC (0xfc) with dwTime+2·lDelta, sequenced. 252 calls SetServerMSec. 255, 252, 152 and 153 return from GamePhase() as on Windows, so the rest of the buffer and the refresh block wait for the next frame.
  • Refresh block now runs in Windows order: Character, Inventory, Skill, Status. The new Character flag is set by ChangeSkillGroup.
  • XTrap 205 replies with 204 plus 128 bytes without SendSequence. XTRAP_CLIENT_ENABLE is off in the reference, so the reply data is left uninitialised there; the port sends zeros. The send queue now carries a per-packet sequence flag through LoginClient/LoginSession::send_game_packet.
  • Packets that fail on Windows still fail here, so RecvErrorPacket clears the buffer:
    • HS 204: neither HackShield nor LOCALE_SERVICE_GLOBAL is defined.
    • Unk213: the Recv(sizeof(...)), &pkt comma bug.
  • Refine 95/119 use the ENABLE_MULTI_REFINE_WORLDARD subtype callbacks: 95 → OpenRefineDialog/AppendMaterialToRefineDialog, 119 → BINARY_MULTI_REFINE_ADD_INFO/ADD_MATERIAL.
  • Player and actor state now updated:
    • party members;
    • PVP and duel keys;
    • Remember*/ForgetInstance;
    • kill log;
    • skill group, together with NEW_ClearSkillData;
    • walk mode;
    • fishing state;
    • ownership;
    • dungeon destination.
  • Target and TargetInfo use CanViewTargetHP, which includes Hydra race 6801, and pass the hide-costume string bounded. Gaps (consumed exactly, logged here):
  • Atlas/minimap marks and target effects: 115, 123–125.
  • Guild land areas and the symbol download: 130.
  • Fly targets: 69, 71.
  • Dig, fishing and emotion motions.
  • Specific effect: 208.
  • Hybrid-crypt pack keys: 152, 153.
  • CheatBlacklist: 249.
  • Native stores: sash material, bank log, chest-drop items.
  • The dungeon auto-walk.
  • RefreshAllPCTextTail after DuelStart.
  • The 300 ms refresh throttle.
  • Not ported yet (12 headers): 47, 74, 75 (guild), 81, 93, 114, 156, 171, 217, 220, 221, 230. Tests: ava2.python checks golden wire bytes and callbacks for:
  • Handshake TIME_SYNC bytes, sequence flag and stop-frame;
  • HandshakeOK server msec;
  • the unsequenced XTrap ACK;
  • HS/Unk213 buffer clear;
  • the HybridCrypt stream skip;
  • refine 95/119;
  • refresh order;
  • PVP key;
  • Sash, KingdomsWar, Sungma, lover, 67Attr, guild-name;
  • ExchangeLog LOAD/LOAD_ITEM, CatchKing, Calendar/ADM, DS refine;
  • exact consumption of Land, NPC list, Dungeon and blacklist. The unported-skip test now uses header 75. Validation:
  • macOS build clean.
  • python_test reaches its "passed" line.
  • CTest -E render_3d gives 16/20, with the same four environment failures. render_3d is still excluded because of its timeout.
  • Android arm64 libmain.so built.
  • 925 reference files unchanged.
  • Packet constant audit: 210 checked, 0 mismatches.

2026-10-06 (pass 4): quest state, Python getters and completion harness

Reference: upstream/ava2-client/UserInterface/PythonQuest.cpp, PythonQuest.h, Packet.h::packet_quest_info/QUEST_SEND_* and PythonNetworkStreamPhaseGame.cpp::RecvQuestInfoPacket (ENABLE_MULTILANGUAGE_SYSTEM active).

  • HEADER_GC_QUEST_INFO81 is no longer skipped. Decode the six-byte packed Win32 header and flag-ordered 1/31/17/4/17/4/25-byte fields; force the original final string bytes to NUL.
  • Ordered records distinguish array indices from DWORD quest IDs. Wire BEGIN deletes then appends, UPDATE creates a missing record and updates only nonempty strings/flagged values, END deletes. Reset the countdown start only on BEGIN/create or a flagged clock update.
  • ^ titles are delegated to GetQuestLetterName with the original (type,index,flag,title,clockName,counterName,icon,clockValue,counterValue) arguments. RefreshQuest follows state changes or the translation callback, including END.
  • Replaced all six quest placeholders: GetQuestCount, GetQuestData, GetQuestIndex, GetQuestLastTime, Clear, Add. Add's BEGIN duplicate guard differs from wire BEGIN exactly as the source does; Add's END/unknown types do nothing. Getters use array indices; invalid indices raise RuntimeError. Original tuple/string/signed-value semantics retained, with portable image handles replacing Win32 pointers and the original explicit/default icon paths.
  • Header size/offset and all seven flags are extracted directly from the original source by generate_ava2_item_oracle.py and compared in windows_item_oracle_test.
  • Malformed flagged payload lengths are bounded before subsequent packet reads. This avoids reproducing the original cross-packet read on corrupt declared sizes.
  • Timer uses elapsed monotonic application seconds. Original virtual/frame-timer mode is not ported or verified. Missing icon resources yield handle0 through the existing resource adapter. This is task-list state parity, not full quest script interpreter/UI rendering parity.
  • tests/quest_test.cpp verifies wire fragmentation plus following ping, signed counter values, packet BEGIN replacement/reordering, Python BEGIN duplicate retention, UPDATE empty strings/clock flags, negative/expired countdowns, high DWORD Python IDs, invalid array indices, multilingual callback-to-Add flow, END, Clear and malformed state preservation.
  • tests/check_completion.py now wraps ava2.python and ava2.quest. Both a zero process status and final success marker are mandatory. Manual harness fixtures verify early exit(0) fails and a nonzero exit containing the marker also fails. Validation: macOS build and Android arm64 libmain.so passed; quest and source oracle CTests passed. Existing comprehensive python_test passed through the wrapper using the prepared resource overlay, with final success marker present. python_view/login_loopback passed with local socket binding allowed. Nonvisual suite has four outstanding default-environment failures; render_3d still excluded. Correcting the previous description: speedtree_forest fails its canopy sway assertion, not a missing-file assertion; the other three failures involve asset/map/locale lookup. Reference hash verification925/925; packet constant audit211/0. Regenerated inventories: active method-table comparison597 overlapping placeholders (method-name coverage is not implementation parity); wider static inventory789 placeholders. The quest module lives in original PythonQuest.cpp rather than *Module.cpp, so its six replacements are covered by the dedicated regression, not that active method-table count. Remaining skipped GamePhase headers:47,74,75,93,114,156,171,217,220,221,230. Existing guild/messenger/offline-shop/system stores, quest script interpreter, configurable assets, visual effects/rendering and real server/device verification remain incomplete. No AVA2 reference or existing server changed.

2026-10-06 (pass 5): messenger and cube renewal state parity

Source basis: AVA2 PythonMessenger.cpp/.h, PythonCubeRenewal.cpp/.h, Packet.h declarations/enums and PythonNetworkStreamPhaseGame.cpp::RecvMessenger/RecvCubeRenewalPacket/CubeRenewalMakeItem/CubeRenewalClose.

  • Messenger GC74: original LIST, LOGIN, LOGOUT and MOBILE handling. All insert list membership, including offline friends. LIST connected bits select OnLogin/OnLogout then optional OnMobile(group0,name,1); explicit MOBILE preserves BYTE state. LOGIN calls RefreshTargetBoardByName after OnLogin. Case-sensitive set membership retained. INVITE/unknown subheaders have no handler and leave payload bytes for the stream dispatcher as Windows does.
  • Five messenger bindings now execute native state. RemoveFriend does not send a network request or callback; Destroy clears both lists without dropping the handler. Original no-message Py_BuildException argument failures return None. Native guild operations implement append-once/default-offline, login/logout, unconditional removal callbacks and sorted replay; GC75 is not yet connected. Replay copies the map to safely handle callback mutation instead of reproducing invalidated C++ iterators.
  • Cube GC221: fixed167-byte frame,165-byte original recipe, ordered vector append including duplicate recipe IDs. OPEN goes to the game phase window; LOADING uses the cube handler; CLEAR empties the list and retains that handler. Unknown subheaders consume the fixed frame without state changes.
  • Five cube bindings now implement count, original16-element GetDates tuple, handler registration, craft and close. Missing/negative array indices return the original15-zero + "None" tuple; missing argument returns None. Preserve Win32 signed DWORD values in Python getters and DWORD wrapping in requests. CG216 is10 bytes; craft sub4 carries index/count, close sub5 zeroes original undefined trailing fields. Both retain the original CanAct guard and sequence queue behavior.
  • Safety adaptations: own/release callback references across replacement/runtime teardown; bound messenger names to24 bytes and declared frame lengths; bound cube category to100 bytes; use a BYTE for the incoming bool representation and normalize it on query. These avoid original raw-pointer/stack-overwrite/out-of-bounds/invalid-bool behavior without inventing normal gameplay semantics.
  • Extended source extraction oracle compares original messenger structures/enums, cube structure sizes, every recipe offset and all cube subheaders. Wire fields use explicit Win32 widths; outgoing cube requests are serialized byte by byte.
  • tests/messenger_test.cpp covers split LIST+ping, mixed connection bits, signed/mobile255 state, membership during callbacks, login target refresh order, case sensitivity, deletion, sorted guild replay, clearing/handler retention, INVITE behavior, malformed lengths, raising callbacks, handler weakref ownership and a second clean runtime.
  • tests/cube_renewal_test.cpp covers literal167-byte fragmented recipe+ping,16-field signed tuples, duplicate append, open/loading/clear callbacks, invalid indices/arguments, exact CG bytes including high DWORD values, missing/controlled main actor gates, handler replacement and runtime reset. Validation: macOS and Android arm64 library builds pass; messenger/cube/quest/declaration-oracle tests4/4 pass. Nonvisual suite19/23 with the same four outstanding failures; comprehensive python_test passes in the prepared asset overlay with both zero exit and completion marker. render_3d remains excluded/unverified; no live server/device test. Packet audit214/0;925 reference hashes unchanged. Regenerated static inventory780 placeholders; active *Module.cpp-only method inventory remains597 (these two reference modules, like quest, are outside that glob). Remaining skipped GamePhase headers47,75,93,114,156,171,217,220,230. Full client parity remains incomplete.

2026-10-06 (pass 6): shop-search receive, query APIs and outgoing request

Reference: PythonPrivateShopSearch.cpp/.h, Packet.h::packet_offline_shop_item/packet_priv_shop_item_set/command_shop_search, PythonNetworkStreamPhaseGame.cpp::RecvShopSearchSet/SendPrivateShopSearchInfo and PythonNetworkStreamModule.cpp::netSendPrivateShopSearchInfo under AVA2 Windows active feature guards.

  • GC156 reads the5-byte header, WORD record count and active128-byte item records. Decode all original Win32 fields including signed64 price, signed32 count/sockets,15 BYTE/signed16 attributes, status, seller and owner. Validate count against declared frame length before reading records; append only after the complete record block is read. Do not clear results on a new reply. Set a pending refresh flag, replayed once after the current receive batch and existing status refresh; zero-result replies also refresh.
  • Replaced all12 active privateShopSearch bindings. Preserve signed DWORD Python conversion, literal"^" new-name result, invalid attribute zero tuple and too-large socket None result. ClearSearchItems clears the vector without a callback. Transmutation/perma bindings removed because WJ_CHANGELOOK_SYSTEM/ENABLE_PERMA_ITEM are inactive. Invalid record indices and negative sockets raise RuntimeError rather than allowing vector::at exceptions to escape or out-of-bounds reads; seller strings are bounded to25 bytes.
  • net.SendPrivateShopSearchInfo parses the original19 arguments, serializes89 bytes with explicit widths/field order (sex before enchant/alchemy on wire despite different Python argument order), and applies CanAct. SendUnsequenced preserves the original absence of SendSequence. Valid text is copied with deterministic zeroed padding; >49 bytes raises ValueError rather than reproducing strcpy overflow. Prices remain signed64.
  • Original-source oracle compares record/header/request sizes and all item/request offsets with the active Windows declarations. tests/shop_search_test.cpp independently builds literal128-byte records and89-byte requests, tests fragmentation+following ping, batch refresh, append/duplicate/empty replies, high DWORD IDs, negative price/count, last socket/attribute, seller/name behavior, active exports, malformed count state preservation, handler-visible results, exact unsequenced send bytes, action gates, text bounds and runtime reset.
  • Global refresh throttle is still not ported: Windows sets the next refresh time to+500ms after a search refresh. Existing CheckPacket intentionally retains the reference's WORD dynamic framing even for this DWORD-size header; replies beyond65535 bytes and that reference edge case are not verified. No real-server search or rendered search UI claim.
  • Fixed tools/audit_ava2_python_interfaces.py to discover .cpp module registration regardless of filename. Report now covers47 modules (previous29), with726 overlapping placeholder methods and7 missing guild_ranking methods: Close,CountDate,GetPageCount,GetPageView,InfoDate,Open,SetPageCount. This larger count exposes prior omissions. quest/messenger/cube/search have zero missing/extra/placeholder methods in the expanded audit. This is name coverage, not behavior verification. Validation: macOS build and Android arm64 libmain.so pass. Five targeted CTests pass; full nonvisual20/24 with the same four baseline failures; comprehensive python_test passes through completion verification in the prepared asset overlay. render_3d remains excluded. Packet constants216 checked/0 mismatches;925 reference hashes unchanged; static placeholders765. Remaining skipped GamePhase headers47,75,93,114,171,217,220,230, plus the documented native systems/rendering/asset/server/device gaps. No reference files or existing server changed.

2026-10-06 pass7 — guild receive and Python state

  • Added the34 original compiled guild methods and all actual RecvGuild subheader branches;31 guild placeholders and net's guild-ID placeholder replaced. Preserve original cache insertion, tuple/sentinel behavior, member update/sort/statistics quirks, skill slots, authority mask and native/Python Destroy distinction.
  • GC75 now supplies messenger guild membership/login/logout/removal, immediate target/invite/war callbacks and deferred page refreshes in the reference order. Main actor guild changes update net.GetGuildID and the matching character-selection roster; name-based remove-member sending uses the real PID.
  • Win32 guild structures/enums/offsets are checked against source-extracted declarations. New guild_test validates state, embedded Python and literal fragmented/coalesced wire fixtures, including bounded malformed packets.
  • GVG keys are present; ChangeGVG text-tail/name colours remain a documented gap. Guild protocol/API coverage does not imply full combat/UI parity.
  • Interface audit now filters original .cpp files by Windows vcxproj compilation entries:46 modules,0 missing methods,694 overlapping placeholders; guild/quest/messenger/cube/search have no missing/extra/placeholder method names. Previous guild_ranking missing names were a false positive from orphan source.
  • Corrected the earlier refresh-throttle claim: the reference early-return guard is commented out. Its300/500ms timestamp assignments have no active throttling effect.
  • Builds pass on macOS Debug and Android arm64. Targeted tests6/6; full nonvisual CTest21/25 with the same four existing failures. The comprehensive Python test passes in the prepared asset overlay after replacing its outdated skipped-GC75 fixture with GC47. Static inventory733 placeholders;217 packet constants match;925 reference hashes unchanged. Remaining skipped game headers47,93,114,171,217,220,230; render_3d remains excluded/unverified.

2026-10-06 pass8 — battle pass

  • Replaced all8 battlepass placeholders. GC230 now dispatches the original two independent append-only lists, time, clear modes and loading/game callbacks. GetDates/GetDatesCount/GetDatesItems preserve original tuple shapes, defaults and signed values; invalid negative reward slots are bounded.
  • CG230 OPEN/REWARD encode6 Win32 bytes with the original CanAct and SendSequence behavior; OPEN undefined padding is zeroed. Owned Python handler references survive list clears and release on replacement/runtime teardown.
  • Literal fragmented/coalesced packet fixtures and source-extracted structure/enum/offset oracle checks pass. macOS Debug and Android arm64 builds pass; targeted7/7 and full nonvisual22/26 tests, with the four previously documented failures unchanged. Comprehensive Python regression passes in the prepared asset overlay. Static inventory725 placeholders, compiled-interface placeholders686,219 matching packet constants and925 unchanged reference files. Remaining skipped GamePhase headers47,93,114,171,217,220; full gameplay/rendering parity remains incomplete.
  • Ported all8 drop_item methods, including the former hidden GetDates no-op. GC220 supplies ordered results and original clear/page/game/loading callback behavior; signed values, defaults and100-byte name bounds are verified.
  • CG215 OPEN/SEARCH use6 explicit Win32 bytes, original CanAct and SendSequence; undefined OPEN vnum padding is zeroed. Registered Python handlers survive clears and release on replacement/runtime teardown.
  • Literal fragmented/coalesced wire/native/Python tests and source-extracted protocol oracle pass. macOS Debug and Android arm64 builds pass; targeted8/8, full nonvisual23/27 with four existing failures unchanged, comprehensive Python regression passes in the prepared resource overlay. Static placeholders718, compiled-interface placeholders679,221 matching packet constants,925 unchanged reference files. Remaining skipped GamePhase headers47,93,114,171,217. Full gameplay/rendering parity is incomplete.

2026-10-06 pass10 — dungeon information

  • Replaced all12 dungeon_info methods and removed six fabricated dungeon entries/11-field query data. Original GC217 data drives the21-field info, mission and ranking queries, page behavior and original signed/default values.
  • Ported independent list clears, mission-send ranking-clear fallthrough, immediate game callbacks and all four CG213 requests with explicit6-byte Win32 encoding, CanAct and SendSequence. OPEN undefined index padding is zeroed; fixed strings are bounded.
  • Literal fragmented/coalesced packet/state/Python tests and source-extracted structure/enum/offset oracle pass. macOS Debug and Android arm64 builds pass; targeted9/9, nonvisual24/28 with four known failures unchanged. Comprehensive Python regression passes in the resource overlay. Static placeholders710, compiled-interface placeholders671,223 matching packet constants,925 unchanged reference files. Remaining skipped game headers47,93,114,171; full gameplay/rendering parity remains incomplete.

2026-10-06 pass11 — switchbot

  • Replaced9 existing but behaviorally incorrect switchbot methods: remove local fake run-state transitions and fabricated attribute lists/maxima; use GC171 table/item/server map state and actual player item-proto classification. Preserve internal6/exposed5 slots, BYTE/short conversions, original ClearSlot finished retention, sorted/deduplicated attribute map and32-bit max versus16-bit list values.
  • Item updates ignore packet vnum, retain existing item fields and update all8 sockets/15 attrs. Player-window RefreshInventory occurs after count update and before socket/attribute changes; phase-window item refresh follows. CG171 start/stop match original Win32 bytes/sequencing, absence of action guard and slot6 boundary/header-size quirk.
  • Original-source struct/enum/offset oracle and literal native/Python wire tests, including isolated generated item-proto classification fixtures, pass. macOS Debug and Android arm64 builds pass; targeted10/10, full nonvisual25/29 with the same four known failures. Comprehensive Python regression passes in the prepared resource overlay.225 matching constants,925 unchanged references. Static710/compiled671 placeholder counts are unchanged because the old functions were not named dummy; behavior still differed substantially. Remaining skipped game headers47,93,114; full parity remains incomplete.

2026-10-06 pass12 — item shop

  • GC93 now executes the original dragon-coin/log/item/catalog receive branches and game-window callbacks. Preserve64-bit prices/sales, signed DWORD values, original callback order, duplicate entries and per-category main-page opening/sentinel/zero-category behavior. No invented native item-shop store or extension API.
  • BUY/RELOAD/LOG_ADD/unknown payload remains for the dispatcher as Windows does; malformed lengths/counts and unterminated strings are bounded. Original Python UI/chat-based requests remain unchanged, so full rendered store interaction parity is still unverified.
  • Literal fragmented/coalesced callback tests and source-extracted Win32 structure/enum/offset oracle pass. macOS Debug and Android arm64 builds pass; targeted11/11, nonvisual26/30 with the same four known failures. Comprehensive Python regression passes in the resource overlay.226 matching constants,925 unchanged reference files; static710/compiled671 placeholder counts unchanged. Remaining skipped headers47,114; full client parity remains incomplete.

2026-10-06 pass13 — offline shop

  • GC47 now drives original shop item/metadata state and START/END/UPDATE/scalar/error callbacks. Replaced27 active PythonShop.cpp offline placeholders; preserve reversed logs, vnum-gated lookup, missing strings, Clear behavior, signed values and64-bit money/flags. Original IsOfflineShop is never set and remains0; CHECK_RESULT alone updates HasOfflineShop.
  • Stock replacement/deletion/price query and display sorting feed explicit Win32 CG58 build requests; CG57 decoration uses the original58+52-byte layout. No action gate or local server-success state is invented. Uninitialized bytes are zeroed, strings bounded, decoration text copied literally and malformed records rejected safely.
  • Original-source struct/enum/offset oracle and independent fragmented/coalesced wire/state/Python fixtures pass, including second-tab updates and zero-price logs. macOS Debug and Android arm64 builds pass;12 targeted tests pass, nonvisual27/31 with four existing failures.228 matching constants,925 unchanged references;683 static/644 overlapping compiled-interface placeholders remain,0 missing names across46 compiled original modules. Comprehensive Python regression passes in the prepared resource overlay. Remaining skipped header114; full client parity is incomplete.

2026-10-06 pass14 — item sound and equipment request guards

  • Ported original use/drop filename category state and selection, replacing2 item extension no-ops. Retain silent USE_POTION client use, separate native server-potion helper, bow/arrow/quiver, body/neck/ear, ability-up/talisman rules, missing-item suppression and selected-item retention.
  • Inventory use/move and safebox/mall requests now call original sound paths before send. Equipment requests retain exchange/shop/attacking restrictions and original source-cell-only rule; CanAct suppresses sound/send. No new drop/pickup/use-to-item sounds.
  • Independent24-category item-proto fixtures, generated WAV playback/cache evidence, source enum oracle and guarded packet/notification tests pass. macOS Debug and Android arm64 builds pass;13 targeted tests and comprehensive Python overlay regression pass. Nonvisual28/32 with four previous failures;681 static/642 compiled-interface placeholders remain.228 matching constants,925 unchanged references. GC114 remains skipped; full bone/effect/audio/device equivalence and full client parity remain incomplete.

2026-10-07 pass15 — item database and resource data

  • Removed7 fabricated item records, automatic item_names/list reads, inferred list-column types and hardcoded model fallbacks. Ported native original item-list/description loaders and ordered prototype icon fallback; selected/unloaded state, text/model/description/socket overwrites, failure retention and prototype sizes now follow AVA2.
  • Icon pixels no longer determine item grid size. Missing selected data raises; missing image returns Noname. Configured decoded-root image lookup and logical resource filenames now agree with the item loader instead of relying solely on process cwd.
  • Independent literal proto/TGA/list/description fixtures and related15 targeted tests pass. macOS Debug/Android arm64 builds and comprehensive Python overlay regression pass.925 immutable references unchanged;681 static/642 compiled-interface placeholders remain. Final nonvisual29/33 has the same four previously documented failures.228 protocol constants match. Full app.LoadLocaleData integration, complete resource/render lifecycle and full client parity remain pending.

2026-10-07 pass16 — locale data coordinator

  • app.LoadLocaleData now follows the original LoadLocaleData order, Destroy calls, fatal/non-fatal steps and integer result (item list/proto/desc, mob_proto, SkillDesc/SkillTable, pet_skill, insult, npc_wear, mob_scale, item_scale). Previously it was a no-op, so in-game item/mob/skill/pet data never loaded through the original path.
  • petskill module + RegisterSkillPet, CInsultChecker with net.LoadInsultList/IsInsultIn/IsChatInsultIn and the received-chat '*' filter, LoadMobScale, LoadNPCWear and LoadItemScale ported as data stores.
  • Not yet consumed: NPC wear/item scale renderer paths, CPythonWiki::ReadData; YMIR cvt tables intentionally skipped (EUROPE).
  • macOS Debug/Android arm64 builds and comprehensive Python overlay regression pass. Nonvisual 29/33 (render_3d excluded: timeout) with the four existing failures; 228 constants, 925 references unchanged, compiled-interface placeholders 642 -> 634.

2026-10-07 pass17 — GC114 effects, name colours, NPC wear, wiki, receive buffer

  • GC114 special/specific effects, the CInstanceBase effect table, bone/root attached effects and emoticons (1000 ms gate) are ported. The player-settings effect/emoticon/sound tables (236/12) are registered at app.Create, and the chrmgr effect/emoticon/name-colour bindings are no longer stubs. Name colours follow PVP/DUEL/GVG/party/empire mode, and text tails refresh on those events.
  • NPC wear is applied in AppendActor, using the Warp map name only, with no weapon/hair/sash for non-PCs. The sash keeps its refine effect (251) and item_scale row. chr.RaceToJob/RaceToSex, app text-file line APIs and the atof-style EffectData parser (Bezier control points) now match Windows.
  • CPythonWiki + CTextFileLoader are ported: ReadData (refine/item_proto/special_item_group/mob_drop_item), LoadMonster/ListReverse and all 22 methods, including the Windows IsBlackList argument bug. The output matches the real locale/common data.
  • The 128 KB game receive buffer now applies back-pressure, as Windows CNetworkStream does, instead of failing. DWORD-size packets frame by WORD in both clients.
  • Results:
    • macOS/Android builds pass, and the comprehensive Python overlay regression passes.
    • Nonvisual CTest is 29/33 (render_3d excluded: timeout).
    • 229 constants match, and the 925 references are unchanged.
    • Compiled-interface placeholders went from 634 to 618.
  • Remaining:
    • Sash/NPC-wear mesh attachment and the item-scale renderer.
    • Fly/race-motion settings and HAIR_COLOR_ENABLE.
    • Wiki: MIPT/unordered order/OOB differences.
    • Resource/audio lifetimes, device/server equivalence and render_3d.

2026-10-07 pass18 — race/shape/hair/weapon/sash model mounting

  • The fake race/weapon/hair path helpers are gone. CRaceData/CRaceManager (.msm shape/hair/skins, bones, npclist, motlist) are ported, and app.Create loads npclist plus the eight player races.
  • CInstanceBase::Create/ChangeArmor/ChangeWeapon/ChangeHair/SetSash order and gates now match Windows: the NPC-wear path, the PC-only parts, !IsPC && race > 8, animal-wear/wedding-dress weapons, ArmorVnumToShape and m_awPart. CActorInstance AttachWeapon follows the hand rules (dagger/bow/fan) and keeps stale slots, as Windows does. AttachSash uses Bip01 Spine2 with its own motion and the sash-only item_scale. app.SetHairColorEnable/SetArmorSpecularEnable are wired, and weapon effects use the race bones.
  • Results:
    • macOS/Android builds pass, and the Python regression passes with real-asset mount assertions.
    • CTest is 29/33 (render_3d excluded: timeout).
    • The 229 constants and 925 references are unchanged, and interfaces are 618/46/0.
  • Remaining:
    • Most AVA2 gr2 are BitKnit-compressed, which libgr2 cannot decode, so the meshes do not draw yet.
    • Specular/LOD/trace/refine/shining are not ported.
    • The bow motion mode, PC motion registration, tree races and the chr preview path table.

2026-10-07 pass19 — BitKnit2 gr2 decompression

  • Granny 2.11 format 4 is BitKnit2, not BitKnit. libgr2 now decodes it (shared/gr2/src/bitknit2.cpp, MIT provenance BG3ModStudio, cross-checked against ooz), including the compressed pointer-fixup tables.
  • Results:
    • All 6406 BitKnit2 gr2 in the AVA2 pack tree load, with 10833 sane meshes.
    • The warrior shape/hair/weapon/sash now draw with the .msm skins applied (python_test asserts this).
    • macOS/Android builds pass.
    • CTest is 29/33 (render_3d excluded: timeout).
    • The 229 constants and 925 references are unchanged, and interfaces are 618/46/0.
  • Remaining:
    • 156 64-bit/big-endian gr2 are still rejected.
    • Oodle0 and BitKnit v1 are unimplemented (no AVA2 samples).

2026-10-07 pass20 — 64-bit gr2 + curve2 animation curves

  • 64-bit gr2. libgr2 now loads 64-bit little-endian Granny files. Only pointer slots inside section data are 8 bytes, which changes the type-def entry size, member sizes and in-member offsets. All 156 previously rejected AVA2 files load (plechi_* zones/bosses, shadow_dragon, some weapons).
  • curve2 animation. Granny 2.11 curve2 animation curves are decoded: constants, float and keyframe splines, K16u/K8u quantised curves, and D4n compressed quaternions (19 variants, all 17 used by AVA2). They cover 3111 32-bit and all 59 64-bit animation files, which previously left the compressed bones at bind pose.
  • Results:
    • 16725/16725 gr2 load.
    • Decoded quaternions are unit length and their bind-angle distribution matches the float curves.
    • python_test asserts that shadow_dragon run animates.
    • macOS/Android builds pass.
    • CTest is 29/33 (render_3d excluded: timeout).
    • The 229 constants and 925 references are unchanged, and interfaces are 618/46/0.
  • Remaining:
    • Big-endian, Oodle0 and BitKnit v1 (0 samples).
    • Keyframe curves step per TimeStep.
    • No render_3d visual check.

2026-10-07 pass21 — render_3d timeout

  • Cause. The software renderer Gr2SceneRenderer::RenderDraw had a leftover outer per-triangle loop, so each mesh was rasterised num_tris times (O(n²)). This took about 11–26 s per frame and 126 s per test run. It also over-composited blended and additive draws. That loop has been removed. The Windows client draws through D3D, so the GPU path was never affected.
  • Environment. tools/make_test_rundir.py builds a merged client-root run directory. AVA2_TEST_RUNDIR and AVA2_PACK_MAKER replace the /Users/shen paths. When the assets are missing, the test is skipped (exit 77).
  • Results:
    • render_3d takes 2.3 s under CTest's 15 s timeout.
    • Full CTest is 30/34, with the same four environment failures.
    • python_test passes, and the macOS/Android builds pass.
    • The 229 constants and 925 references are unchanged, and interfaces are 618/46/0.

2026-10-07 pass22 — the four environment test failures

  • Parity fix. PyTuple_GetPointer used to fail on any pending Python error. ScriptLib Py_BuildException("msg") leaves an error set while returning None, so after a missing image every later wndMgr handle lookup returned None (NewGoldWindow board.GetWidth() → None). Windows PyTuple_GetInteger ignores pending errors. The helper now preserves the earlier error and checks only its own conversion.
  • Environment. tools/make_test_rundir.py now builds the client root from the *_create.xml ArchivedPath manifests (python-root first; then PC, ETC, root and the rest; first wins), plus map, mark and svside. ava2.python, window_tree, render_3d and mark_manager all run from AVA2_TEST_RUNDIR and skip (77) without it. The speedtree_forest wind test now samples the highest canopy vertex instead of the bottom one.
  • Results:
    • CTest is 34/34.
    • python_test passes, and the macOS/Android builds pass.
    • The 229 constants and 925 references are unchanged, and interfaces are 618/46/0.

2026-10-07 pass23 — event module and simple lookups

  • event. This is a line-by-line port of CPythonEventManager plus script::Group (src/python_event_manager.cpp, src/eter_lib/parser.cpp).
    • All original methods are registered, including AddEvent; GetTotalLineCount is not, as in the original.
    • The button constants are fixed to NEXT/DONE/CANCEL = 0/1/2. The old placeholder had CANCEL=0 and NEXT=2.
    • The script packet now runs the real event set and opens the quest window through OpenQuestWindow.
    • SelectAnswer and QuestButtonClick send CG 29 and CG 66.
    • The quirks are kept: the elapsed time is subtracted twice, and the DWORD confirm-wait time goes negative after it expires.
  • Lookups:
    • item.GetApplyPoint uses aApplyInfo, generated from the original.
    • player.SlotTypeToInvenType.
    • app.GetRandom uses the EterBase Park–Miller generator.
    • nonplayer.GetResist.
    • player GetGuildID/GetGuildName/GetPKMode/IsGameMaster/GetRace/GetJob/GetEXP/GetConquerorEXP/Get/SetPlayTime.
  • Still different:
    • GetTargetVID: there is no target system yet.
    • Event camera and minimap atlas signals have no effect.
    • There are no real font metrics.
    • Apply types 176–179 return 0 (Windows reads out of bounds).
    • CheckStackReference is not ported.
  • Results:
    • CTest is 35/35, including the new ava2.event.
    • python_test passes, and the macOS/Android builds pass.
    • The 229 constants and 925 references are unchanged.
    • Interfaces are 590/46/0 (was 618), and the inventory has 629 placeholder bindings (was 657).

2026-10-07 pass24 — chat module

  • chat. This is a line-by-line port of CPythonChat and CWhisper (src/python_chat.cpp), using the CHAT_SETTINGS and ENABLE_MULTILANGUAGE_SYSTEM build.
    • All 33 original methods replace the placeholders.
    • It has per-set line stores keyed by BYTE, and per-set mode and country filters.
    • It ports the 300-line cap, the #ebvs drop, item-link renaming, the SHOUT lang/empire prefixes with flag images, and the VIEW/EDIT/LOG board updates.
    • It also ports delayed chat, whispers, the ignore set and GetLinkFromHyperlink.
  • Server path. RecvChatPacket now calls CPythonChat::AppendChat, as on Windows. The temporary chat callback is removed.
  • Quirks kept:
    • IsIgnoreCharacter returns None.
    • CreateChatSet(256) aliases set 0's store.
    • Country-muted shouts still count toward the window size.
    • Update on an unknown set skips the delayed flush.
  • Guards where Windows has undefined behaviour:
    • A zero step.
    • Out-of-range mode indexes.
    • A hyperlink with no ':' or an odd attribute count.
    • A whisper position above 1.0.
    • The uninitialised whisper lineCount.
  • Still different:
    • There are no real fonts: no missing-font drop, no GM italic font, and no whisper clip rectangle.
    • Flag images are looked up without IsFileExist.
    • CheckStackReference, ChangeIcon and AppendMonsterList are not ported.
  • Results:
    • CTest is 36/36, including the new ava2.chat.
    • python_test passes, and the macOS/Android builds pass.
    • The 229 constants and 925 references are unchanged.
    • Interfaces are 557/46/0 (was 590), and the inventory has 596 placeholder bindings (was 629).

2026-10-07 pass25 — systemSetting, skill, miniMap, chr/chrmgr

  • systemSetting. CPythonSystem + all 58 module methods: metin2.cfg/interface.cfg formats, display modes, SetConfig/GetConfig.
  • skill. The 21 PythonSkill.cpp methods: RegisterSkill files, skilldesc icon paths, requirement data, icon images/instances, GetGradeData, TEST.
  • miniMap. CPythonMiniMap (src/python_minimap.cpp) + the 27 module functions; LoadAtlas, point marks, Update, observers, targets, guild areas, way/signal points, GetInfo/GetAtlasInfo. RegisterColor (not in Windows) removed.
  • chr / chrmgr. src/python_chr.cpp ports all 80 chr and 37 chrmgr methods onto NetworkActorManager/RaceManager; the stand-in instance table is gone. Original error styles, rotation conversions, CreateInstance's "y" bug, no-instance answers, GetVIDInfo format and SetPathName guard are kept. chr.RequestPetName is absent (NEW_PET_SYSTEM off).
  • Still different:
    • systemSetting: no shadow/gamma/cursor/mob-info refresh; SDL display modes; Android config path.
    • skill: (None, 0) requirement quirk; emulated GetGradeData varargs; lazy icons; grpImage placeholder.
    • miniMap: no rendering; no guild-area overlay, symbol download or target effect.
    • chr: no pick pass, render modes, bounding spheres, weapon trace, horse actor, motion blending, fade-out or dead list; Hide/Show use a flag; SetDirection null guard; testSetRideMan VID 1.
  • Results:
    • CTest is 40/40 (new ava2.system_setting, ava2.skill, ava2.minimap, ava2.chr).
    • python_test passes, and the macOS/Android builds pass.
    • The 229 constants and 925 references are unchanged.
    • Interfaces are 370/46/0 (was 557), and the inventory has 402 placeholder bindings (was 596).

2026-10-07 pass26 — background module

  • background. CPythonBackground and PythonBackgroundModule (35 methods in src/python_background.cpp).
    • Environment, skybox, fog, water, and shadow properties integrated.
    • Map info, base coordinates, local to global conversions, atlas loading.
    • Results: CTest 40/40.

2026-10-07 pass27 — grp, grpImage, grpText, grpThing, item, net

  • grpImage (15), grpText (21), grpThing (8), grp (44) in src/python_grp.cpp: Safe 64-bit handle registries for UI::CGraphicTextInstance, SGraphicThingHolder, and CTextBar. Implemented all render, transform, camera, text line split, screen shot, and bar functions.
  • item (14) in src/python_gameplay_modules.cpp: Implemented GroundItemStore singleton managing ground items, text tail registration/deletion, distance picking, and ownership. Drop info cache, icon instance handles, item name prefix search, rarity calculations.
  • net (44) in src/python_net.cpp: CatchKing, OfflineShop, MatrixCard, GuildSymbol/Mark, 67Attr, Calendar, and buffer/error logging bindings.

2026-10-07 pass28 — player and app modules

  • player (67 methods) in src/python_gameplay_modules.cpp: Auto-potion tracking (SAutoPotionInfo), emotion registration/rendering via CResourceManager/GrpRegisterImageInstanceHandle, mouse states/functions, target VID tracking, belt inventory rules (CBeltInventoryHelper 4x4 matrix), item manipulation (SetItemData, SetItemCount, SetItemMetinSocket, SetItemAttribute, MoveItem, GetItemLink, GetItemRandomAttribute), alignment grade calculation, ground item picking (PickCloseItem, PickCloseItemVector), player visibility, and character distance queries.
  • app (67 methods) in src/python_app.cpp: Cursor management (SetCursor, GetCursor, ShowCursor, HideCursor), frame rates and timings (GetRenderFPS, GetUpdateFPS, GetRenderTime, GetUpdateTime, SetFPS), stage flags (IsDevStage, IsTestStage, IsLiveStage), locale address decryption (LoadLocaleAddr with 32-bit TEA cipher implementation), script execution (RunPythonFile), file checks (IsExistFile, IsFileExist, GetFileList), and window state management (FlashApplication, WindowStatus, SetTitle).
  • Results:
    • Audit check: 46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods.
    • CTest: 40/40 passed (100%).

2026-10-07 pass29 — full placeholder elimination across static and active inventories, portable world assets

  • 0 Placeholder Bindings in Static Inventory (docs/WINDOWS-PARITY-INVENTORY.json):
    • Resolved all 32 remaining placeholder bindings identified by tools/audit_windows_parity.py.
    • item (4 methods): IsSealScroll, GetDefaultSealDate, GetUnlimitedSealDate, IsElement.
    • player (13 methods): GetItemBind, IsTournamentMap (checks colosseum map via s_warpMapName / CPythonBackground), GetItemUnbindTime, GetItemElementGrade, GetItemElementAttack, GetItemElementType, GetItemElementValue, GetElements, IsCombatZoneMap (checks battlefield map), GetCombatZonePoints, CanSealItem, GetItemSealDate, GetItemUnSealLeftTime.
    • shop (2 methods): GetOfflineShopItemTransmutation, GetItemElements.
    • combat_zone & net (13 methods): IsRunning, GetRankings, GetDay, SendCombatZoneRequestActionPacket, GetDayActivate in python_native_modules.cpp and python_net.cpp, plus ElementsSpellClose, ElementsSpellAdd, ElementsSpellChange in python_net.cpp.
    • Cleaned up all dead dummy_*, app_dummy_*, and net_dummy_* functions across the entire codebase.
  • Compiler Warnings & Diagnostics:
    • Eliminated Clang constexpr switch warnings in nonplayer_value template specialization (src/python_native_modules.cpp).
  • Portable Asset Loading:
    • Replaced developer absolute paths in src/main.cpp for height.raw, tile.raw, attr.atr, metin2_map1.txt, property, water.wtr, and minimap.dds with portable relative paths and safe fallbacks.
  • Results:
    • 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%) including ava2.render_3d.
    • Android arm64 libmain.so: builds cleanly with 0 warnings.
    • macOS arm64 ava2_client: builds cleanly and runs 60fps game phase.

2026-10-07 pass30 — network protocol & observer stream alignment

  • Ping/Pong Protocol:
    • Replaced literal 44/254 handling in src/eter_net/PythonNetworkStream.cpp with HEADER_GC_PING and HEADER_CG_PONG.
    • Added TPacketGCPing and TPacketCGPong wire structures in src/eter_net/Packet.h.
    • Implemented PythonNetworkStream::RecvPingPacket() in src/eter_net/PythonNetworkStreamPhaseGameRecv.cpp.
  • Observer Packet Handlers:
    • Added HEADER_GC_OBSERVER_ADD (96), HEADER_GC_OBSERVER_REMOVE (97), and HEADER_GC_OBSERVER_MOVE (98) to EPacketGC in src/eter_net/Packet.h.
    • Defined TPacketGCObserverAdd, TPacketGCObserverMove, and TPacketGCObserverRemove packed wire structures.
    • Implemented RecvObserverAddPacket(), RecvObserverRemovePacket(), and RecvObserverMovePacket() in PythonNetworkStreamPhaseGameRecv.cpp, routing coordinates and VIDs directly to CPythonMiniMap::Instance().{AddObserver, MoveObserver, RemoveObserver}.
    • Updated src/eter_net/Ava2GcPacketTable.inc entries for 96, 97, and 98 to valid mapped packets.
  • Wire Protocol Constants Clean-up:
    • Refactored src/protocol.cpp to use named HEADER_CG_* constants instead of magic numbers.
  • Results:
    • Checked packet constants increased to 233, 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 builds cleanly.

2026-10-07 pass31 — skill cooldown, server emotions, target packets & render target parity

  • Skill Cooldown Protocol (HEADER_GC_SKILL_COOLTIME_END = 73):
    • Added HEADER_GC_SKILL_COOLTIME_END = 73 and wire structure TPacketGCSkillCoolTimeEnd in src/eter_net/Packet.h.
    • Mapped entry 73 in src/eter_net/Ava2GcPacketTable.inc.
    • Implemented PythonNetworkStream::RecvSkillCoolTimeEnd() in src/eter_net/PythonNetworkStream.cpp calling EndSkillCoolTime(packet.bSkill).
    • Added EndSkillCoolTime(uint32_t skillIndex) in src/python_gameplay_modules.h / src/python_gameplay_modules.cpp to reset active cooldown for that skill index.
  • ServerCommand Emotion Dispatching:
    • Replaced emotion TraceError placeholder in src/eter_net/PythonNetworkStreamCommand.cpp with 1:1 actor motion playback matching upstream Windows client.
    • Implemented dual emotions (french_kiss, kiss, slap) and single emotions (clap, cheer1, cheer2, dance1–dance6, dig_motion, congratulation, forgive, angry, attractive, sad, shy, cheerup, banter, joy) via ActorInstance::ActEmotion and ActDualEmotion.
    • Populated complete emotion constants in RaceData::EMotion and struct CRaceMotionData in src/eter_render/RaceData.h.
  • Target & Fly Targeting Packets:
    • Dispatched RecvFlyTargetingPacket() and RecvAddFlyTargetingPacket() matching upstream header handling.
    • Added TPacketGCTargetCreate wire struct and implemented PythonNetworkStream::RecvTargetCreatePacket().
  • CRenderTarget & renderTarget Module Parity:
    • Added ResetModel(), SetModelStatus(), GetModelStatus(), IsShow(), IsReady(), and GetScale() in src/eter_render/CRenderTarget.h / CRenderTarget.cpp.
    • Disassociated model visibility m_bShowModel from overall target container visibility m_visible so model render toggle works 1:1 with upstream Windows client.
    • Updated renderTarget_ResetModel to invoke ResetModel() and renderTarget_SetModelRender to invoke SetModelStatus(bStatus).
  • Wire Constants Coverage:
    • Added HEADER_GC_PLAYER_CREATE_SUCCESS (8), HEADER_GC_PLAYER_CREATE_FAILURE (9), HEADER_GC_PLAYER_DELETE_SUCCESS (10), HEADER_GC_PLAYER_DELETE_WRONG_SOCIAL_ID (11), HEADER_GC_LOGIN_SUCCESS4 (32), and HEADER_GC_CHANGE_NAME (107) with TPacketGCChangeName.
  • Results:
    • Checked packet constants increased to 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.
    • CTest suite: 41/41 tests passed (100%).
    • Android arm64 libmain.so and macOS arm64 ava2_client build cleanly.

2026-10-08 pass32 — EterBase Timer & Singleton, image/slot cooldown geometry rendering (dracaryS_DUNGEON_LIB)

  • EterBase CTimer and ELTimer Parity:
    • Added src/eter_base/Singleton.h and src/eter_base/Timer.h / src/eter_base/Timer.cpp replicating upstream Windows EterBase/Timer.h and Timer.cpp.
    • Implemented CTimer : public CSingleton<CTimer> with safe singleton fallback, Advance(), Adjust(), SetBaseTime(), GetCurrentSecond(), GetCurrentMillisecond(), GetElapsedSecond(), GetElapsedMilliecond(), and UseCustomTime().
    • Implemented ELTimer_Init(), ELTimer_GetMSec(), ELTimer_SetServerMSec(), ELTimer_GetServerMSec(), ELTimer_SetFrameMSec(), ELTimer_GetFrameMSec(), and ELTimer_GetServerFrameMSec().
    • Updated src/python_app.cpp SetServerMSec and ResetPythonAppState to synchronize with ELTimer.
  • Image Cooldown Geometry Rendering (dracaryS_DUNGEON_LIB):
    • Declared and implemented RenderCoolTime(float fCoolTime) and OnRenderCoolTime(float fCoolTime) on CGraphicImageInstance in src/eter_image/GrpImageInstance.h and .cpp.
    • Declared and implemented RenderCoolTime(float fCoolTime) and OnRenderCoolTime(float fCoolTime) on CGraphicExpandedImageInstance in src/eter_image/GrpExpandedImageInstance.h and GrpImageInstance.cpp.
    • Formed 8-triangle radial fan sweep geometry rendered via hardware-accelerated SDL_RenderGeometry matching upstream Direct3D behavior.
  • Python Window Cooldown Parity:
    • Updated CImageBox::OnRender() and CExpandedImageBox::OnRender() in src/eter_ui/PythonWindow.cpp to call RenderCoolTime((CTimer::Instance().GetCurrentSecond() - m_fCoolTimeStart) / m_fCoolTime) when m_fCoolTime != 0.0f matching upstream lines 1687 and 1895.
    • Updated CSlotWindow::OnRender() in src/eter_ui/PythonWindow.cpp to render radial clock-sweep cooldown geometry via SDL_RenderGeometry matching upstream CPythonGraphic::RenderCoolTimeBox.
  • Results:
    • 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.
    • CTest suite: 41/41 tests passed (100%).
    • Android arm64 libmain.so and macOS arm64 ava2_client build cleanly.

2026-10-08 pass33 — Conqueror level text tail & ground item name resolution parity

  • Conqueror Level TextTail (ENABLE_CONQUEROR_LEVEL):
    • Added AttachConquerorLevel(uint32_t vid, const std::string& levelText) to TextTailManager.h and TextTailManager.cpp applying 0xFF8CC8FF text color matching upstream CPythonTextTail::AttachConquerorLevel.
    • Updated NetworkActorManager::AppendActor and UpdateActor in src/eter_net/NetworkActorManager.cpp to attach Conqueror level overhead tag when m_dwConquerorLevel > 0, replicating CInstanceBase::UpdateTextTailConquerorLevel.
  • Ground Item Name Resolution:
    • Updated PythonNetworkStream::RecvItemGroundAddPacket in src/eter_net/PythonNetworkStream.cpp to look up item names through GetItemNameAndType(vnum) rather than printing generic "Item <vnum>", matching upstream CPythonItem::CreateItem and RegisterItemTextTail.
  • Results:
    • 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.

2026-10-08 pass35 — Batch items pickup, dragon soul refine packet, target sync, and attackability parity

  • Comprehensive Packet Constants Expansion (src/eter_net/Packet.h):
    • Added 58 missing packet constants to EPacketCG and EPacketGC including HEADER_CG_ITEMS_PICKUP = 235, HEADER_CG_DRAGON_SOUL_REFINE = 205, HEADER_CG_PVP = 41, HEADER_CG_SHOP = 50, HEADER_CG_MYSHOP = 55, HEADER_CG_OFFLINE_SHOP = 57, HEADER_CG_EMPIRE = 90, HEADER_GC_EMPIRE = 90, HEADER_CG_DUNGEON = 110, HEADER_CG_SASH = 211, HEADER_CG_FISHING = 222, etc.
    • Checked packet constants increased from 243 to 301/301 (100% parity) with 0 mismatches and 0 unmatched.
    • Added wire structures TPacketCGItemsPickUp and TPacketCGDragonSoulRefine.
  • Batch Ground Item Pickup Parity (PythonNetworkStream.h / .cpp, python_gameplay_modules.cpp):
    • Implemented SendItemsPickUpPacket(const std::vector<uint32_t>& itemVector) sending TPacketCGItemsPickUp followed by vector item VIDs.
    • Updated player_PickCloseItemVector to send a single batch SendItemsPickUpPacket rather than looping individual single item packets, matching upstream CPythonPlayer::SendPickUPItemPacket.
  • Dragon Soul Refinement Parity (PythonNetworkStream.h / .cpp, python_gameplay_modules.cpp):
    • Implemented SendDragonSoulRefinePacket(uint8_t bRefineType, const TItemPos* pos) matching upstream CPythonNetworkStream::SendDragonSoulRefinePacket.
    • Replicated player_SendDragonSoulRefine 1:1, parsing dictionary (window_type, cell) into TItemPos RefineItemPoses[DS_REFINE_WINDOW_MAX_NUM] and dispatching the network packet.
  • Targeting & Attackability Parity (python_gameplay_modules.cpp):
    • Updated player_SetTarget and player_ClearTarget (and player_Clear) to send SendTargetPacket(vid) / SendTargetPacket(0).
    • Replicated upstream CInstanceBase::IsAttackableInstance in player_CanAttackInstance: friendly NPCs (bType == 1) return false, monsters (bType == 0) return true, and PCs check killer state, empire, PK mode (Free, Revenge alignment conflict, Guild), and self VID.
  • Results:
    • Checked packet constants: 301/301 (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.
  • Packet Subheader Enums Expansion (src/eter_net/Packet.h, tools/audit_ava2_packet_constants.py):
    • Added explicit numeric definitions for all subheader enum groups: EMessengerSubheaderGC (0..4), EFishingSubheaderGC (0..5), EDungeonSubheaderGC (0..1), EDSSubHeader (0..11), ESashSubheader (GC 0..4, CG 0..3), EKingdomsWarSubheaderGC (0..1), GUILD_SUBHEADER_GC_ (0..20), EShopSubheaderCG (0..16), and EShopSubheaderGC (0..19).
    • Expanded packet constant audit regex to cover all subheader families.
    • Audited packet constants increased from 301 to 395/395 (100% parity) with 0 mismatches and 0 unmatched.
  • Sash System Full Parity (src/python_sash.h, src/python_native_modules.cpp, src/eter_net/PythonNetworkStreamPhaseGameRecv.cpp):
    • Implemented CPythonSash singleton replicating UserInterface/PythonSash.h with material/result state tracking (dwPrice, m_vSashMaterials, m_vSashResult).
    • Implemented PythonNetworkStream sash client-to-server methods: SendSashClosePacket(), SendSashAddPacket(TItemPos, uint8_t), SendSashRemovePacket(uint8_t), SendSashRefinePacket().
    • Wired sash Python module methods (SendCloseRequest, Add, Remove, GetPrice, GetAttachedItem, GetResultItem, SendRefineRequest) directly to network stream and singleton.
    • Updated RecvSashPacket() to update CPythonSash::Instance() state on SASH_SUBHEADER_GC_ADDED, REMOVED, OPEN, CLOSE, REFINED and corrected action code 5 on SASH_SUBHEADER_CG_REFINED.
  • Fishing System & Character State Parity (src/python_gameplay_modules.cpp, src/eter_net/PythonNetworkStream.h, .cpp):
    • Added and implemented SendFishingPacket(int iRotation) sending HEADER_CG_FISHING.
    • Implemented NEW_Fishing() and NEW_CancelFishing() with 10-degree radial raycasting across 180 degrees using CPythonBackground::Instance().IsAttrOn(x, y, 2 /* ATTRIBUTE_WATER */) at distance 600.0f, exactly replicating upstream CInstanceBase::GetFishingRot.
    • Added fishing rod equipment check (ITEM_TYPE_ROD = 13) in IsMainActorFishingMode().
    • Connected fishing skill slot click (c_iSkillIndex_Fishing = 123 / 121) in ClickSkillSlot.
    • Wired player.SetAttackKeyState, player.SetSingleDIKKeyState, and player.EndKeyWalkingImmediately to cancel fishing and track attack key state (s_isAtkKey).
    • Implemented player.SetAutoCameraRotationSpeed saving s_fCmrRotSpd.
    • Implemented player.Update to notify guild area transitions (BINARY_Guild_EnterGuildArea/ExitGuildArea) via CPythonMiniMap::Instance().GetGuildAreaID(x, y).
    • Fixed player.GetItemLink to format all 8 sockets, 15 attributes, and 7 glove random attributes.
    • Fixed player.GetItemRandomAttribute bounds check to GLOVE_ATTR_MAX_NUM (7).
  • Results:
    • Checked packet constants: 395/395 (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.

2026-10-08 pass37 — CPythonItem ground item manager, weapon battle status math, arrow validation, and regen safe range parity

  • CPythonItem Singleton (src/python_item.h):
    • Implemented CPythonItem singleton matching upstream UserInterface/PythonItem.h with TGroundItemInstance tracking (vnum, coordinates, count, 8 sockets, 15 attributes, 7 glove attributes).
    • Templated CreateItem(..., const TSocket* alSockets = nullptr, ...) to support both int32_t and long socket arrays seamlessly across 32-bit and 64-bit architectures.
    • Added DeleteAllItems(), DeleteItem(vid), GetGroundItemPosition(vid, &x, &y, &z), GetCloseItemVector(name, actorPos, &vector), and distance checking (GetDistance).
  • PythonNetworkStream Ground Item & Main Actor Race Integration (src/eter_net/PythonNetworkStream.cpp):
    • Connected RecvItemGroundAddPacket to instantiate items in CPythonItem::Instance().CreateItem(...) with wire sockets, attributes, and count.
    • Linked SetPlayerRace(m_wMainActorRace) into MainCharacterLoaded on character spawn.
  • Weapon Power & Battle Status Math Parity (src/python_gameplay_modules.h, .cpp):
    • Implemented exact formula parity for GetPlayerRaceStat(job, point): Warrior (STR, DEX), Assassin (DEX, STR), Sura (STR, DEX), Shaman (INT, DEX), and Wolfman (STR, DEX).
    • Implemented GetHitRate(dx, str) and GetEvadeRate(dex, con) matching CInstanceBase::GetHitRate and GetEvadeRate.
    • Implemented UpdateBattleStatus() recalculating POINT_HIT_RATE, POINT_EVADE_RATE, POINT_MIN_WEP, POINT_MAX_WEP, POINT_MIN_MAGIC_WEP, POINT_MAX_MAGIC_WEP, POINT_MIN_ATK, and POINT_MAX_ATK.
    • Implemented UpdateEquippedWeaponPower() taking into account weapon slot (184), sash absorption slot (202), and rarity socket bonuses.
    • Corrected SetPlayerItemData to trigger UpdateEquippedWeaponPower() upon modifying slots 184 or 202.
    • Preserved raw status point setters (SetPlayerStatusPoint and player_SetStatus) without overwriting test mocks.
  • Arrow & Ammo Verification (src/python_gameplay_modules.h, .cpp):
    • Implemented HasEnoughArrow() checking slot 189 (c_Equipment_Arrow) for arrows or quivers, firing "OnCannotShotError" when unequipped or depleted.
  • Regen & Safe Range Mechanics (src/python_gameplay_modules.h, .cpp, NetworkActorManager.h):
    • Added GetMobWithVnum(mobVnum, out) in NetworkActorManager matching CPythonCharacterManager::GetMobWithVnum.
    • Implemented LoadNewRegen() parsing locale/newregen.txt tab-delimited records filtered by current map name under ENABLE_ULTIMATE_REGEN.
    • Implemented CheckBossSafeRange() with DISTANCE_APPROX_SERVER approximation and actor distance checks.
  • Item Classification Feature Flag Alignment (src/python_gameplay_modules.cpp):
    • Aligned item_Classify switch with upstream Locale_inc.h where ENABLE_SOULBIND_SYSTEM and ELEMENT_SPELL_WORLDARD are commented out, properly falling back to "USE_UNKNOWN_TYPE".
  • Results:
    • Checked packet constants: 395/395 (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.

2026-10-08 pass38 — FlyingManager indexed fly data, CPythonManagerBank wire integration, renderTarget 1:1 parity, and dynamic module resolver

  • FlyingManager Indexed Fly Data (src/eter_effect/FlyingManager.{h,cpp}, src/python_native_modules.cpp):
    • Aligned effect.RegisterIndexedFlyData to parse all 3 parameters (iIndex, iType, szFlyDataName) matching upstream UserInterface/PythonEffectModule.cpp.
    • Implemented RegisterIndexedFlyData(index, type, filename) in FlyingManager storing indexed entries in m_indexedFlyData.
    • Extended CreateFlyingInstance to resolve fly models by index type fallback when packet data specifies fly indices.
  • CPythonManagerBank Singleton & Wire Integration (src/python_manager_bank.h, src/eter_net/Packet.h, src/eter_net/PythonNetworkStreamPhaseGameRecv.cpp, src/python_native_modules.cpp):
    • Implemented CPythonManagerBank singleton matching upstream UserInterface/PythonManagerBank.{h,cpp}.
    • Aligned TAccountBank field names in src/eter_net/Packet.h to upstream (user_action, user_money, user_datetime, user_ip, user_recvmoney) and added using TPacketCGBank = TPacketGCBank;.
    • Wired CPythonManagerBank::Instance().Append(p) in RecvAccountBankPacket() when receiving TPacketGCBank packets from wire.
    • Updated bankLoadLogs (managerBankLogs.Append) to query CPythonManagerBank::Instance().BINARY_LoadLogs_Account(id) and return 5-tuple logs to Python UI.
  • renderTarget Python Module Parity (src/python_native_modules.cpp, src/python_app.{h,cpp}, src/python_gameplay_modules.{h,cpp}):
    • renderTarget.Zoom: Added mouse wheel direction handling (app.CAMERA_TO_NEGATIVE / app.CAMERA_TO_POSITIVE), calculating zoom ratio as 1.0f + GetCameraZoomSpeed() * float(iDirection) matching upstream CPythonRenderTargetModule.cpp.
    • Exposed GetCameraZoomSpeed() (0.05f) from python_app.{h,cpp}.
    • renderTarget.SetHair: Added support for 3rd argument isValue. When !isValue, looks up pItemData->GetValue(3) via newly added GetItemValue(vnum, 3, &val) in python_gameplay_modules.{h,cpp}.
    • renderTarget.GetFreeIndex: Aligned index search range [iMin, iMax) with fallback iMin + 20.
    • renderTarget.IsShow: Aligned boolean query to CRenderTarget::IsShow().
    • renderTarget.Destroy: Added support for zero-argument invocation clearing all render targets via CRenderTargetManager::Instance().Destroy().
    • Aligned argument parsing across SetScale, RotateEyeAroundTarget, SetModelV3Eye, SetModelV3Target, and SetMotionIndex.
  • impMgr Dynamic Module Resolver (src/python_native_modules.{h,cpp}, src/python_runtime.cpp):
    • Implemented impMgr module with getModule(name) and registered initModuleNameManager() in inittab matching upstream UserInterface/PythonDynamicModuleNames.cpp.
  • Class-by-Class Verification:
    • Verified PythonApplicationWebPage.cpp, PythonPlayerEventHandler.cpp, ServerStateChecker, AffectFlagContainer, GuildMarkDownloader/GuildMarkUploader, PythonNetworkDatagram, PythonCombatZone, MovieMan, InsultChecker, PythonSkillPet, PythonSash, PythonMiniMap, and ServerCommand handlers against upstream.
  • Results:
    • Checked packet constants: 395/395 (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.

2026-10-08 pass39 — Exhaustive class-by-class & method-by-method display and rendering parity (UI, grp, minimap, atlas)

  • Upstream Class & Rendering Audit:
    • Audited all 735 upstream C++ files and 202 Render/Draw/OnRender methods across 74 classes between upstream Windows AVA2 client (upstream/ava2-client) and ava2-client.
    • Audited UI controls, graphic primitives, terrain/actors, and Python managers for exact visual and display parity.
  • UI Controls Display & Visual Logic (src/eter_ui/PythonWindow.{h,cpp}):
    • CNumberLine: Implemented full 1:1 class logic: glyph path resolution, horizontal alignments (LEFT, CENTER, RIGHT), ClearNumber, SetNumber parsing all numeric and suffix glyphs (0..9, :, ?, /, %, +, m, g, p), OnRender, and OnChangePosition.
    • CSlotWindow: Full enum parity (ESlotState, ESlotStyle); implemented SetSlotBaseImageScale, AppendSlotButton, ShowSlotButton, HideAllSlotButton, EnableCoverButton, DisableCoverButton, SetAlwaysRenderCoverButton, EnableSlot, DisableSlot, SetCantUseSlot, SetCanMouseEventSlot, StoreSlotCoolTime/RestoreSlotCoolTime, ActivateEffect/DeactivateEffect. Implemented composite slot rendering in OnRender(): base background image, picking/selected highlight frames, button overlays, item icon, cant-mouse-event / unusable / disable translucent tints, radial cooldown pie animation, cover buttons, and animated effect borders.
    • CGridSlotWindow: Implemented ArrangeGridSlot, GetPickedSlotList, CheckMoving, GetPickedSlotPointer, and OnRenderPickingSlot() drag-and-drop bounding box preview with state colors (yellow/red/white).
    • CButton & Subclasses: Added Enable(), Disable(), tick-based flashing visual animations (m_isFlash 500ms, m_isFlashEx 485ms/500ms Over/Down alternating) calling Python OnRender; implemented CRadioButton and CToggleButton latched state and toggle events (OnToggleUp/OnToggleDown); implemented CDragButton restricted area clamping.
    • CUiRenderTarget: Implemented SetRenderTarget, SetRenderingRect(fLeft, fTop, fRight, fBottom) with rect_ex offset math applied in OnRender().
    • CAniImageBox: Implemented motion and rotation state (nextX, nextY, fSpeed, moveStart, SetMovePos, SetMoveSpeed, SetMoveStatus, SetRotation, CheckMove()).
    • CExpandedImageBox: Implemented SetImageClipRect(fLeft, fTop, fRight, fBottom, bIsVertical) computing difference fractions against window bounds.
  • Graphic Primitive & Button Rendering (src/python_grp.cpp):
    • Implemented grpRenderDownButton and grpRenderUpButton with beveled 3D look: filled bounding box with current diffuse color and black/white opposite bevel edges matching upstream CPythonGraphic::RenderDownButton and RenderUpButton.
    • Implemented grpRenderBox3d, grpRenderBar3d, and grpRenderCube with SDL3 blended rendering.
  • Minimap & Atlas Display Parity (src/python_minimap.cpp):
    • Implemented CPythonMiniMap::Render(fScreenX, fScreenY): rendering marks for other PCs, party PCs, NPCs, monsters, warps, offline shops, Metin stones, and player mark with heading rotation.
    • Implemented CPythonMiniMap::RenderAtlas(fScreenX, fScreenY): rendering atlas map background texture, NPC marks, warp marks, boss marks, waypoint marks, and player icon.
  • Results:
    • Checked packet constants: 395/395 (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.