Update mserv.c

https://mb.srb2.org is now behind CloudFlare, and the Master Server API v1 can not be accessed for some users due to this change. so I setup a new dual stack DNS record for accessing to the API
This commit is contained in:
LoganAir 2023-11-26 17:44:03 -05:00
parent 0309535be9
commit b5c8db00f8

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())