Steam friends: make Join work — read rich presence from field 71, support lobby and server joins - #10
Open
Leb-Sun wants to merge 2 commits into
Open
Steam friends: make Join work — read rich presence from field 71, support lobby and server joins#10Leb-Sun wants to merge 2 commits into
Leb-Sun wants to merge 2 commits into
Conversation
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.
Join never appeared in the friends drawer. The cause was in the persona-state parser:
CMsgClientPersonaState.Friendfield 25 was being read as the rich-presence submessage,but 25 is
steamid_source(a fixed64). Rich presence is field 71. Every friend thereforecame back with an empty connect string, and
isJoinable— which required exactly that — wasnever true.
Parsing
game_lobby_id(73),game_server_ip(4)and
game_server_port(5).Option<..>rather than plain integers so the merge can tell absent(keep what we have) from an explicit 0 (the server cleared it). Persona pushes are
partial, so collapsing the two loses joinability on unrelated updates.
Stateful merge
Rich presence and lobby id have no "cleared" wire form. Without handling that, a friend who
switches games keeps the previous game's join data and Join offers a stale target. When a
push changes
game_played_app_id, rich presence, lobby id and game-server fields are clearedbefore the new values are applied.
Choosing what to join
SteamFriendEntry.joinArgsmirrors Steam's own precedence:connectcommand line,+connect_lobby <lobby_id>for an open lobby,+connect <ip>:<port>for a game server.isJoinablenow keys offjoinArgsinstead of the connect string alone, which is what letsopen-lobby games (no
connectin rich presence) offer Join at all.connectis friend-controlled and ends up on a Windows command line, so it is filtered todrop control characters and double quotes before use.
game_server_iparrives host-order, sothe high byte is the first octet.
UI
The Join button additionally requires the game to be installed — previously it could be
offered for a game the user does not have.
Delivery
The second commit forwards the join args on the native
LaunchApppath, which builds thegame's command line from
localconfigrather than the launcher's argv, so a join has to ridethat too. The argv and ColdClient paths already carried it via
appendSteamJoinConnect.Tests
Added to the Rust unit tests: field 25 as
steamid_sourceis skipped and does not populaterich presence; lobby and game-server fields parse; an explicit zero lobby id is treated as
present-and-cleared rather than absent; lobby state survives a partial persona update and
clears when the friend changes game.
Base
Stacked on
steam-launch-options(upstream WinNative-Emu#600). The delivery commit touches thelocalconfigblock introduced there; the parsing and UI work does not depend on it.