From 17dbe77cd3aefdbabef15e89aad087b7c4e9d173 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 23 Jul 2024 17:45:00 +0200 Subject: [PATCH] allowjoin now sets saturnjoin to its value use CV_StealthSet to prevent its only for scripts pretty much so no need to toggle it seperately --- src/d_clisrv.c | 8 +++++++- src/m_menu.c | 26 ++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index dbf2228e6..9df6dba66 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4059,7 +4059,7 @@ consvar_t cv_joinrefusemessage = {"joinrefusemessage", "The server is not accept consvar_t cv_allownewplayer = {"allowjoin", "On", CV_SAVE|CV_CALL, CV_OnOff, Joinable_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_allownewsaturnplayer = {"allowsaturnjoin", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_allownewsaturnplayer = {"allowsaturnjoin", "On", CV_SAVE|CV_HIDEN, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #ifdef VANILLAJOINNEXTROUND consvar_t cv_joinnextround = {"joinnextround", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done @@ -4106,6 +4106,12 @@ static void Joinable_OnChange(void) if (!server) return; + // disabling joins should also disable saturn joins unless its called with CV_StealthSet and vice versa to make life a bit easier + if (!cv_allownewplayer.value) + CV_Set(&cv_allownewsaturnplayer, "Off"); + else if (cv_allownewplayer.value) + CV_Set(&cv_allownewsaturnplayer, "On"); + maxplayer = (UINT8)(min((dedicated ? MAXPLAYERS-1 : MAXPLAYERS), cv_maxplayers.value)); WRITEUINT8(p, maxplayer); diff --git a/src/m_menu.c b/src/m_menu.c index 6d5d78c20..d88653b51 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1861,23 +1861,22 @@ static menuitem_t OP_ServerOptionsMenu[] = { #ifndef NONET {IT_STRING | IT_CVAR | IT_CV_STRING, - NULL, "Server Name", &cv_servername, 10}, + NULL, "Server Name", &cv_servername, 10}, #endif - {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 40}, - {IT_STRING | IT_CVAR, NULL, "Map Progression", &cv_advancemap, 50}, - {IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 60}, - {IT_STRING | IT_CVAR, NULL, "Voting Rule Changes", &cv_kartvoterulechanges, 70}, + {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 40}, + {IT_STRING | IT_CVAR, NULL, "Map Progression", &cv_advancemap, 50}, + {IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 60}, + {IT_STRING | IT_CVAR, NULL, "Voting Rule Changes", &cv_kartvoterulechanges, 70}, #ifndef NONET - {IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90}, - {IT_STRING | IT_CVAR, NULL, "Allow Vanilla Players to Join", &cv_allownewplayer, 100}, - {IT_STRING | IT_CVAR, NULL, "Allow Saturn Players to Join", &cv_allownewsaturnplayer,110}, - {IT_STRING | IT_CVAR, NULL, "Allow Addon Downloading", &cv_downloading, 120}, - {IT_STRING | IT_CVAR, NULL, "Pause Permission", &cv_pause, 130}, - {IT_STRING | IT_CVAR, NULL, "Mute All Chat", &cv_mute, 140}, + {IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90}, + {IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 100}, + {IT_STRING | IT_CVAR, NULL, "Allow Addon Downloading", &cv_downloading, 110}, + {IT_STRING | IT_CVAR, NULL, "Pause Permission", &cv_pause, 120}, + {IT_STRING | IT_CVAR, NULL, "Mute All Chat", &cv_mute, 130}, - {IT_SUBMENU|IT_STRING, NULL, "Advanced Options...", &OP_AdvServerOptionsDef, 160}, + {IT_SUBMENU|IT_STRING, NULL, "Advanced Options...", &OP_AdvServerOptionsDef,150}, #endif }; @@ -1892,8 +1891,7 @@ static const char* OP_ServerOptionsTooltips[] = "How often should other gamemodes appear.", #ifndef NONET "Max amount of players allowed in this server.", - "Allow Vanilla players to join this server.", - "Allow Saturn players to join this server.", + "Allow players to join this server.", "Allow players to download addons.", "Who has permission to pause the server?", "Completely mute in game chat.",