put saturn specific join allow stuff behind SATURNJOIN define

so it can be seperate from SATURNPAK
This commit is contained in:
Alug committed 2024-09-06 19:23:35 +02:00
1 parent 47dad991b9
commit dcb262f192
4 files changed
+19 -12

No files matched your search

+9 -8
View File
@@ -148,6 +148,9 @@ static boolean cl_redownloadinggamestate = false;
#ifdef SATURNPAK
boolean is_client_saturn[MAXNETNODES];
#endif
#ifdef SATURNJOIN
#define ISSATURN 69
#endif
@@ -1445,7 +1448,7 @@ static boolean CL_SendJoin(void)
netbuffer->u.clientcfg.subversion = SUBVERSION;
strncpy(netbuffer->u.clientcfg.application, SRB2APPLICATION,
sizeof netbuffer->u.clientcfg.application);
#ifdef SATURNPAK
#ifdef SATURNJOIN
netbuffer->u.clientcfg.issaturn = ISSATURN;
#endif
@@ -4056,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};
#ifdef SATURNPAK
#ifdef SATURNJOIN
consvar_t cv_allownewsaturnplayer = {"allowsaturnjoin", "On", CV_SAVE|CV_HIDEN, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif
@@ -4105,7 +4108,7 @@ static void Joinable_OnChange(void)
if (!server)
return;
#ifdef SATURNPAK
#ifdef SATURNJOIN
// 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");
@@ -4724,7 +4727,7 @@ static void HandleConnect(SINT8 node)
{
SV_SendRefuse(node, va(M_GetText("Different SRB2Kart versions cannot\nplay a netgame!\n(server version %d.%d)"), VERSION, SUBVERSION));
}
#ifdef SATURNPAK
#ifdef SATURNJOIN
else if ((!cv_allownewplayer.value && node && netbuffer->u.clientcfg.issaturn != ISSATURN) || (!cv_allownewsaturnplayer.value && node && netbuffer->u.clientcfg.issaturn == ISSATURN))
#else
else if (!cv_allownewplayer.value && node)
@@ -5096,7 +5099,6 @@ static void HandlePacketFromAwayNode(SINT8 node)
#ifdef SATURNPAK
SendSaturnInfo(node);
#endif
memset(playeringame, 0, sizeof(playeringame));
for (j = 0; j < MAXPLAYERS; j++)
{
@@ -6546,13 +6548,12 @@ void NetKeepAlive(void)
MasterClient_Ticker();
#endif
#ifdef HOLEPUNCH
#ifdef HOLEPUNCH
if (netgame && serverrunning)
{
RenewHolePunch();
}
#endif
#endif
if (client)
{
+2 -2
View File
@@ -371,7 +371,7 @@ typedef struct
UINT8 subversion; // Contains build version
UINT8 localplayers; // number of splitscreen players
UINT8 mode;
#ifdef SATURNPAK
#ifdef SATURNJOIN
UINT8 issaturn;
#endif
} ATTRPACK clientconfig_pak;
@@ -579,7 +579,7 @@ extern consvar_t
cv_joinnextround,
#endif
cv_netticbuffer, cv_allownewplayer,
#ifdef SATURNPAK
#ifdef SATURNJOIN
cv_allownewsaturnplayer,
#endif
cv_joinrefusemessage, cv_maxplayers, cv_resynchattempts, cv_resynchcooldown, cv_gamestateattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed;
+1 -1
View File
@@ -795,7 +795,7 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_httpsource);
#ifndef NONET
CV_RegisterVar(&cv_allownewplayer);
#ifdef SATURNPAK
#ifdef SATURNJOIN
CV_RegisterVar(&cv_allownewsaturnplayer);
#endif
CV_RegisterVar(&cv_joinrefusemessage);
+7 -1
View File
@@ -579,10 +579,16 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
// None of these that are disabled in the normal build are guaranteed to work perfectly
// Compile them at your own risk!
//-- SATURN __\\
/// Server detection for if a connecting client is on Saturn.
/// For stuff like extra synching, joinblock, etc.
/// For stuff like extra synching, etc.
//#define SATURNPAK
/// Detect if a client is on Saturn in the clientconfig.
/// To seperately allow them to join or block joining from vanilla clients.
//#define SATURNJOIN
//-- <( ̄︶ ̄)> __\\
/// Undefine to use the new method of Gamma correction see colour cube in v_video.c
#define BACKWARDSCOMPATCORRECTION