From 3f150fbe0548f0a9b29cf600e8f7027245be617a Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sat, 27 Feb 2021 00:37:15 -0500 Subject: [PATCH 1/6] If the join secret isn't ready right away, wait for the next update instead of trying to loop for it again immediately I believe this may be the cause of the invite crash some people have noticed in master, but I'm not sure, needs tested. --- src/discord.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/src/discord.c b/src/discord.c index 4f72b714a..db0ea344e 100644 --- a/src/discord.c +++ b/src/discord.c @@ -341,15 +341,14 @@ static void DRPC_GotServerIP(UINT32 address) { const unsigned char * p = (const unsigned char *)&address; sprintf(self_ip, "%u.%u.%u.%u:%u", p[0], p[1], p[2], p[3], current_port); - DRPC_UpdatePresence(); } /*-------------------------------------------------- static const char *DRPC_GetServerIP(void) Retrieves the IP address of the server that you're - connected to. Will attempt to use curl for getting your - own IP address, if it's not yours. + connected to. Will attempt to use STUN for getting your + own IP address. --------------------------------------------------*/ static const char *DRPC_GetServerIP(void) { @@ -442,6 +441,19 @@ void DRPC_UpdatePresence(void) // Server info if (netgame) { + if (cv_advertise.value) + { + discordPresence.state = "Public"; + } + else + { + discordPresence.state = "Private"; + } + + discordPresence.partyId = server_context; // Thanks, whoever gave us Mumble support, for implementing the EXACT thing Discord wanted for this field! + discordPresence.partySize = D_NumPlayers(); // Players in server + discordPresence.partyMax = discordInfo.maxPlayers; // Max players + if (DRPC_InvitesAreAllowed() == true) { const char *join; @@ -455,24 +467,7 @@ void DRPC_UpdatePresence(void) joinSecretSet = true; } - else - { - return; - } } - - if (cv_advertise.value) - { - discordPresence.state = "Public"; - } - else - { - discordPresence.state = "Private"; - } - - discordPresence.partyId = server_context; // Thanks, whoever gave us Mumble support, for implementing the EXACT thing Discord wanted for this field! - discordPresence.partySize = D_NumPlayers(); // Players in server - discordPresence.partyMax = discordInfo.maxPlayers; // Max players } else { From f01697bfdb80aff820201e523ebdfe4bc3e98cf3 Mon Sep 17 00:00:00 2001 From: Ashnal Date: Mon, 8 Mar 2021 00:48:15 -0500 Subject: [PATCH 2/6] Prevent the connection from being canceled when in Record Attack Fixes a crash that can happen when starting RA attempts if you press keys/buttons that would cancel a netgame connection --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index f4029ee08..9a3652ccf 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2468,7 +2468,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic key = I_GetKey(); // Only ESC and non-keyboard keys abort connection - if (key == KEY_ESCAPE || key >= KEY_MOUSE1 || cl_mode == CL_ABORTED) + if (!modeattacking && (key == KEY_ESCAPE || key >= KEY_MOUSE1 || cl_mode == CL_ABORTED)) { CONS_Printf(M_GetText("Network game synchronization aborted.\n")); D_QuitNetGame(); From dbf744845d4aa40fa6c039c9f84fbba92d94b740 Mon Sep 17 00:00:00 2001 From: Hannu Hanhi Date: Fri, 12 Mar 2021 18:52:58 +0200 Subject: [PATCH 3/6] Fix unnecessary texture reloads on respawn in opengl by removing unneeded V_SetPalette calls --- src/st_stuff.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 9d7269982..33394a819 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -232,7 +232,7 @@ void ST_doPaletteStuff(void) { st_palette = palette; - if (rendermode != render_none) + if (rendermode == render_soft) { //V_SetPaletteLump(GetPalette()); // Reset the palette -- is this needed? if (!splitscreen) @@ -392,7 +392,10 @@ static inline void ST_Stop(void) if (st_stopped) return; - V_SetPalette(0); +#ifdef HWRENDER + if (rendermode != render_opengl) +#endif + V_SetPalette(0); st_stopped = true; } From 6573904ec5b4d1ce368fc56eeb0d88d87e94284b Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Thu, 11 Mar 2021 15:03:30 -0500 Subject: [PATCH 4/6] Fuck the gamma shortcut, replace it with a fullscreen toggle --- src/m_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 480c887b6..15a619871 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2691,8 +2691,8 @@ boolean M_Responder(event_t *ev) M_QuitSRB2(0); return true; - case KEY_F11: // Gamma Level - CV_AddValue(&cv_usegamma, 1); + case KEY_F11: // Fullscreen + CV_AddValue(&cv_fullscreen, 1); return true; // Spymode on F12 handled in game logic From d7e86422366e861f3849700edf8565b368704992 Mon Sep 17 00:00:00 2001 From: JugadorXEI Date: Tue, 13 Apr 2021 00:33:06 +0200 Subject: [PATCH 5/6] Discord Invite Fixes + DUMPCONSISTENCY flag for makefile --- src/Makefile | 4 ++++ src/discord.c | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index da96f0cf1..6ea7fd787 100644 --- a/src/Makefile +++ b/src/Makefile @@ -515,6 +515,10 @@ ifdef ZDEBUG CPPFLAGS+=-DZDEBUG endif +ifdef DUMPCONSISTENCY + CPPFLAGS+=-DDUMPCONSISTENCY +endif + ifdef DEVELOP CPPFLAGS+=-DDEVELOP endif diff --git a/src/discord.c b/src/discord.c index db0ea344e..e6eabf9a3 100644 --- a/src/discord.c +++ b/src/discord.c @@ -361,7 +361,7 @@ static const char *DRPC_GetServerIP(void) { // We're not the server, so we could successfully get the IP! // No need to do anything else :) - sprintf(self_ip, "%s:%u", address, current_port); + strcpy(self_ip, address); return self_ip; } } @@ -461,10 +461,7 @@ void DRPC_UpdatePresence(void) // Grab the host's IP for joining. if ((join = DRPC_GetServerIP()) != NULL) { - char *xorjoin = DRPC_XORIPString(join); - discordPresence.joinSecret = xorjoin; - free(xorjoin); - + discordPresence.joinSecret = DRPC_XORIPString(join); joinSecretSet = true; } } From ea56bd472c1426ad1f4f6835f3ca365bc9f22f1d Mon Sep 17 00:00:00 2001 From: JugadorXEI Date: Tue, 13 Apr 2021 06:56:14 +0200 Subject: [PATCH 6/6] Simply return address, don't allow self_ip to be possibly written as something else --- src/discord.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/discord.c b/src/discord.c index e6eabf9a3..ba68da72d 100644 --- a/src/discord.c +++ b/src/discord.c @@ -361,8 +361,7 @@ static const char *DRPC_GetServerIP(void) { // We're not the server, so we could successfully get the IP! // No need to do anything else :) - strcpy(self_ip, address); - return self_ip; + return address; } }