fix(games/starbound): add appId option check#783
Open
podrivo wants to merge 2 commits into
Open
Conversation
- 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.
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.
Closes #617
Problem
Querying a Starbound server returns
raw.appId === 65534(0xFFFE) instead of Starbound's real Steam AppID211820.Starbound's dedicated server hardcodes the placeholder
65534in itsA2S_INFOreply and provides no usable Extra-Data GameID field, soprotocols/valve.jsfaithfully reports65534. 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
protocols/valve.js: when a game config providesappId, it takes precedence over the (placeholder) value parsed from the response. It only activates when explicitly set, so every other valve game is unaffected.lib/games.js.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.appId: 211820.node bin/gamedig.js --type starbound <host> --debug): resolves to the valve protocol, carriesappId: 211820in options, and reaches the query stage (sends theA2S_INFOpacket). Against a live serverraw.appIdis now211820.