tremwil / SteamP2PInfo

C# WPF application to show current Steam P2P connections and ping in any Steam game
MIT License
109 stars 11 forks source link

Logging P2P connections when the game makes use of Steam to create said connections #44

Open OhKevinKevinKevin opened 7 months ago

OhKevinKevinKevin commented 7 months ago

I think this is addressed in the Known issues, but I'm not sure if we talk about the same thing:

Peers not getting detected in rare circumstances (versions < 1.2.0)

This is due to the very naive Steam IPC log file parsing. The program can "miss" a Steam lobby, preventing the detection of P2P peers in this lobby. I plan to improve the log file parsing to make this rarer or completely eliminate it in the future.

I'm using the latest release, published two weeks ago.

So this game for instance works with Steam, and it's Steam.exe itself the process that actually makes the connections (I've verified this myself using Windows Resource monitor), not the game process. How do we capture the data if Steam.exe doesn't have any apiID? The game process only connects to the developers server. Matchmaking and lobby creation is done through Steam.exe

I want to log the connections made by Steam.exe and link them to the Steam ID or community ID. Is that even possible?

tremwil commented 2 months ago

You're correct, the actual UDP connection is made by the Steam process. The way the steam ID of players is matched with the outbound IP is by collecting a list of potential players in the lobby by logging SteamMatchmaking and AuthSession IPC calls. The steam IDs of these players is then passed to ISteamNetworking::GetP2PSessionState to get the raw P2P connection socket address (player IP and port). This is matched with the ping calculated from tracing UDP packets using ETW.