feat: server latency test — ping gssv regions to pick the fastest server.region - #1007
Open
Endymi0n74 wants to merge 2 commits into
Open
feat: server latency test — ping gssv regions to pick the fastest server.region#1007Endymi0n74 wants to merge 2 commits into
Endymi0n74 wants to merge 2 commits into
Conversation
A "📡 Test server latency" button in the Server section pings every region's gssv provisioning endpoint via NATIVE_FETCH (?probe=1, no-cors) with a 3s timeout, lists the RTT per region and highlights the fastest one — a simple way to pick server.region without trial and error. NATIVE_FETCH + ?probe=1 keep the measurement on the real network path: the script's session-play interception never sees these requests. Port of the "📡 Latence serveur" feature shipped in the EvenBetterXcloud fork (v1.10.0), validated in real sessions: pings the 19 gssv regions, ~1-2s total, best region marked ⭐ recommended.
…uttons The previous guard (buttons?.[16]) only protected against a missing buttons array, but gamepads like the GameSir G7 SE report a buttons array with only 15 elements — so buttons[16] returns undefined and btnHome.pressed throws, killing the polling loop silently. Guard with btnHome?.pressed !== undefined so the entire shortcut block becomes a no-op for non-standard gamepads while the rest of the poll keeps running normally. Fixes redphx#991 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Server latency test (gssv ping)
What
Adds a "📡 Test server latency" button at the bottom of the Server
settings group. On click it pings every region's gssv provisioning endpoint
(
STATES.serverRegions), measures the RTT, lists all regions sortedbest → worst, and highlights the fastest one as ⭐ recommended region —
a simple, data-driven way to pick
server.regioninstead of guessing.Why
server.regiondefaults to UKS for many users, which can be far from theirnetwork path (e.g. 43 ms to UKS vs 30 ms to CSE in our tests). Picking the
closest region lowers latency, jitter and packet loss on every stream. The
only way to know the best region today is trial and error: you set a region,
start a stream, and check the stats overlay.
How
baseUri + /v5/sessions/cloud/play?probe=1(baseUriis thereal host, e.g.
https://eus.core.gssv-play-prod.xboxlive.com—shortNamecontains a flag emoji and is not a valid host).
NATIVE_FETCH(the originalwindow.fetchcaptured inbx-flags.ts)?probe=1: the script's own fetch interception rewrites/sessions/cloud/playrequests (region selection) — this test must measurethe real network path to the target region, untouched.
mode: 'no-cors', cache: 'no-store'+ 3 s timeout per region.marked with a ⭐ line at the top of the list.
Validation
Measured on a real session (better-xcloud fork, v1.10.0, feature ported
1:1 — see
bench/feature-latency.js):RTTs are geographically coherent and stable across re-runs (same region
selected as best). The button lives in the Server group, works while signed
out (region list is loaded by the client regardless), and re-runs are one
click ("Re-run test").
No perf impact: the test only runs when the user clicks the button.