Net: allow local machine hostname in resolvable and loopback_name #1380

Closed
github-bot wants to merge 1 commit from gh-pr/1380/head into gh-pr/1380/base
Owner

@⁠ashrafsdrop on GitHub · 2026-11-24 17:40 UTC · original
ashrafsdrop:net/local-hostname-resolution → main · +51 −4 · 1 files · 1 commits · closed without merging

Summary
Resolves VIC-BT-039 from #1249:

  • resolvable() and loopback_name() in crates/victory-hle/src/modules/net.rs previously blocked any non-numeric hostname other than "localhost" with WSAHOST_NOT_FOUND.
  • Titles querying their own local machine's hostname (e.g. from gethostname()) failed to resolve local endpoints when establishing sockets.
  • Queries and caches the machine's local hostname via host ws2_32.dll gethostname, permitting it in resolvable() and treating it as a loopback endpoint in loopback_name().
  • Adds unit test in net.rs asserting getaddrinfo() resolves the machine's local hostname.

Verification

  • cargo test -p victory-hle: 94 tests passed, 0 failed.
  • cargo clippy -p victory-hle --all-targets --all-features -- -D warnings: clean, 0 warnings.
  • cargo run -p xtask -- policy: 154 files ok.
**@⁠ashrafsdrop** on GitHub · 2026-11-24 17:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/1380) `ashrafsdrop:net/local-hostname-resolution` → `main` · +51 −4 · 1 files · 1 commits · closed without merging Summary Resolves VIC-BT-039 from #1249: - `resolvable()` and `loopback_name()` in `crates/victory-hle/src/modules/net.rs` previously blocked any non-numeric hostname other than `"localhost"` with `WSAHOST_NOT_FOUND`. - Titles querying their own local machine's hostname (e.g. from `gethostname()`) failed to resolve local endpoints when establishing sockets. - Queries and caches the machine's local hostname via host `ws2_32.dll` `gethostname`, permitting it in `resolvable()` and treating it as a loopback endpoint in `loopback_name()`. - Adds unit test in `net.rs` asserting `getaddrinfo()` resolves the machine's local hostname. Verification - `cargo test -p victory-hle`: 94 tests passed, 0 failed. - `cargo clippy -p victory-hle --all-targets --all-features -- -D warnings`: clean, 0 warnings. - `cargo run -p xtask -- policy`: 154 files ok.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:29:33 +00:00
github-bot closed this pull request 2026-11-26 04:29:33 +00:00
Author
Owner

@⁠acetonahard-code on GitHub · 2026-11-24 21:02 UTC · original

Tested on Windows 11 with the repo toolchain, merged into current main (ffe310e):

cargo test -p victory-hle passed failed ignored
main 95 0 0
main + this PR 95 0 0
  • cargo clippy --all-targets -- -D warnings, with and without --all-features: clean.

I didn't test with game data.


Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.

**@⁠acetonahard-code** on GitHub · 2026-11-24 21:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/1380#issuecomment-7144404983) Tested on Windows 11 with the repo toolchain, merged into current `main` (ffe310e): | `cargo test -p victory-hle` | passed | failed | ignored | |---|---|---|---| | `main` | 95 | 0 | 0 | | `main` + this PR | 95 | 0 | 0 | - `cargo clippy --all-targets -- -D warnings`, with and without `--all-features`: clean. I didn't test with game data. --- <sub>Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.</sub>
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:39 UTC · original

Automated triage for the maintainers. Closing because it breaks a repository rule (see docs/asset-policy.md and the project rules): nothing taken from the console SDK or the game, no weakening of the asset policy, and the title stays offline.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/1380#issuecomment-7148738467) Automated triage for the maintainers. Closing because it breaks a repository rule (see `docs/asset-policy.md` and the project rules): nothing taken from the console SDK or the game, no weakening of the asset policy, and the title stays offline. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!1380
No description provided.