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
This commit is contained in:
Alug committed 2024-07-23 17:45:27 +02:00
1 parent 4b71d9a48d
commit 17dbe77cd3
2 files changed
+19 -15

No files matched your search

+7 -1
View File
@@ -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);
+12 -14
View File
@@ -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.",