Enforce FriendsOnly lobby privacy during handshake#10022
Enforce FriendsOnly lobby privacy during handshake#10022trende2001 wants to merge 1 commit intoFacepunch:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds server-side enforcement for FriendsOnly lobby privacy during the handshake phase. When a lobby is configured with LobbyPrivacy.FriendsOnly, the host now validates the joining player's SteamId against its Steam friend list and kicks non-friends before they can fully connect.
Changes:
- Adds FriendsOnly validation in the
On_Handshake_ClientInfomethod after SteamId resolution - Implements fail-closed error handling for Steam API failures
- Adds clear logging for both allowed and rejected connection attempts
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
LGTM |
handsomematt
left a comment
There was a problem hiding this comment.
Why is there a huge try catch around isFriend = joiningFriend.IsFriend;?
This is a good place to do this friend check, but your implementation can be a lot tighter.
Adds host-side enforcement for LobbyPrivacy.FriendsOnly lobbies. Previously, non-friends could still connect and remain in the lobby, which is now fixed.
5bcf20d to
9623d7f
Compare
I made the implementation a lot more tighter without over defensive checks. |
Summary
Adds server-side enforcement for
LobbyPrivacy.FriendsOnlylobbies during the handshake phase. When a lobby is set to FriendsOnly, the host now validates the joining player's SteamId against its own Steam friend list and kicks non-friends with the message "This lobby is Friends Only."Previously, non-friends could connect and remain in the lobby.
Motivation & Context
Players expect that setting their lobby to "Friends Only" actually prevents non-friends from joining. This change closes that gap at the engine level so game code doesn't need to reimplement it.
Implementation Details
On_Handshake_ClientInfoafter the SteamId is resolved from the trustedSteamLobbyConnection, usingFriend.IsFriendagainst the host's local friend list.Screenshots / Videos (if applicable)
Checklist