Giter VIP home page Giter VIP logo

steamp2pinfo's Introduction

SteamP2PInfo

Simple C# application displaying active Steam P2P connection info, namely SteamID / ping / connection quality. This was specifically made with Elden Ring in mind, but it should work for any Steam Networking game that authenticates peers using ISteamUser::BeginAuthSession. Also comes with a customizable overlay (windowed / borderless mode only!) and logging.

It also supports adding peers to the Steam recent players list, if the game does not support this.

How to Use

Download the lastest release from the Releases tab and extract the ZIP file in any folder on your computer. Once the game is running, start SteamP2PInfo.exe and click on "Attach Game". Select the appropriate game window in the dialog. If this game has never been opened before, you will be prompted to enter the game's Steam AppId. This can be queried on websites like steamdb. The Steam console will then open. You must enter the following command in the console for the tool to work:

log_ipc "BeginAuthSession,EndAuthSession,LeaveLobby,SendClanChatMessage"

The program should now be ready! You can then go in the "Config" tab to customize game-specific settings.

Known Issues

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.

Overlay cannot be dragged around

I'm not sure what the cause for this is yet. Please modify the "X Offset" and "Y Offset" settings directly for now.

Cannot customize ping color thresholds

Not really an issue, but I plan to implement a GUI editor for this in the future. For now the colors can be changed by directly editing the game's json configuration file.

FAQ

Why does it require administrator privileges?

While the SteamNetworkingMessages API provides detailed connection information, the old API SteamNetworking does not do this. Hence in this the pings are computed by monitoring STUN packets that are sent to and recieved from the players' IPs. To capture these packets I use Event Tracing for Windows (ETW), which requires administrator privileges for "kernel" events like networking.

Why do I have to use the Steam console / IPC logging? Isn't there an cleaner way to monitor lobbies?

Sadly, this is the only way I found to reliably detect lobby joining and creation when running two processes using the same game ID. I cannot use Steam callbacks, because if the game "consumes" them my tool's callbacks will not be called, and vice versa. I also do not want to rely on reading game memory or injecting code into the game in order to support anti-cheat protected games. In the future, I plan to move from IPC log file parsing to an internal steam.exe hook to make peer detection 100% reliable. Since some VAC games might not like this, an option will be available to use the legacy system if needed. This new method will take quite a bit of work to implement, however.

(1.1.0 and above) zkxs had the smart idea to log ISteamUser::BeginAuthSession calls instead of lobby joining. Since Steam Networking P2P games must use this method to authenticate peers. This is a much more robust choice than the old logic which was using IClientMatchmaking CreateLobby and JoinLobby. In 1.2.0, I combine this with IClientMatchmaking::LeaveLobby to eliminate improperly terminated connections and additionally log dummy calls to IClientFriends::SendClanChatMessage to periodically force Steam to flush the IPC log. This now makes the tool very reliable.

How is the "Connection Quality" computed?

When a peer is connected using the SteamNetworkingMessages API, this roughly corresponds to 1 - packet_loss. When connected using the deprecated API SteamNetworking, the value is computed using the formula 1 / (0.01 * jitter + 1), where jitter is the standard deviation of the last 10 ping values. This is done instead of showing jitter directly so that the value is on the same scale as the SteamNetworkingMessages one.

Why does the program close with the game?

Since the tool is loaded with the game's Steam AppId, letting the program run after the game closes would make Steam think the game is still running. Calling SteamAPI_Shutdown does not seem to fix the problem, so we have to close the process.

I found a bug / I have something to say about the tool

Feel free to open an issue on this Github repo.

steamp2pinfo's People

Contributors

cridus avatar hinkiii avatar tremwil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

steamp2pinfo's Issues

Directory Not Found

Upon running the .exe and using "Attach Game", I am met with the attached error. I suspect this may be due to my Steam not being installed in the default location and SteamP2PInfo can't find the .log, but I don't see a way to point to its correct location.
Capture

Sound

  1. I would like to be able to select sounds other than Windows sound effects.
    My Windows theme is "No Windows Sound", and in this case, even if I turn on the setting, there is no sound.

  2. If a sound alert occurs when a new [PEER CONNECT] occurs since the session started. I would like to be able to use a sound to warnnig of the appearance of new intruders or hunters.

Crashing when focusing back to the game

After attaching the game and focusing back to Elden Ring, the application crashes with the following log:

Win32Exception: Invalid window handle
   at MS.Win32.UnsafeNativeMethods.GetMessageW(MSG& msg, HandleRef hWnd, Int32 uMsgFilterMin, Int32 uMsgFilterMax)
   at System.Windows.Threading.Dispatcher.GetMessage(MSG& msg, IntPtr hwnd, Int32 minMessage, Int32 maxMessage)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at SteamP2PInfo.App.Main()

Seems a bit random too, a couple days ago the program was working fine and then it started crashing all of a sudden.

For those with ipc error and no logging.

the IPC error and no logging seems to stem from steam not being installed in the C drive which can be fixed by the creator making a path setting instead of what seems to be a built in auto path that I haven't been able to find to change. The only current way to get this fixed is to re-install steam on C drive, which is to much work so i wont be using this until that is (hopefully) implemented. I did trying creating a false path to the IPC log however steam will only write to the one in the actual steam folder, so the log won't show anything at all.

HDR Display Issues with Overlay

It's not possible to use SteamP2P with HDR enabled because the display becomes super bright and washed out, disabling HDR fixes problem.

no player info appearing on overlay or the program itself

player info does not appear whatsoever in the overlay or in the steam p2p window itself. this is not an occasional thing, i have never once seen anything besides "Steam p2p info by tremwil" on the overlay and have never seen any info displayed in the main program window, it is always 100% blank. how can i fix this? i see other people using it, and they get player info/ping, but it will not display for me at all.

this has been a persistent problem for me in all releases of steamp2p info. i have been trying to get this program to work since you released it and have been hoping whatever is causing this issue would have been ironed out in future releases, but that does not appear to be the case. any ideas on what i can do to get this program to work as well for me as it seems to for other players?

Error messages in steam console

I'm getting a bunch of errors in steam console with the new version. I'm assuming it's errors, it's in red. Not sure if its actually causing issues, I haven't noticed anything. Says "Stop spewing for IClientUser::EndAuthSession, too many calls." I've attached steam log and a picture as the steam log doesn't seem to show everything i see in the console.

Screenshot 2024-02-13 040424
ipc_SteamClient.log

Cool utility question

Hey I would like to know if there is anyway that this tool could have a “Disconnect” button type thing.
I know it sounds kinda sketchy but I keep getting this AFK farmer and it would be much easier to press a quick button instead of going around the menus to disconnect from the session.

I used the DS3 tool which was super handful with the invasion keybind, but I know in ER it’s not possible due to this shit anticheat (shit because of the problem that comes with it)

Screen capture/OBS/etc friendly suggestion

I record my invasions with this tool on and its been a great way for me to document what players I've run into and block the cheaters and AFK farmers, but i've had to use a not clean method to display ping info on my recordings.

Was wondering how the display method is done and if there is a way to have an option to ingrain the display info so capture devices can grab it?

Capture3

Capture4

How to add players as friends?

Since there is no way to view recent players on PC without a workaround such as this, how do I add somebody I play with in game? I'm playing Elden Ring and SteamP2P works, I just don't know how to use the info to actually send a request to the right account.

Strange issues with invasions 1.1.0

I have close to 30 hours on this new version. This version the overlay is never blank when joining any session (arena duels, invasions, Taunters Tounge) Thank you tremwil! I haven't tried arena 2v2 or 3v3, I don't think people still do that on PC. Arena duels work perfectly every time. Invasions are a different story. You only get the Hosts info when invading. Not once have i invaded and had every player in the session showing on the overlay at the beginning of the invasion. If a blue, another invader or phantom joins then all players will populate. Sometimes they'll randomly populate but not often. It normally takes someone else joining to trigger the overlay to show everyone that's in the session. If you check the steam overlay all the players are there, just not showing on p2p info overlay. With the old p2p info it was about 60-40 maybe 70-30 you'd get the info when invading. 60% you get all players in the world showing, 40% you get nothing until someone else joins the session (blue, phantom, invader) If no one else joins, it normally stays blank.

There is some strange stuff happening after winning an invasion. If you win the invasion and killed the host first, most of the time the once unknown phantom will then show up in the overlay and the host will disappear. He'll then stay in the overlay for about 2 minutes once back in your own world. This happens 90% of the time. If you kill the phantom first then defeat the host, the host's name will stay for about 2 minutes once the session is over. This doesn't disrupt anything it's just strange. If you lose the invasion the overlay will clear normally. If there is just a single host with no phantom or blue, their name will clear normally after the session is over. You only get this strange prolonged connection showing if you win and there was more than 1 other person in the session. If you need me to test anything let me know.

Refresh Rate / Tearing issues in Windowed Borderless Mode.

EDIT: Resolved by enabling G-sync.

I have 144 hz monitor and I'm playing in 2560x1440p Borderless Screen mode. The game is super smooth by default. But when I run Steam P2PInfo my screen begin to lag a bit. It's noticeable when I run left and right next to some vertical objects (like pillars for example). It looks like refresh rate is suddenly dropped and screen updates slowly. I decided to test it even further and force disabled Vsync for EldenRing.exe in Nvidia Control Panel. Without Steam P2PInfo everything looks super smooth even without vsync (as game uses Windows vsync I assume). But as soon as I launch P2Pinfo overlay it instantly cause screen bad screen tearings. So it looks like having overlay on top of the game cause all this problems. It might not be exactly P2PInfo issue. But I have MSI Afterburner overlay and it runs just fine with no lags or tearing's.

I tried limiting fps to 59, tried both vsync on, off but nothing helped. No matter what fps limits of settings I have the game runs fine and smooth by default. P2Pinfo overlays cause issues.

Is there any solution?

Windows 10 21H2 with latest updates.
RTX 3080 Ti with latest drivers.

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

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?

Peers not getting detected recently

I've been using this for Dissidia Final Fantasy NT, and it was working fine up until recently. Now, it doesn't detect anyone at all, even with 1.2.0. I tried an older version too, which also didn't work.

The console continuously sends "src\common\steamid.cpp (663) : steamIDClan.GetEAccountType() == k_EAccountTypeClan" in red, which I assume is an error. I believe that it also tries to call for "IClientFriends::SendClanChatMessage" for a while, but it gets nothing and then stops due to too many calls (idk any of this stuff so I might be interpreting it wrong). That's all that it does while it's on.

Doesn't seem to work often?

I've followed all the instructions given to run this, and yet the program very rarely detects people. I've summoned about 20 different people now and it's only worked twice.

eldenring_IvW7EanARj
JIf8DyviMn
SteamP2PInfo_yubHckDGG9

.

Error after the latest nvidia driver update when you're trying to attach Elden Ring

NullReferenceException: Object reference not set to an instance of an object.
at SteamP2PInfo.MainWindow.labelGameState_RequestNavigate(Object sender, RequestNavigateEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.Documents.Hyperlink.NavigateToUri(IInputElement sourceElement, Uri targetUri, String targetWindow)
at System.Windows.Documents.Hyperlink.DoNavigation(Object sender)
at System.Windows.Documents.Hyperlink.OnClick()
at System.Windows.Documents.Hyperlink.DoUserInitiatedNavigation(Object sender)
at System.Windows.Documents.Hyperlink.OnMouseLeftButtonUp(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

unauthorized access exception

image
I followed the instuctions and also made sure that the path to the log files are correct, but the app keep saying that there's an unhandled exception: unauthorized access exception.

steam ipc log file does not exist

i set up the program, did the attach game thing, put the command into steam console, but i keep getting an error message that says the steam ipc log file does not exist. i went to my steam folder to logs, and i do not have any kind of file that says anything about ipc. what file do i need to put in and what do i do if it is not there? the program seems to be working otherwise, i just get constant error messages and windows ding noises.

Patch 1.04.1

Since the last patch of ER, I need to restart the program like every 10 mins becouse I only got on the overlay "-1" as a ping for everyone. Or sometimes the overlay is empty. The overlay doesnt show anything. Thx for your work!

Recent Players List?

I've heard from multiple sources that Elden Ring on Steam has a functional recent players list. In my attempt to figure this feature out, I've found this excellent little program. It works great for me, just a couple questions though. In the readme, it says you can use the program to log recent players to the recent players list; I cant find this functionality. How do I do this? Also, is it possible for the names of the recent players to be logged to the log file? In other words, after I disconnect from a player, is there a way for me to go back and see who I had connected with? Sorry if this isn't really an "issue," I just would like some clarification and potentially help future users of this program. Thanks for the hard work.

Misses half of the player in Elden ring Arena

Half of the player are missed from by the app - tested over multiple back to back arena session. The very first session almost never misses, which lead me to believe It might have to do with back to back queuing

Tekken 7

For some reason it doesn't pick up any of the ipc info it could be cause the log gets flooded with tekken specific vars

Program Crashes after game is attached

Hello there ! Downloaded and did everything as told in the description. But after I attached the game, the program crashes overlay closes. I tried not to press anything in the crash window to test the overlay but no use because the overlay is on but shows nothing =(
Screenshot of the crash message attached. Hope you can help :( ty

zyhMyP6h9p

New version 1.10

I don't think this is working at all in the colosseum now. 1st 10 fights no connections shown. I've yet to see 1.10 work. I'll keep trying. Old version seemed more reliable. I would have maybe 6 out of 10 to show previously. edit: switched to old version got 9 out of 10 matches shown. Went back to 1.10 for 5 more tries still nothing.

disconnect

phantom seems to dc after 2 mins in my world while using

Another IPC log not found issue

Screenshot (18)
What am I meant to do to solve this issue? It's to my understanding at least that the file exists. Is the location not the directory and some random file? I don't need this but I'd much rather have it then not have it.

Unhandled exception: Unauthorized Access

So I've installed this app and selected a path to steam logs (changed it because I have installed steam elsewhere), however it is giving me access denied exception as I input command into console. I run it as admin and turned windows defender off to no avail. How do I grant access to that folder?

Nobody shows up after setting all up. Overlay stays empty when matched with other players and possinble fix

I have downloaded this about 5 days ago.
Did not work on the first day i tried it. Ran it as administrator, Linked it to elden ring, Put the command in the steam console, Configured the overlay like how i wanted it. Once i got to some pvp action its just stays blank. Like there is nothing showing up. No connections what so ever, log stays empty. that was for the whole evening, got in to more then 30 pvp encounters since doing both invasions and coliseum.

The second day i decided to try it again. Opened Elden ring, went in-game, opened the program as admin and did all the same steps, Except put the command in steam console twice. When i did that it showed me some stats about call backs or something like that, So i thought now i has to be working. And it did. for the whole day.

Third and forth day it did not work again. Same process as before.

Yesterday it did work after opening it like 3 times.

Today again i cant seem to get any info about the p2p connections i have.

Also cant find any answers on this in the issues page. I am not sure what is going on, i get the red message in the console about the clan thing but read that was expected behavior. Any idea what might be going wrong, or is there any additional information that is required to trouble shoot?

Edit: I was running the steam beta version and now i am back on the normal version. Did the whole startup process and worked first time. Dont know if its just a coincidence or that the beta makes it not work. Dont have enough data on that yet.

Edit 2: So it was not the problem, next boot same problem, reboot everything, still not working. then i decided to put the command in at the beginning of my session. Meaning when i just started my pc up. So i opened up the steam console by pressing Windows+R and typing "steam://open/console" and i put the command on this page in once. It says it is now running it, I open up elden ring, Wait for the game to load en after selecting my character i open steam p2pinfo as a admin. Link it to elden ring, and so far it has working 7 times in a row for me. I know this because i restarded my pc serval times to see if it is fixed, so for it is.

Option to write the ping to a log file?

It would be great if there was a way to write the ping to a log file! My use case is I’m performance testing various setups with ER, and want to know which setup has lower ping on average.

It would be easy to aggregate the info from a file. As is I’d have to manually record the info from the overlay.

Any interest in adding this feature? I don’t speak much C# but if you’d accept the PR I’d attempt it.

Thanks!

Console not working after latest steam update

Hi and thanks for this app, it's great. After the last steam update p2p info no longer activates the console. It can be manually opened using steam://open/console so we still have access to it. Any suggestions on a fix or work-around? It's not a big issue and I can still do it manually, I'm just lazy and want u to do more work :) Thanks again!

Display character name along with Steam profile

This functionality exists in Dark Souls III's Blue Sentinel/PvP Watchdog mods, and it is very helpful for knowing which players need to be blocked. I wonder if this could be added to this program, or if it running separately from the game's .exe means that there is no way for this program to know which character belongs to which Steam profile.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.