substrant / starlight

Roblox multitool. Custom Roblox launcher and bootstrapper.
BSD 3-Clause "New" or "Revised" License
13 stars 1 forks source link

Firefox Ignores Scheme Hook #4

Closed RadNotRed closed 2 years ago

RadNotRed commented 2 years ago

Not sure if I'm doing something wrong but I ran

Starlight.Cli.exe hook --fps-cap 0 then Starlight.Cli.exe launch and I get this

C:\Users\rad\Downloads\binaries_win32>Starlight.Cli.exe launch
Launching...

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Starlight.Scheme.ParseRaw(String payload)
   at Starlight.Scheme.Parse(String rawArgs)
   at Starlight.Scheme.Launch(String args, IStarlightLaunchParams extras)
   at Starlight.Cli.Program.<Launch>d__4.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Starlight.Cli.Program.<>c.<Main>b__9_2(LaunchOptions x)
   at CommandLine.ParserResultExtensions.MapResult[T1,T2,T3,T4,T5,T6,TResult](ParserResult`1 result, Func`2 parsedFunc1, Func`2 parsedFunc2, Func`2 parsedFunc3, Func`2 parsedFunc4, Func`2 parsedFunc5, Func`2 parsedFunc6, Func`2 notParsedFunc)
   at Starlight.Cli.Program.Main(String[] args)
reversed-coffee commented 2 years ago

You can't launch directly from the launcher unless you provide a payload. Starlight is intended to be used to hook and it'll launch when you join Roblox from your web browser. Let me know if launching from the browser works.

RadNotRed commented 2 years ago

I tried launching, i got an error, couldn't take a screenshot.

reversed-coffee commented 2 years ago

Okay, does launching fail whenever there are no hook options?

RadNotRed commented 2 years ago

image I have my browser to do this, it pops open a cmd and just disappears.

I ran Starlight.Cli.exe hook with no extra options, does the same thing

RadNotRed commented 2 years ago

quick video https://user-images.githubusercontent.com/80015713/193429175-01e049ed-a2dc-4211-b0ef-1a2a5e2957ee.mp4

reversed-coffee commented 2 years ago

I can't get that video to play on my phone. I'm away from my computer at the moment. I'll catch up on this issue later today.

It seems that your launch parameters may be different and because of that the application can't parse them correctly.

If you could, open your inspect element prompt on Roblox and click network. When you launch the game, a roblox-player payload should pop up. Show me the full contents of that link, but remove or blur the gameinfo part because that holds your account's authentication token.

RadNotRed commented 2 years ago

image

roblox-player:1+launchmode:play+gameinfo:i think i remove this part+launchtime:1664660802001+placelauncherurl:https%3A%2F%2Fassetgame.roblox.com%2Fgame%2FPlaceLauncher.ashx%3Frequest%3DRequestGame%26browserTrackerId%3D147694612347%26placeId%3D9872472334%26isPlayTogetherGame%3Dfalse+browsertrackerid:147694612347+robloxLocale:en_us+gameLocale:en_us+channel:+LaunchExp:InApp
Referrer Policy: strict-origin-when-cross-origin

I think this is what you're looking for, hopefully blurred the right things

reversed-coffee commented 2 years ago

I think I know what the problem is. You have a parameter channel with an empty string as the value. I skip to the next object to get the value, but I can't skip because there's only one element that it split from. I can apply a patch for this later today.

RadNotRed commented 2 years ago

Sounds good, thank you

RadNotRed commented 2 years ago

Just to note, when i do launch -p then paste that, it installs roblox and then launches fine, just not through browser for some reason

RadNotRed commented 2 years ago

Nevermind, it no longer launches, it worked once, but now it just shows me as playing on roblox, but not actually launching the game for a short period of time when I launch with cmd

reversed-coffee commented 2 years ago

Nevermind, it no longer launches, it worked once, but now it just shows me as playing on roblox, but not actually launching the game for a short period of time when I launch with cmd

That's expected behavior since Roblox invalidates that token every time you join a new game.

It seems that your launch parameters may be different and because of that the application can't parse them correctly.\

I looked into the issue and I was wrong here. This is out of context. There is no issue with that code.

This seems to be an issue with Firefox because Starlight works fine with Chrome-based browsers. I made a quick test project to print the command line results out when you explicitly select an application from Firefox to see what was happening. It seems to not be respecting the registry key whatsoever. This is not a problem with Starlight, rather with Firefox, albeit I should implement a fix for this regardless.

image

You can fix this by changing your default application to "Always ask", then selecting Starlight.Cli instead of Starlight.Cli.exe in the prompt.

image image

I came up with a temporary fix for this with a batch file. I will implement a built-in fix for this issue later, so you may want to watch this repository for any new releases with a proper fix. Create a batch file in Starlight's folder, and call it "Starlight.FirefoxWrapper.bat". Put this in it:

cd %~dp0
Starlight.Cli.exe launch --fps-cap 0 -p %1

You can add options like --fps-cap if you want extra settings. It'd work just like the hook command but you'll have to manually update it for now. You will then need to set it as your default application in Firefox. Firefox doesn't directly support batch files but you can enter the full path to the batch file to make it work. After that, the launcher should work fine. Here's a video of me doing it if you don't know how to.

The simplest solution is to just use a browser like Brave or Chrome which doesn't have this issue until I come up with a fix for it. I'll keep the issue open until I push a fix for this issue.

RadNotRed commented 2 years ago

I actually got that token off of chrome, ill try your fix real quick

RadNotRed commented 2 years ago

Works, I appreciate it!

reversed-coffee commented 2 years ago

Yep, no problem. Going to keep this issue open until I implement a fix.

reversed-coffee commented 2 years ago

Version v1.0.0 now includes a launcher binary that should mitigate the issue.