HLE: implement remaining XNetworking UDP port-change and UTF-16 security slots #851

Open
opened 2026-11-26 04:14:04 +00:00 by github-bot · 1 comment
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 12:27 UTC · original

Summary

Implements the 5 remaining missing::<N> vtable slots (0x30, 0x38, 0x58, 0x60, 0x68) in crates/victory-hle/src/modules/xnetworking.rs for the offline Xbox XNetworking service, plus 4 deterministic unit tests.

Because external PR creation is currently restricted (collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:

  • Branch: geiyiliyabumo/VIctory@feat/xnetworking-udp-and-utf16-slots
  • Commit: geiyiliyabumo/VIctory@36ae257 (based on main ffe310e)

Changes (crates/victory-hle/src/modules/xnetworking.rs)

  • Preferred local UDP port change callbacks (slots 0x30 / 0x38):
    • Wired 0x30 (XNetworkingRegisterPreferredLocalUdpMultiplayerPortChanged) to register (put(out, token())) and 0x38 (XNetworkingUnregisterPreferredLocalUdpMultiplayerPortChanged) to unregister (true), matching 0x80/0x88 since neither hint nor port changes offline.
  • UTF-16 security information async trio (slots 0x58 / 0x60 / 0x68):
    • Added dedicated static SECURITY_UTF16: u8 = 0; identity tag and wide(*const u16) helper (matching net.rs / files.rs / dstorage.rs).
    • Wired 0x58 (security_info_utf16_async), 0x60 (security_info_utf16_size), and 0x68 (security_info_utf16_result), mirroring the ANSI trio (0x40/0x48/0x50) and completing immediately with UNREACHABLE.
  • Unit tests (4 new, 5 total in xnetworking):
    • a_port_change_callback_registers_but_never_runs
    • utf16_security_information_is_unreachable_offline
    • a_null_utf16_url_completes_like_an_empty_one
    • utf16_and_ansi_results_are_not_interchangeable (verifies SECURITY_UTF16 vs SECURITY tag isolation via xasync::finished_with)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/xnetworking.rs: PASS
  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy --workspace --all-targets --locked -- -D warnings (default + --features diagnostics): PASS (0 warnings)
  • cargo test -p victory-hle --locked -- xnetworking: 5/5 PASS
  • cargo test --workspace --locked: PASS (all workspace crates green)

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 12:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/851) ### Summary Implements the 5 remaining `missing::<N>` vtable slots (`0x30`, `0x38`, `0x58`, `0x60`, `0x68`) in `crates/victory-hle/src/modules/xnetworking.rs` for the offline Xbox `XNetworking` service, plus 4 deterministic unit tests. Because external PR creation is currently restricted (`collaborators_only`), the CI-green branch is ready on my fork for cherry-pick / review: - **Branch**: `geiyiliyabumo/VIctory@feat/xnetworking-udp-and-utf16-slots` - **Commit**: `geiyiliyabumo/VIctory@36ae257` (based on `main` `ffe310e`) ### Changes (`crates/victory-hle/src/modules/xnetworking.rs`) - **Preferred local UDP port change callbacks (slots `0x30` / `0x38`)**: - Wired `0x30` (`XNetworkingRegisterPreferredLocalUdpMultiplayerPortChanged`) to `register` (`put(out, token())`) and `0x38` (`XNetworkingUnregisterPreferredLocalUdpMultiplayerPortChanged`) to `unregister` (`true`), matching `0x80`/`0x88` since neither hint nor port changes offline. - **UTF-16 security information async trio (slots `0x58` / `0x60` / `0x68`)**: - Added dedicated `static SECURITY_UTF16: u8 = 0;` identity tag and `wide(*const u16)` helper (matching `net.rs` / `files.rs` / `dstorage.rs`). - Wired `0x58` (`security_info_utf16_async`), `0x60` (`security_info_utf16_size`), and `0x68` (`security_info_utf16_result`), mirroring the ANSI trio (`0x40`/`0x48`/`0x50`) and completing immediately with `UNREACHABLE`. - **Unit tests (4 new, 5 total in `xnetworking`)**: - `a_port_change_callback_registers_but_never_runs` - `utf16_security_information_is_unreachable_offline` - `a_null_utf16_url_completes_like_an_empty_one` - `utf16_and_ansi_results_are_not_interchangeable` (verifies `SECURITY_UTF16` vs `SECURITY` tag isolation via `xasync::finished_with`) ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/xnetworking.rs`: **PASS** - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy --workspace --all-targets --locked -- -D warnings` (default + `--features diagnostics`): **PASS** (0 warnings) - `cargo test -p victory-hle --locked -- xnetworking`: **5/5 PASS** - `cargo test --workspace --locked`: **PASS** (all workspace crates green) *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:04 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:55 UTC · original

Automated triage for the maintainers.

This is already on main: PR #1248 ("XNetworking: wire UDP port change callbacks and UTF-16 security queries", merged 2026-11-25) filled these slots. In crates/victory-hle/src/modules/xnetworking.rs the vtable now has register at 0x30, security_info_utf16_async at 0x58 and the UTF-16 result slots after it, with tests of their own.

Proposed for closing as fixed in main. It will be closed in 48 hours unless you reply (for example, if something in your branch is still missing from main) or a maintainer removes the triage: proposed close label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:55 UTC · [original](https://github.com/Marvisak/VIctory/issues/851#issuecomment-7155299749) <!-- victory-issue-triage v1 verdict=proposed-close seen=2026-11-24T12:27:46Z at=2026-11-25T06:55:26Z --> Automated triage for the maintainers. This is already on `main`: PR #1248 ("XNetworking: wire UDP port change callbacks and UTF-16 security queries", merged 2026-11-25) filled these slots. In `crates/victory-hle/src/modules/xnetworking.rs` the vtable now has `register` at `0x30`, `security_info_utf16_async` at `0x58` and the UTF-16 result slots after it, with tests of their own. Proposed for closing as fixed in `main`. It will be closed in 48 hours unless you reply (for example, if something in your branch is still missing from `main`) or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#851
No description provided.