-
-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launch game from the backend when processing launch protocol without sending a message to the frontend #4188
base: main
Are you sure you want to change the base?
Conversation
…sage to the frontend when launching with protocol
launch
ipcMain event instead of sending the launchGame message to the frontend when launching with protocol
The round trip actually had a reason: Prompting the user to update the game in case there is an update. It doesn't seem like this is happening now? |
The It doesn't have the same logic to ask about updates that we have when clicking the |
I think I had a fix for this somewhere, I don't know what I did with it lol. I guess as an alternative, we can run it in offline mode if there are updates available |
Maybe that can be a different PR? this one is just to not go to the frontend, currently we don't handle updates in that flow so this would keep the same behavior |
We've always had a weird/complicated flow to start a game when using the
heroic://launch
protocol: main.ts would call thehandleProtocol
function, that would eventually callsendFrontendMessage
, then the frontend would receive a message to launch the given game and that will trigger another call to the backend to then be handled byipcMain.on('launch', ...)
We can avoid all that extra work by calling the launch code directly from the backend.
I used this opportunity to extract the logic of the
launch
handler and put it intolauncher.ts
where it makes more sense, that helps removing imports and code frommain.ts
that is already too big and complicated.The
launchEventCallback
function is just the code frommain.ts
as a function, there's nothing to review in there cause it's literally the same code.This should speed things a biiiiiit when launching games with the protocol, but I doubt is significant.
<--- Put the description here --->
Use the following Checklist if you have changed something on the Backend or Frontend: