Skip to content
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 mods on leaving server #670

Open
Alystrasz opened this issue Feb 16, 2024 · 13 comments · May be fixed by #828
Open

Disable MAD mods on leaving server #670

Alystrasz opened this issue Feb 16, 2024 · 13 comments · May be fixed by #828

Comments

@Alystrasz
Copy link
Contributor

As we don't want MAD mods to conflict with other mods, mods that have been downloaded to join a server should be disabled after leaving said server.

@GeckoEidechse GeckoEidechse changed the title Disable MAD mods Disable MAD mods on server leave Feb 16, 2024
@GeckoEidechse GeckoEidechse changed the title Disable MAD mods on server leave Disable MAD mods on leaving server Feb 16, 2024
@ASpoonPlaysGames
Copy link
Contributor

In a similar vein as this: R2Northstar/NorthstarMods#263

Any mods that get enabled/disabled specifically to join a server should get reverted back to the state they were in after leaving the server.

Some pointers for implementation:

  • Can't just store this in UI vm, since uiscript_reset might get ran when enabling/disabling mods, so the data would be lost.
  • Launcher implementation is probably best, perhaps saving enabledmods state via a script call and then rolling back to the saved state later via a second script call

@RoyalBlue1
Copy link
Contributor

For implementation can't we enable/disable the mods according to the server without writing it to enabledmods and then on every server leave we load enabledmods again to reset to the previous state

@ASpoonPlaysGames
Copy link
Contributor

For implementation can't we enable/disable the mods according to the server without writing it to enabledmods and then on every server leave we load enabledmods again to reset to the previous state

Yeah that would work, could have "temporarily" enabled/disabled mods by doing that. However reloading mods on every server leave isn't great, we should check to make sure that there are currently some "temporarily" enabled/disabled mods first

@Alystrasz
Copy link
Contributor Author

For implementation can't we enable/disable the mods according to the server without writing it to enabledmods and then on every server leave we load enabledmods again to reset to the previous state

Can we really avoid using enabledmods here?
Maybe a server leave callback wouldn't be triggered if players rage quit the game during a match 😄

@Alystrasz
Copy link
Contributor Author

Launcher-side, is there any particular method (hook?) that is triggered on leaving a game?

@Sandwhiched
Copy link

Sandwhiched commented Aug 15, 2024

Is this what you're looking for? I think this might be it. So this is my first time collaborating on Northstar, so I'm not entirely sure how this works, but do you need a C++ function or a Squirrel function? I found this callback in the Respawn API (Squirrel).

void AddCallback_OnClientDisconnected( void functionref( entity player ) callbackFunc )

I'm assuming C++, I just don't know where to look, really.
If not, then we can create a function that disables MAD mods on leave by adding it as a callback function to this.
Again, I'm assuming we need a C++ function, but I haven't found one yet. Will continue to search.

We could also use Call() but I'm guessing that's not ideal. And I'm not sure how we'd provide a functionref anyway.

@Alystrasz
Copy link
Contributor Author

Is this what you're looking for? I think this might be it. So this is my first time collaborating on Northstar, so I'm not entirely sure how this works, but do you need a C++ function or a Squirrel function? I found this callback in the Respawn API (Squirrel).

void AddCallback_OnClientDisconnected( void functionref( entity player ) callbackFunc )

Thanks for taking a look!
Looks like AddCallback_OnClientDisconnected is a server-side function, and we're looking for a client-side function instead :/

@F1F7Y
Copy link
Member

F1F7Y commented Aug 27, 2024

Can we really avoid using enabledmods here?

Yes

Maybe a server leave callback wouldn't be triggered if players rage quit the game during a match 😄

Simply dont do anything on leave (apart from reloading mods) and only care about joining. If you dont touch enabledmods youll be a-okay.

@Alystrasz
Copy link
Contributor Author

Maybe a server leave callback wouldn't be triggered if players rage quit the game during a match 😄

Simply dont do anything on leave (apart from reloading mods) and only care about joining. If you dont touch enabledmods youll be a-okay.

That's what I ended up doing in #758.

@Sandwhiched
Copy link

Thanks for taking a look! Looks like AddCallback_OnClientDisconnected is a server-side function, and we're looking for a client-side function instead :/

Sorry, should have checked. Sorry for replying so late as well. I'm retiring and likely not coming back (emphasis on likely) because the vanilla (the only servers I played on, used Vanilla+) community have constantly been resolve-breakingly rude sometimes and I'm just drained of any motivation to continue playing or even develop mods/here. I could play on Northstar servers but again I'm just so drained. I might come back but it'll probably be a while.

@Sandwhiched
Copy link

Nah, I can't leave. I love this game too much. I was just really already mad yesterday and one guy in a match was just my final straw. This game's too good to abandon, and I was acting REALLY dramatic. Sorry :( I can look and try finding a server-side function, if that would help.

@Alystrasz
Copy link
Contributor Author

I can look and try finding a server-side function, if that would help.

Thanks for looking, but this issue should be solved once #758 is merged.

@Sandwhiched
Copy link

Got it! If you need any help let me know :D

@Alystrasz Alystrasz linked a pull request Nov 23, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
5 participants