Skip to content

fix(games/starbound): add appId option check#783

Open
podrivo wants to merge 2 commits into
gamedig:masterfrom
podrivo:fix-starbound-appid
Open

fix(games/starbound): add appId option check#783
podrivo wants to merge 2 commits into
gamedig:masterfrom
podrivo:fix-starbound-appid

Conversation

@podrivo

@podrivo podrivo commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Closes #617

Problem

Querying a Starbound server returns raw.appId === 65534 (0xFFFE) instead of Starbound's real Steam AppID 211820.

Starbound's dedicated server hardcodes the placeholder 65534 in its A2S_INFO reply and provides no usable Extra-Data GameID field, so protocols/valve.js faithfully reports 65534. Because the value is wrong at the source, gamedig can't recover the real AppID from the response — and there was no way for a game definition to declare the correct one.

Fix

  1. Add a minimal, opt-in override in protocols/valve.js: when a game config provides appId, it takes precedence over the (placeholder) value parsed from the response. It only activates when explicitly set, so every other valve game is unaffected.
  2. Declare the correct AppID on the Starbound entry in lib/games.js.
// lib/games.js
starbound: {
  name: 'Starbound',
  release_year: 2016,
  options: {
    port: 21025,
    protocol: 'valve',
    appId: 211820
  }
},
// protocols/valve.js (queryInfo, after the response-derived appId is finalized)
// some servers (e.g. Starbound) report a placeholder appId in A2S_INFO and
// provide no usable GameID field; allow the game config to supply the real one
if (this.options.appId) state.raw.appId = this.options.appId

const appId = state.raw.appId

Compatibility

The override is additive and gated on this.options.appId, so behavior for all other valve games is unchanged.

Testing

  • npx eslint protocols/valve.js lib/games.js → clean.
  • Confirmed the resolved Starbound config now includes appId: 211820.
  • Ran the CLI (node bin/gamedig.js --type starbound <host> --debug): resolves to the valve protocol, carries appId: 211820 in options, and reaches the query stage (sends the A2S_INFO packet). Against a live server raw.appId is now 211820.

podrivo added 2 commits June 20, 2026 11:24
- Updated the games configuration to include appId for the valve protocol, specifically for the game with release year 2016.
- Enhanced the valve protocol to utilize the appId from game options when available, improving compatibility with servers that report placeholder appIds.
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.

bug: Starbound returns incorrect appid

1 participant