Make STATUS_HTTP work on crossplay servers via PlayFab lobby query - #786
Open
GoodOlClint wants to merge 1 commit into
Open
Make STATUS_HTTP work on crossplay servers via PlayFab lobby query#786GoodOlClint wants to merge 1 commit into
GoodOlClint wants to merge 1 commit into
Conversation
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>
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.
Fixes #663, fixes #766.
Problem
With
CROSSPLAY=true(orSERVER_ARGS=-crossplay) the server never answers A2S queries, sovalheim-statusreportstimeout('timed out')or 0 players, and/status.jsonis useless.Change
When crossplay is enabled (or
--playfabis passed),valheim-statusqueries 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: anonymousLoginWithCustomID→Lobby/FindLobbies, stdliburllibonly, no new deps.PLAYFAB_ENTITY_IDenv → entity id pinned from first successful lookup (/var/run/valheim/playfab-entity-id.txt) →PLAYFAB_JOIN_CODEenv → join code captured from log →SERVER_NAME(last resort, not unique).defaults: whenCROSSPLAY=true, auto-registers aVALHEIM_LOG_FILTER_CONTAINS_PlayFabJoinCodefilter that writes the join code to/var/run/valheim/valheim-joincode.txt. User-defined filter of the same name wins.status.jsonexample.status.json on crossplay
player_count,max_players,join_code,public_ip,game_version,lobby_created. Player names aren't in the lobby, soplayersis[].Notes
CustomIdlogin creates one throwaway anonymous player account per title; entity token is cached ~20h.string_key9created-ticks) is used.server_is_idleincommonstill uses the nstat datagram heuristic for crossplay (BACKUPS_IF_IDLE=false prevents automated backups: player check fails completely (both with and without crossplay) #773).valheim-status --playfabnow returns a real player count on crossplay, so that heuristic can be replaced in a follow-up.🤖 Generated with Claude Code