NorthstarLauncher icon indicating copy to clipboard operation
NorthstarLauncher copied to clipboard

Remove FCVAR_SERVER_CAN_EXECUTE from `disconnect`

Open ASpoonPlaysGames opened this issue 1 year ago • 9 comments

Servers should use the NSDisconnectPlayer script function instead. (clients can just ignore the disconnect command, it's more a suggestion)

Closes #553

ASpoonPlaysGames avatar Feb 11 '24 12:02 ASpoonPlaysGames

To be clear, do clients already ignore disconnect?

How is it handled in regards to vanilla? Like what happens if you run this PR in vanilla?

GeckoEidechse avatar Feb 11 '24 16:02 GeckoEidechse

To be clear, do clients already ignore disconnect?

Normal clients do not ignore disconnect, but a malicious one very much could. Therefore using disconnect to disconnect a client is a bad idea and we shouldn't allow for it. The purpose of disconnect is for a client to disconnect themselves from a server.

How is it handled in regards to vanilla? Like what happens if you run this PR in vanilla?

Nothing, this is reverting disconnect back to vanilla behaviour. Vanilla doesn't expect disconnect to be called by servers because they could just choose to ignore it, vanilla uses other native functions to properly disconnect a client.

ASpoonPlaysGames avatar Feb 11 '24 16:02 ASpoonPlaysGames

To be clear, do clients already ignore disconnect?

Normal clients do not ignore disconnect, but a malicious one very much could. Therefore using disconnect to disconnect a client is a bad idea and we shouldn't allow for it. The purpose of disconnect is for a client to disconnect themselves from a server.

Aight, thanks for the clarification <3

The only thing I need to keep in mind then in that regard is to give modders a heads-up in case they somehow made a server-mod that sends disconnect to client.

Man I wish I already had a system in place to crawl Thunderstore mods for this sorta stuff ^^"

GeckoEidechse avatar Feb 11 '24 19:02 GeckoEidechse

The only thing I need to keep in mind then in that regard is to give modders a heads-up in case they somehow made a server-mod that sends disconnect to client.

I think when we added NSDisconnectPlayer we did a similar notification already tbh

ASpoonPlaysGames avatar Feb 14 '24 18:02 ASpoonPlaysGames

So I got around writing a quick Thunderstore scraper and based on my local dataset, the following mods at their latest version will be affected

  • Zanieon-Matchmaking_Mixtape_Menu-1.2.0
  • SoftSleeper-Attrition_Extended_Overhaul-1.2.11
  • VoyageDB_Modding_Home-Attrition_Extended-1.9.3
  • NanohmProtogen-VanillaPlus-2.4.1
  • VoyageDB_Modding_Home-Grunt_Mode-3.3.2
  • VoyageDB_Modding_Home-Nessie_Temp_Fix-1.3.16
  • The_Peepeepoopoo_man-Titanframework-2.4.2
  • Okudai-loeb-1.0.1
  • Capt_Diqhedd-GoMortyYourself-1.0.1
  • VoyageDB_Modding_Home-Modded_Bleedout_Game-1.0.3
  • VoyageDB_Modding_Home-The_Spawner_English-1.2.0
  • VoyageDB_Modding_Home-The_Spawner_English-1.2.0
  • taskinoz-EnhancedMenuMod-1.14.0
  • zxcPandora-DeveloperMode-1.0.1
  • EladNLG-RoguelikeBETA-0.3.102
  • EladNLG-Roguelike-0.3.102

checked by running:

$ find thunderstore -type f -exec grep -l '"disconnect[ "]' {} +
thunderstore/Zanieon-Matchmaking_Mixtape_Menu-1.2.0/mods/MixtapeMenu/mod/scripts/vscripts/ui/menu_lobby.nut
thunderstore/SoftSleeper-Attrition_Extended_Overhaul-1.2.11/mods/ATTExtendOverhaul/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/VoyageDB_Modding_Home-Attrition_Extended-1.9.3/mods/AITdmExtended/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/NanohmProtogen-VanillaPlus-2.4.1/mods/NP.VanillaPlus/mod/scripts/vscripts/ui/menu_lobby.nut
thunderstore/VoyageDB_Modding_Home-Grunt_Mode-3.3.2/mods/GruntModeNS/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/VoyageDB_Modding_Home-Nessie_Temp_Fix-1.3.16/mods/NessieTempFix/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/The_Peepeepoopoo_man-Titanframework-2.4.2/mods/peepee.Titanframework/mod/scripts/vscripts/sh_loadouts.nut
thunderstore/Okudai-loeb-1.0.1/mods/okudai.loeb/mod/scripts/vscripts/ui/menu_lobby.nut
thunderstore/Capt_Diqhedd-GoMortyYourself-1.0.1/mods/Diq.GoMortyYourself/mod/scripts/vscripts/cl_mortyyourself.gnut
thunderstore/VoyageDB_Modding_Home-Modded_Bleedout_Game-1.0.3/mods/Modded.Bleedout/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/VoyageDB_Modding_Home-The_Spawner_English-1.2.0/mods/Super.Mixed.Game.English/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/VoyageDB_Modding_Home-The_Spawner_English-1.2.0/mods/Super.Mixed.Game.English/mod/scripts/vscripts/sh_loadouts.nut
thunderstore/taskinoz-EnhancedMenuMod-1.14.0/mods/Enhanced.Menu.Mod.Northstar/mod/scripts/vscripts/sp/sp_training.nut
thunderstore/zxcPandora-DeveloperMode-1.0.1/mods/DeveloperMode/mod/scripts/vscripts/sh_loadouts.nut
thunderstore/EladNLG-RoguelikeBETA-0.3.102/mods/EladNLG.Roguelike/mod/scripts/vscripts/sp/_savegame.gnut
thunderstore/EladNLG-Roguelike-0.3.102/mods/EladNLG.Roguelike/mod/scripts/vscripts/sp/_savegame.gnut

GeckoEidechse avatar Feb 15 '24 23:02 GeckoEidechse

What would you say is the best way to proceed? Ping mod authors and release PR as part of minor release?

GeckoEidechse avatar Feb 15 '24 23:02 GeckoEidechse

So I got around writing a quick Thunderstore scraper and based on my local dataset, the following mods at their latest version will be affected

  • Zanieon-Matchmaking_Mixtape_Menu-1.2.0
  • SoftSleeper-Attrition_Extended_Overhaul-1.2.11
  • VoyageDB_Modding_Home-Attrition_Extended-1.9.3
  • NanohmProtogen-VanillaPlus-2.4.1
  • VoyageDB_Modding_Home-Grunt_Mode-3.3.2
  • VoyageDB_Modding_Home-Nessie_Temp_Fix-1.3.16
  • The_Peepeepoopoo_man-Titanframework-2.4.2
  • Okudai-loeb-1.0.1
  • Capt_Diqhedd-GoMortyYourself-1.0.1
  • VoyageDB_Modding_Home-Modded_Bleedout_Game-1.0.3
  • VoyageDB_Modding_Home-The_Spawner_English-1.2.0
  • VoyageDB_Modding_Home-The_Spawner_English-1.2.0
  • taskinoz-EnhancedMenuMod-1.14.0
  • zxcPandora-DeveloperMode-1.0.1
  • EladNLG-RoguelikeBETA-0.3.102
  • EladNLG-Roguelike-0.3.102

Note that only mods that do this on server are affected by this, which reduces this count quite a lot.

ASpoonPlaysGames avatar Feb 16 '24 08:02 ASpoonPlaysGames

Note that only mods that do this on server are affected by this, which reduces this count quite a lot.

Good point. I manually looked through the mods a bit and this is what I ended up with:

Client
thunderstore/Zanieon-Matchmaking_Mixtape_Menu-1.2.0/mods/MixtapeMenu/mod/scripts/vscripts/ui/menu_lobby.nut
thunderstore/NanohmProtogen-VanillaPlus-2.4.1/mods/NP.VanillaPlus/mod/scripts/vscripts/ui/menu_lobby.nut
thunderstore/Okudai-loeb-1.0.1/mods/okudai.loeb/mod/scripts/vscripts/ui/menu_lobby.nut
thunderstore/Capt_Diqhedd-GoMortyYourself-1.0.1/mods/Diq.GoMortyYourself/mod/scripts/vscripts/cl_mortyyourself.gnut


Server
thunderstore/SoftSleeper-Attrition_Extended_Overhaul-1.2.11/mods/ATTExtendOverhaul/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/VoyageDB_Modding_Home-Attrition_Extended-1.9.3/mods/AITdmExtended/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/VoyageDB_Modding_Home-Grunt_Mode-3.3.2/mods/GruntModeNS/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/VoyageDB_Modding_Home-Nessie_Temp_Fix-1.3.16/mods/NessieTempFix/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/The_Peepeepoopoo_man-Titanframework-2.4.2/mods/peepee.Titanframework/mod/scripts/vscripts/sh_loadouts.nut	
thunderstore/VoyageDB_Modding_Home-Modded_Bleedout_Game-1.0.3/mods/Modded.Bleedout/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/VoyageDB_Modding_Home-The_Spawner_English-1.2.0/mods/Super.Mixed.Game.English/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut
thunderstore/VoyageDB_Modding_Home-The_Spawner_English-1.2.0/mods/Super.Mixed.Game.English/mod/scripts/vscripts/sh_loadouts.nut
thunderstore/zxcPandora-DeveloperMode-1.0.1/mods/DeveloperMode/mod/scripts/vscripts/sh_loadouts.nut


No clue
thunderstore/taskinoz-EnhancedMenuMod-1.14.0/mods/Enhanced.Menu.Mod.Northstar/mod/scripts/vscripts/sp/sp_training.nut
thunderstore/EladNLG-RoguelikeBETA-0.3.102/mods/EladNLG.Roguelike/mod/scripts/vscripts/sp/_savegame.gnut
thunderstore/EladNLG-Roguelike-0.3.102/mods/EladNLG.Roguelike/mod/scripts/vscripts/sp/_savegame.gnut

Looking at it further the majority of the server sided mods that call disconnect do so cause they modify existing Northstar scripts

  • https://github.com/R2Northstar/NorthstarMods/blob/343051c9014207f8785d2194a52ec2f082657ca2/Northstar.Custom/mod/scripts/vscripts/burnmeter/sh_burnmeter.gnut#L210
  • https://github.com/R2Northstar/NorthstarMods/blob/343051c9014207f8785d2194a52ec2f082657ca2/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut#L1512
  • https://github.com/R2Northstar/NorthstarMods/blob/343051c9014207f8785d2194a52ec2f082657ca2/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut#L1522

From the look of it, they are called on server but I might be mistaken.

If they are, I guess we'd have to update the corresponding mod code as well ^^"

GeckoEidechse avatar Feb 21 '24 12:02 GeckoEidechse

Not a lot that we can do about the mods that override these files. Lets be honest, they aren't going to get updated. But yeah https://github.com/R2Northstar/NorthstarMods/pull/841 fixes the cases in Northstar.

ASpoonPlaysGames avatar Aug 22 '24 12:08 ASpoonPlaysGames