iceball
iceball copied to clipboard
Rewrite initialization code
Re-starting the application via execv
destroys any connection that external programs have with the process (debuggers, steam overlay etc.).
AFAICT the current initialization process goes like this:
- main
- Lua (launcher)
- Launcher calls
execv
with different args - main
- Lua (game)
To get it to one continous process we would need a way to tear down the launcher code and start up game code. Should this be a hardcoded function? eg. ib_connect_server(ip, port)
Main reason for execv is because from a security standpoint it's easier to just dump everything and start again from a clean slate.
I'll be blunt and say this issue isn't something I would be willing to attempt, but if you want to have a go at it, feel free.
If anything, it'll make the steam overlay behave for those who like the overlay.
Ensuring all setup/teardown is done in one place, that shouldn't be an issue, since reinitialisation should follow the same code path as the original initialisation did, so anything we don't clean wouldn't have been setup in the first place (although any static variables could catch you out I guess). The main problem I see with this is that you'd be deep in the call stack when you want to reset, and you need to get back out of there.