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

Closed
ashrafsdrop wants to merge 1 commit from upstream-pr/1380 into main
ashrafsdrop commented 2026-11-24 17:40:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ashrafsdrop on 2026-11-24T17:40:04Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6587817539 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1380). Originally posted by [ashrafsdrop](https://github.com/ashrafsdrop) on 2026-11-24T17:40:04Z. --- 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.
acetonahard-code commented 2026-11-24 21:03:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by acetonahard-code on 2026-11-24T21:02:53Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7144404983 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1380#issuecomment-7144404983). Originally posted by [acetonahard-code](https://github.com/acetonahard-code) on 2026-11-24T21:02:53Z. --- 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>
upstream-sync closed this pull request 2026-11-25 01:06:25 +00:00
Marvisak commented 2026-11-25 01:08:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:39:21Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148738467 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1380#issuecomment-7148738467). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:39:21Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1380
No description provided.