Merge branch '14-expedited' into 'master'

Expedited 1.4+ fixes

See merge request KartKrew/Kart!649
This commit is contained in:
Sal 2022-08-24 23:10:47 +00:00
commit 66aa976cc2
6 changed files with 25 additions and 31 deletions

View file

@ -2029,6 +2029,7 @@ void CV_AddValue(consvar_t *var, INT32 increment)
if (var->PossibleValue[max].value == var->value) if (var->PossibleValue[max].value == var->value)
currentindice = max; currentindice = max;
// The following options will NOT handle netsyncing.
if (var == &cv_chooseskin) if (var == &cv_chooseskin)
{ {
// Special case for the chooseskin variable, used only directly from the menu // Special case for the chooseskin variable, used only directly from the menu
@ -2080,28 +2081,7 @@ void CV_AddValue(consvar_t *var, INT32 increment)
} }
else if (var == &cv_kartspeed) else if (var == &cv_kartspeed)
{ {
INT32 maxspeed = (M_SecretUnlocked(SECRET_HARDSPEED) ? 2 : 1); max = (M_SecretUnlocked(SECRET_HARDSPEED) ? 3 : 2);
// Special case for the kartspeed variable, used only directly from the menu to prevent selecting hard mode
if (increment > 0) // Going up!
{
newvalue = var->value + 1;
if (newvalue > maxspeed)
newvalue = -1;
var->value = newvalue;
var->string = var->PossibleValue[var->value].strvalue;
var->func();
return;
}
else if (increment < 0) // Going down!
{
newvalue = var->value - 1;
if (newvalue < -1)
newvalue = maxspeed;
var->value = newvalue;
var->string = var->PossibleValue[var->value].strvalue;
var->func();
return;
}
} }
#ifdef PARANOIA #ifdef PARANOIA
if (currentindice == -1) if (currentindice == -1)

View file

@ -3235,7 +3235,7 @@ void D_QuitNetGame(void)
if (nodeingame[i]) if (nodeingame[i])
HSendPacket(i, true, 0, 0); HSendPacket(i, true, 0, 0);
#ifdef MASTERSERVER #ifdef MASTERSERVER
if (serverrunning && cv_advertise.value) if (serverrunning && netgame && cv_advertise.value) // see mserv.c Online()
UnregisterServer(); UnregisterServer();
#endif #endif
} }

View file

@ -21,6 +21,7 @@ Documentation available here.
#include "doomdef.h" #include "doomdef.h"
#include "d_clisrv.h" #include "d_clisrv.h"
#include "command.h" #include "command.h"
#include "console.h"
#include "m_argv.h" #include "m_argv.h"
#include "m_menu.h" #include "m_menu.h"
#include "mserv.h" #include "mserv.h"
@ -81,6 +82,19 @@ Contact_error (void)
); );
} }
static void
Printf_url (const char *url)
{
boolean startup;
I_lock_mutex(&con_mutex);
startup = con_startup;
I_unlock_mutex(con_mutex);
(startup ? I_OutputMsg : CONS_Printf)(
"HMS: connecting '%s'...\n", url);
}
static size_t static size_t
HMS_on_read (char *s, size_t _1, size_t n, void *userdata) HMS_on_read (char *s, size_t _1, size_t n, void *userdata)
{ {
@ -180,7 +194,7 @@ HMS_connect (const char *format, ...)
if (quack_token) if (quack_token)
sprintf(&url[seek], "&token=%s", quack_token); sprintf(&url[seek], "&token=%s", quack_token);
CONS_Printf("HMS: connecting '%s'...\n", url); Printf_url(url);
buffer = malloc(sizeof *buffer); buffer = malloc(sizeof *buffer);
buffer->curl = curl; buffer->curl = curl;

View file

@ -595,13 +595,13 @@ static boolean SOCK_Get(void)
#ifdef USE_STUN #ifdef USE_STUN
if (STUN_got_response(doomcom->data, c)) if (STUN_got_response(doomcom->data, c))
{ {
return false; break;
} }
#endif #endif
if (hole_punch(c)) if (hole_punch(c))
{ {
return false; break;
} }
// find remote node number // find remote node number

View file

@ -70,7 +70,7 @@ static CV_PossibleValue_t masterserver_update_rate_cons_t[] = {
}; };
consvar_t cv_masterserver = CVAR_INIT ("masterserver", "https://ms.kartkrew.org/ms/api", CV_SAVE|CV_CALL, NULL, MasterServer_OnChange); consvar_t cv_masterserver = CVAR_INIT ("masterserver", "https://ms.kartkrew.org/ms/api", CV_SAVE|CV_CALL, NULL, MasterServer_OnChange);
consvar_t cv_rendezvousserver = CVAR_INIT ("rendezvousserver", "relay.kartkrew.org", CV_SAVE|CV_CALL, NULL, RendezvousServer_OnChange); consvar_t cv_rendezvousserver = CVAR_INIT ("holepunchserver", "relay.kartkrew.org", CV_SAVE|CV_CALL, NULL, RendezvousServer_OnChange);
consvar_t cv_servername = CVAR_INIT ("servername", "Ring Racers server", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Update_parameters); consvar_t cv_servername = CVAR_INIT ("servername", "Ring Racers server", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Update_parameters);
consvar_t cv_server_contact = CVAR_INIT ("server_contact", "", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Update_parameters); consvar_t cv_server_contact = CVAR_INIT ("server_contact", "", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Update_parameters);
@ -434,7 +434,7 @@ void UnregisterServer(void)
static boolean static boolean
Online (void) Online (void)
{ {
return ( serverrunning && cv_advertise.value ); return ( serverrunning && netgame && cv_advertise.value );
} }
static inline void SendPingToMasterServer(void) static inline void SendPingToMasterServer(void)
@ -532,7 +532,7 @@ Advertise_OnChange(void)
if (cv_advertise.value) if (cv_advertise.value)
{ {
if (serverrunning) if (serverrunning && netgame)
{ {
Lock_state(); Lock_state();
{ {

View file

@ -1343,8 +1343,8 @@ void V_DrawVhsEffect(boolean rewind)
if (rewind) if (rewind)
V_DrawVhsEffect(false); // experimentation V_DrawVhsEffect(false); // experimentation
upbary -= vid.dupy * (rewind ? 3 : 1.8f); upbary -= FixedMul(vid.dupy * (rewind ? 3 : 1.8f), renderdeltatics);
downbary += vid.dupy * (rewind ? 2 : 1); downbary += FixedMul(vid.dupy * (rewind ? 2 : 1), renderdeltatics);
if (upbary < -barsize) upbary = vid.height; if (upbary < -barsize) upbary = vid.height;
if (downbary > vid.height) downbary = -barsize; if (downbary > vid.height) downbary = -barsize;