NorthstarLauncher icon indicating copy to clipboard operation
NorthstarLauncher copied to clipboard

Disable MAD on vanilla

Open itscynxx opened this issue 1 year ago • 17 comments

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. and Mod 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 issues

No idea if this can be done better, just looked at what Spoon did for the master server auth and put it here

itscynxx avatar Jan 12 '24 00:01 itscynxx

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

itscynxx avatar Jan 12 '24 16:01 itscynxx

Could someone explaining why the format check fails?

You have some trailing whitespace in an empty line

ASpoonPlaysGames avatar Jan 12 '24 16:01 ASpoonPlaysGames

Could someone explaining why the format check fails?

You have some trailing whitespace in an empty line

Or at least that's what format check is saying image

ASpoonPlaysGames avatar Jan 12 '24 16:01 ASpoonPlaysGames

Could someone explaining why the format check fails?

You have some trailing whitespace in an empty line

That did it, thanks

itscynxx avatar Jan 12 '24 16:01 itscynxx

What's the exact procedure to launch vanilla through Northstar and have access to logs?

Alystrasz avatar Jan 13 '24 16:01 Alystrasz

What's the exact procedure to launch vanilla through Northstar and have access to logs?

launch northstar with the -vanilla launch arg

ASpoonPlaysGames avatar Jan 13 '24 16:01 ASpoonPlaysGames

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?

GeckoEidechse avatar Jan 15 '24 00:01 GeckoEidechse

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? Not sure if just calling DownloadMod does all of it or not and it's kinda late to be thinking here lol

itscynxx avatar Jan 15 '24 05:01 itscynxx

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?

The various SQ functions should have checks added to ensure that they don't do this.

ASpoonPlaysGames avatar Jan 15 '24 10:01 ASpoonPlaysGames

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.

catornot avatar Jan 15 '24 16:01 catornot

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

ASpoonPlaysGames avatar Jan 15 '24 17:01 ASpoonPlaysGames

Me too, got any easy way of testing it? Not sure if just calling DownloadMod does all of it or not and it's kinda late to be thinking here lol

I believe calling DownloadMod would straight up crash the client, which is better than downloading anything I guess

Alystrasz avatar May 16 '24 17:05 Alystrasz

With #751 merged, is this still relevant?

GeckoEidechse avatar Aug 13 '24 13:08 GeckoEidechse

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

ASpoonPlaysGames avatar Aug 15 '24 10:08 ASpoonPlaysGames

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.

GeckoEidechse avatar Aug 15 '24 10:08 GeckoEidechse

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

ASpoonPlaysGames avatar Aug 15 '24 10:08 ASpoonPlaysGames

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.

GeckoEidechse avatar Aug 19 '24 15:08 GeckoEidechse