Merge branch 'masterserverdualstack' into 'master'

Master Server API v1 URL change

See merge request STJr/SRB2!2226
This commit is contained in:
Logan Aerl Arias 2023-12-13 06:20:22 +00:00
commit 3cb384b10e

View file

@ -61,7 +61,7 @@ static CV_PossibleValue_t masterserver_update_rate_cons_t[] = {
{0,NULL} {0,NULL}
}; };
consvar_t cv_masterserver = CVAR_INIT ("masterserver", "https://mb.srb2.org/MS/0", CV_SAVE|CV_CALL, NULL, MasterServer_OnChange); consvar_t cv_masterserver = CVAR_INIT ("masterserver", "https://ds.ms.srb2.org/MS/0", CV_SAVE|CV_CALL, NULL, MasterServer_OnChange);
consvar_t cv_servername = CVAR_INIT ("servername", "SRB2 server", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, NULL, Update_parameters); consvar_t cv_servername = CVAR_INIT ("servername", "SRB2 server", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, NULL, Update_parameters);
consvar_t cv_masterserver_update_rate = CVAR_INIT ("masterserver_update_rate", "15", CV_SAVE|CV_CALL|CV_NOINIT, masterserver_update_rate_cons_t, Update_parameters); consvar_t cv_masterserver_update_rate = CVAR_INIT ("masterserver_update_rate", "15", CV_SAVE|CV_CALL|CV_NOINIT, masterserver_update_rate_cons_t, Update_parameters);
@ -544,6 +544,13 @@ static void MasterServer_OnChange(void)
CV_StealthSet(&cv_masterserver, cv_masterserver.defaultvalue); CV_StealthSet(&cv_masterserver, cv_masterserver.defaultvalue);
} }
if (
! cv_masterserver.changed &&
strcmp(cv_masterserver.string, "https://mb.srb2.org/MS/0") == 0
){
CV_StealthSet(&cv_masterserver, cv_masterserver.defaultvalue);
}
Set_api(cv_masterserver.string); Set_api(cv_masterserver.string);
if (Online()) if (Online())