Skip to content

Make STATUS_HTTP work on crossplay servers via PlayFab lobby query - #786

Open
GoodOlClint wants to merge 1 commit into
community-valheim-tools:mainfrom
GoodOlClint:playfab-status
Open

Make STATUS_HTTP work on crossplay servers via PlayFab lobby query#786
GoodOlClint wants to merge 1 commit into
community-valheim-tools:mainfrom
GoodOlClint:playfab-status

Conversation

@GoodOlClint

Copy link
Copy Markdown

Fixes #663, fixes #766.

Problem

With CROSSPLAY=true (or SERVER_ARGS=-crossplay) the server never answers A2S queries, so valheim-status reports timeout('timed out') or 0 players, and /status.json is useless.

Change

When crossplay is enabled (or --playfab is passed), valheim-status queries the PlayFab lobby the server registers for the in-game browser / join-code flow instead of A2S. Works for public and private (SERVER_PUBLIC=false) crossplay servers. Steam-only servers are unaffected.

  • valheim-status: anonymous LoginWithCustomIDLobby/FindLobbies, stdlib urllib only, no new deps.
  • Lobby identification, most reliable first: PLAYFAB_ENTITY_ID env → entity id pinned from first successful lookup (/var/run/valheim/playfab-entity-id.txt) → PLAYFAB_JOIN_CODE env → join code captured from log → SERVER_NAME (last resort, not unique).
  • defaults: when CROSSPLAY=true, auto-registers a VALHEIM_LOG_FILTER_CONTAINS_PlayFabJoinCode filter that writes the join code to /var/run/valheim/valheim-joincode.txt. User-defined filter of the same name wins.
  • README: documents the behaviour, new env vars, and crossplay status.json example.

status.json on crossplay

player_count, max_players, join_code, public_ip, game_version, lobby_created. Player names aren't in the lobby, so players is [].

Notes

🤖 Generated with Claude Code

With crossplay enabled the server never answers A2S queries, so
valheim-status reported a timeout or 0 players. Query the PlayFab lobby
the server registers instead, identified by a pinned entity id, the join
code captured from the server log, or the server name as last resort.

Fixes community-valheim-tools#663, fixes community-valheim-tools#766

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

status.json reports "timed out" HTTP_STATUS always returns 0 players

1 participant