-
Notifications
You must be signed in to change notification settings - Fork 126
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
Disable MAD on vanilla #636
base: main
Are you sure you want to change the base?
Conversation
Can't test right now, on my laptop, might need to make a pr to my fork or the actual repo to test it because my local files seem to get 800+ errors when trying to build...
Could someone explaining why the format check fails? as far as I'm aware I do the same thing as done here: https://github.com/R2Northstar/NorthstarLauncher/blob/main/primedev/masterserver/masterserver.cpp#L605 unless this is some tabs vs spaces thing ig |
You have some trailing whitespace in an empty line |
That did it, thanks |
What's the exact procedure to launch vanilla through Northstar and have access to logs? |
launch northstar with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR confirmed working in testing, g_pModDownloader
isn't initialized on vanilla plus, effectively removing related messages.
Without PR
[2024-01-14] [00:08:31] [NORTHSTAR] [info] Enabling hook Status_ConMsg
[2024-01-14] [00:08:31] [NORTHSTAR] [info] Enabling hook CClientState_ProcessPrint
[2024-01-14] [00:08:31] [NORTHSTAR] [info] Registering Convar spewlog_enable
[2024-01-14] [00:08:31] [NORTHSTAR] [info] Mod downloader initialized
[2024-01-14] [00:08:31] [NORTHSTAR] [info] Custom verified mods URL not found in command line arguments, using default URL.
[2024-01-14] [00:08:31] [NORTHSTAR] [info] Enabling hook OpenExternalWebBrowser
[2024-01-14] [00:08:31] [NORTHSTAR] [info] Registering Convar ns_prefer_datatable_from_disk
With PR
[2024-01-14] [00:12:52] [NORTHSTAR] [info] Enabling hook Status_ConMsg
[2024-01-14] [00:12:52] [NORTHSTAR] [info] Enabling hook CClientState_ProcessPrint
[2024-01-14] [00:12:52] [NORTHSTAR] [info] Registering Convar spewlog_enable
[2024-01-14] [00:12:52] [NORTHSTAR] [info] Enabling hook OpenExternalWebBrowser
[2024-01-14] [00:12:52] [NORTHSTAR] [info] Registering Convar ns_prefer_datatable_from_disk
I'm kinda curious what would happen if MAD were to be called in vanilla (e.g. via some mod). Just null pointer deref and crash ig? |
Me too, got any easy way of testing it? |
The various SQ functions should have checks added to ensure that they don't do this. |
It would be better if they wouldn't even get registered at all if MAD is disabled. |
True, but that's more complex, and ADD_SQFUNC doesn't support it |
I believe calling |
With #751 merged, is this still relevant? |
The error message is probably gone now, but if we are in vanilla mode it's probably better to just never instantiate the mod downloader? Would be worth checking the codebase for things that grab the static instance and make sure that they check for vanilla compatibility first as well |
Yeah, if we avoid loading MAD on vanilla then we also need to check that the uninstantiated object is never loaded cause otherwise it's gonna crash on reading random uninitialised memory. |
This is why just grabbing static things blindly is bad |
Putting into draft so that I know what to focus on and as per discussion this PR is blocked by the lack of checks that we do not access the uninitialised object. @itscynxx if you (or anyone else) disagrees, feel free to undraft it as is or leave a comment for me to undraft and we can take another look. |
Simply adds a check for the
ON_DLL_LOAD
that runs the mod auto download code for if vanilla compatibility is enabled.Although it would never run on vanilla, some people are confused by the
Custom verified mods URL not found in command line arguments, using default URL.
andMod downloader initialized
added in logs when loading mod auto download, and, from testing, doesn't break anything to disable in this way. I was able to play a match of vanilla and a match of northstar without issuesNo idea if this can be done better, just looked at what Spoon did for the master server auth and put it here