Emscripten: compile without MASTERSERVER support

This commit is contained in:
Alam Ed Arias 2025-03-30 14:43:27 -04:00
parent 67f1fd0670
commit e2c8d314d2
2 changed files with 9 additions and 10 deletions

View file

@ -733,7 +733,7 @@ extern int
/// Maintain compatibility with older 2.2 demos
#define OLD22DEMOCOMPAT
#ifdef HAVE_CURL
#if defined (HAVE_CURL) && !(defined(__EMSCRIPTEN__) && !defined(__EMSCRIPTEN_PTHREADS__))
#define MASTERSERVER
#else
#undef UPDATE_ALERT

View file

@ -389,7 +389,6 @@ Change_masterserver_thread (char *api)
void RegisterServer(void)
{
#ifdef MASTERSERVER
if (I_can_thread())
{
void *nsid = New_server_id();
@ -406,7 +405,6 @@ void RegisterServer(void)
{
Finish_registration();
}
#endif/*MASTERSERVER*/
}
static void UpdateServer(void)
@ -431,7 +429,6 @@ static void UpdateServer(void)
void UnregisterServer(void)
{
#ifdef MASTERSERVER
if (I_can_thread())
{
if (!I_spawn_thread(
@ -447,11 +444,9 @@ void UnregisterServer(void)
{
Finish_unlist();
}
#endif/*MASTERSERVER*/
}
static boolean
Online (void)
static boolean Online(void)
{
return ( serverrunning && cv_masterserver_room_id.value > 0 );
}
@ -485,9 +480,7 @@ static inline void SendPingToMasterServer(void)
void MasterClient_Ticker(void)
{
#ifdef MASTERSERVER
SendPingToMasterServer();
#endif
}
static void
@ -510,8 +503,12 @@ Set_api (const char *api)
HMS_set_api(dapi);
}
}
#else /*MASTERSERVER*/
#endif/*MASTERSERVER*/
void RegisterServer(void) {}
void UnregisterServer(void) {}
#endif
static boolean ServerName_CanChange(const char* newvalue)
{
@ -554,7 +551,9 @@ static void RoomId_OnChange(void)
{
UnregisterServer();
ms_RoomId = cv_masterserver_room_id.value;
#ifdef MASTERSERVER
if (Online())
#endif
RegisterServer();
}
}