WombatFromHell / OriginSteamOverlayLauncher

An executable wrapper for Steam to make third-party launchers more convenient to use with a Steam Controller
MIT License
421 stars 25 forks source link

By any chance do you own escape from tarkov? #20

Closed BarterClub closed 6 years ago

BarterClub commented 6 years ago

It seems to be a weird one. So the launcher launches the game but it dosent use the .exe because there is no in game login then. Not sure if there is a work around with this.

WombatFromHell commented 6 years ago

Unfortunately I don't own Escape from Tarkov. Unless there's a way to pass an authentication string to the launcher via command-line, and sometimes there is in the case of say the Epic Games launcher for example, it probably won't work with a secondary launcher like OSOL.

You could try using Task Manager or Process Explorer to see the running command-line of the launcher when it launches the game to see how it passes the authentication token along.

BarterClub commented 6 years ago

What would i look for?

WombatFromHell commented 6 years ago

If you're using Task Manager under Windows 10 you can go to the Details tab and right click one of the columns, click Select Columns, then check Command Line in the list. Run the game from Steam with Task Manager open on the Details tab, and look for the name of the launcher executable in the list then scroll to the right for the active command line its using.

This may be more difficult if the launcher is fully automated when running from Steam and functions more like a proxy where it only lives long enough to call the game using the authentication token. If the game itself takes the token from the launcher (launchers that automatically fill in your credentials after authenticating once tend to do this) you may look for its command line to see what the game uses when called from that particular launcher.

BarterClub commented 6 years ago

so after the command line to the exp it has a really long command, image

WombatFromHell commented 6 years ago

You can copy that particular process and its details to the clipboard using CTRL+C while the process is selected in the Details tab, then paste that text into notepad to extract the command line. The first part of which appears to be an encoded version of your steam user id, and the part after the equal sign is probably the authentication token itself. You could try just pasting the whole command line argument string (minus the file path) into the OSOL ini as a game launch argument and see what happens.

Based off of what you've told me so far I could probably implement some limited support for relaying launcher tokens from the command line through OSOL. Not having the game itself makes it somewhat difficult to debug during implementation though.

BarterClub commented 6 years ago

here is the tokken "C:\Escape From Tarkov\EscapeFromTarkov.exe" -bC5vLmcuaS5u=eyJlbWFpbCI6ImplZmZyZXlib3lpbmd0b25AZ21haWwuY29tIiwicGFzc3dvcmQiOiJkMjBmOWQxZTRkZjU4OTZlYTI3ZmM5MzEyMzI3NWQ2YiIsInRvZ2dsZSI6dHJ1ZX0= -token=104444 -popupwindow

BarterClub commented 6 years ago

so that worked.

BarterClub commented 6 years ago

thanks for the help

WombatFromHell commented 6 years ago

I'm adding preliminary support for this to my checklist for OSOL v1.07. No ETA on when a test version with this functionality will be available, however.

WombatFromHell commented 6 years ago

This should be addressed by commit b42f02b and v1.06g. Let me know if the functionality works properly with Tarkov so I can adjust it if necessary.

BarterClub commented 6 years ago

Ok i did try the new update and it doesn't get the token. Also it doesn't launch the launcher anymore. Not sure why tho.

WombatFromHell commented 6 years ago

Hmm, I'll investigate when I get a chance. I think I may have a few ideas I can try.

WombatFromHell commented 6 years ago

If you want the new version to grab the token from the running game process you'll need to make sure the game arguments do not include the token string in the INI in addition to following the instructions on the the project wiki for CommandlineProxy support. I'm not sure why it isn't launching the launcher though.

BarterClub commented 6 years ago

Ya no. I was following the wiki. It seems to not grab the token. let me know if you want to screen share on discord to see what i mean.

WombatFromHell commented 6 years ago

Sounds more and more like I messed something up with one of the commits I pushed. I'll see what I can do here in a bit.

(Edit: I think I know why the launcher won't work. Commit ce6d9f9 includes half-baked logic for handling the launcher when CommandlineProxy is enabled. Totally my bad. Still trying to track down why proxying arguments isn't working properly, because it was working fine in my test environment before I pushed it.)

WombatFromHell commented 6 years ago

Try the new release v1.06h and let me know if this resolves your issues.

(Edit: I've also amended the project wiki to be more clear on which situations CommandlineProxy will or will not work on.)

BarterClub commented 6 years ago

I tested it out. The launcher now opens before the game, but the token is still not being copied. Would you like any screenshots?

WombatFromHell commented 6 years ago

Pasting the OSOL INI and log file would be helpful (enclose the text in three ` (backtick)). You can strip out the actual token in the commandline string for extra privacy if you prefer.

BarterClub commented 6 years ago
[Paths]
LauncherPath=C:\Battlestate Games\BsgLauncher\BsgLauncher.exe
LauncherArgs=
LauncherURI=
GamePath=C:\Escape From Tarkov\EscapeFromTarkov.exe
GameArgs=
MonitorPath=
DetectedCommandline=
[Options]
PreLaunchExec=
PreLaunchExecArgs=
PostGameExec=
PostGameExecArgs=
PreGameOverlayWaitTime=5
PreGameLauncherWaitTime=12
PostGameWaitTime=7
ProxyTimeout=3
ProcessAcquisitionTimeout=300
ReLaunch=True
DoNotClose=False
MinimizeLauncher=False
CommandlineProxy=True
LauncherMode=Normal
[1/19/2018 2:39:54 AM] [NOTE] OSOL is running as: OriginSteamOverlayLauncher
[1/19/2018 2:39:54 AM] [OSOL] Attempting to start the launcher: C:\Battlestate Games\BsgLauncher\BsgLauncher.exe
[1/19/2018 2:39:57 AM] [OSOL] Detected a valid process at PID: 9108 in 3 seconds
[1/19/2018 2:40:02 AM] [OSOL] Launching game, cmd: C:\Escape From Tarkov\EscapeFromTarkov.exe 
[1/19/2018 2:40:05 AM] [OSOL] Detected a valid process at PID: 16888 in 3 seconds
[1/19/2018 2:40:48 AM] [OSOL] Game exited, cleaning up...
WombatFromHell commented 6 years ago

Okay, so, OSOL isn't detecting any commandline arguments in EscapeFromTarkov.exe despite BsgLauncher.exe executing EscapeFromTarkov.exe as a child process with arguments (which includes the token similar to the screenshot posted earlier in the ticket)?

Can you confirm this in Task Manager's "Command line" column when Tarkov is running through OSOL?

Under normal circumstances the following should happen if CommandlineProxy is working:

BarterClub commented 6 years ago

When OSOL launches the game. It opens the launcher, then the game without me doing anything. Then in the game there is a log in i have to do if the token isnt present. So if i launch the game thought the launcher there is a token.

WombatFromHell commented 6 years ago

Ahhh, that's what I was afraid of. I'll probably need to add some logic for situations like that, because currently OSOL will bail if the GamePath is empty.

Back to the drawing board as it were.. :(

BarterClub commented 6 years ago

Sorry

WombatFromHell commented 6 years ago

I've just pushed v1.06i with some changes that should (fingers crossed) work around that behavior and hopefully do what was intended.

BarterClub commented 6 years ago

Ok. So what happened now is when the launcher open it sits there and does nothing. I tried to run the game thought the launcher with OSOL opening the launcher to see if that would get the token it does not. At this time the game does not launcher with out having to launch it in the launcher itself.


[Paths]
LauncherPath=C:\Battlestate Games\BsgLauncher\BsgLauncher.exe
LauncherArgs=
LauncherURI=
GamePath=C:\Escape From Tarkov\EscapeFromTarkov.exe
GameArgs=
MonitorPath=
DetectedCommandline=
[Options]
PreLaunchExec=
PreLaunchExecArgs=
PostGameExec=
PostGameExecArgs=
PreGameOverlayWaitTime=5
PreGameLauncherWaitTime=12
PostGameWaitTime=7
ProxyTimeout=3
ProcessAcquisitionTimeout=300
ReLaunch=True
DoNotClose=False
MinimizeLauncher=False
CommandlineProxy=True
LauncherMode=Normal
[1/19/2018 3:38:25 AM] [NOTE] OSOL is running as: OriginSteamOverlayLauncher
[1/19/2018 3:38:25 AM] [OSOL] Attempting to start the launcher: C:\Battlestate Games\BsgLauncher\BsgLauncher.exe
[1/19/2018 3:38:28 AM] [OSOL] Detected a valid process at PID: 5756 in 3 seconds
[1/19/2018 3:38:57 AM] [OSOL] Detected a valid process at PID: 11348 in 24 seconds
[1/19/2018 3:39:31 AM] [OSOL] Game exited, cleaning up...
WombatFromHell commented 6 years ago

The first part of that behavior is normal. OSOL should not launch the game unless DetectedCommandline exists when CommandlineProxy is enabled. The second part is bizarre. I didn't change any of the process detection behavior in ProcessLauncher(), so it shouldn't be having issues finding the game process named in GamePath.

I need to put together a better testing environment for this I think...

BarterClub commented 6 years ago

Ok. sound good let me know if you need anything.

WombatFromHell commented 6 years ago

Okay, after coming up with a better solution for testing CommandlineProxy without using an actual game process and launcher I think I have a working fix.

Give build v1.06j a try when you get a chance and if you have any issues just post the log file. I added some more helpful logging for process detection and argument proxying in this build. I also beefed up how resilient OSOL is to launchers being weird with their child processes.

BarterClub commented 6 years ago

Nice now it sees the token. So the issue now is after it gets it do i need to set it to false now or should it be true still. Also it skips the launcher now.

[1/19/2018 9:02:21 AM] [NOTE] OSOL is running as: OriginSteamOverlayLauncher
[1/19/2018 9:02:21 AM] [OSOL] Launching game with DetectedCommandline arguments, cmd: C:\Escape From Tarkov\EscapeFromTarkov.exe -bC5vLmcuaS5u=eyJlbWFpbCI6ImplZmZyZXlibaWwuY29tIiwicGFzTRkZjU4OTZlYTI3ZmM5MzEyMzI3NWQ2YiIsInRvZ2dsZSI6dHJ1ZX0= -token=104444 -popupwindow 
[1/19/2018 9:02:21 AM] [OSOL] Searching for valid process by name: EscapeFromTarkov
[1/19/2018 9:02:24 AM] [OSOL] Bound to a valid process at PID: 19100 [EscapeFromTarkov.exe] in 3 seconds
[1/19/2018 9:02:57 AM] [OSOL] The game exited, cleaning up...
WombatFromHell commented 6 years ago

As the wiki says, you just leave CommandlineProxy=True until you need to grab a new token. Then you clear the contents of DetectedCommandline and rerun OSOL.

The skipping of the launcher is intentional, otherwise the game would be relaunched every time you start it with OSOL defeating the purpose of copying the token. If you'd like me to make it an option I can probably do that. I just didn't really see the point since I can't use a game-centric (rather than launcher-centric) commandline token without hooking the game, which is a little beyond the scope of the OSOL project at this point in time.

WombatFromHell commented 6 years ago

I'll leave this issue ticket open until I push v1.07, so if you find other issues or bugs feel free to add them here.

BarterClub commented 6 years ago

So well this is embarrassing, but they decided that the game now has to be ran through the launcher. So everything now doesn't work.

So feel free if you want to do something or not.

WombatFromHell commented 6 years ago

Hmm.. so, if you launch the game with the token in the commandline it comes back and complains that the game has to be launched using the launcher? Is it possible it's just looking for the launcher running in the background, not necessarily that the game has to be running as a result of said launcher? If so, I could add an option to force the launcher to run in the background to workaround that.

I may post an updated build to see if that is in fact the case.

BarterClub commented 6 years ago

It closes the game. The devs said they made the change. Not sure why. Mostly thinking it has to do with cheats.

WombatFromHell commented 6 years ago

That's certainly a possibility. Hmm, I could make some changes to the launcher detection behavior, but if copying a token and relaunching doesn't work there's not much I can do that doesn't involve messing with memory hooks.

Either way, the token copying method also helps support for the Epic Games launcher.

BarterClub commented 6 years ago

Ok thats good. At least it wasn't wasted.

WombatFromHell commented 6 years ago

I went ahead and included a ForceLauncher INI option in release v1.06k in the event that other launchers demand being resident when the game is using CommandlineProxy, such as was discovered recently in Star Citizen (but also patched to require a manifest file updated upon launch).

WombatFromHell commented 6 years ago

Given that the additional functionality associated with this issue has been included in a released version of OSOL I will close this. If any additional information requires revisiting the CommandlineProxy functionality I'll gladly follow up on it.