Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2 into replace-purefat
This commit is contained in:
commit
4509cd3798
|
@ -43,7 +43,7 @@ jobs:
|
||||||
- v1-SRB2-APT
|
- v1-SRB2-APT
|
||||||
- run:
|
- run:
|
||||||
name: Install SDK
|
name: Install SDK
|
||||||
command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client
|
command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v1-SRB2-APT
|
key: v1-SRB2-APT
|
||||||
|
@ -71,4 +71,4 @@ jobs:
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }}
|
key: v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }}
|
||||||
paths:
|
paths:
|
||||||
- /root/.ccache
|
- /root/.ccache
|
||||||
|
|
78
src/Makefile
78
src/Makefile
|
@ -56,10 +56,10 @@
|
||||||
# Compile with GCC 4.6x version, add 'GCC46=1'
|
# Compile with GCC 4.6x version, add 'GCC46=1'
|
||||||
# Compile a profile version, add 'PROFILEMODE=1'
|
# Compile a profile version, add 'PROFILEMODE=1'
|
||||||
# Compile a debug version, add 'DEBUGMODE=1'
|
# Compile a debug version, add 'DEBUGMODE=1'
|
||||||
# Compile with extra warnings, add 'WARNINGMODE=1'
|
# Compile with less warnings, add 'RELAXWARNINGS=1'
|
||||||
|
# Generate compiler errors for most compiler warnings, add 'ERRORMODE=1'
|
||||||
# Compile without NASM's tmap.nas, add 'NOASM=1'
|
# Compile without NASM's tmap.nas, add 'NOASM=1'
|
||||||
# Compile without 3D hardware support, add 'NOHW=1'
|
# Compile without 3D hardware support, add 'NOHW=1'
|
||||||
# Compile without 3D sound support, add 'NOHS=1'
|
|
||||||
# Compile with GDBstubs, add 'RDB=1'
|
# Compile with GDBstubs, add 'RDB=1'
|
||||||
# Compile without PNG, add 'NOPNG=1'
|
# Compile without PNG, add 'NOPNG=1'
|
||||||
# Compile without zlib, add 'NOZLIB=1'
|
# Compile without zlib, add 'NOZLIB=1'
|
||||||
|
@ -80,6 +80,58 @@
|
||||||
#
|
#
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
|
ALL_SYSTEMS=\
|
||||||
|
PANDORA\
|
||||||
|
LINUX64\
|
||||||
|
MINGW64\
|
||||||
|
HAIKU\
|
||||||
|
DUMMY\
|
||||||
|
DJGPPDOS\
|
||||||
|
MINGW\
|
||||||
|
UNIX\
|
||||||
|
LINUX\
|
||||||
|
SOLARIS\
|
||||||
|
FREEBSD\
|
||||||
|
MACOSX\
|
||||||
|
SDL\
|
||||||
|
|
||||||
|
# check for user specified system
|
||||||
|
ifeq (,$(filter $(ALL_SYSTEMS),$(.VARIABLES)))
|
||||||
|
ifeq ($(OS),Windows_NT) # all windows are Windows_NT...
|
||||||
|
|
||||||
|
$(info Detected a Windows system, compiling for 32-bit MinGW SDL2...)
|
||||||
|
|
||||||
|
# go for a 32-bit sdl mingw exe by default
|
||||||
|
MINGW=1
|
||||||
|
SDL=1
|
||||||
|
WINDOWSHELL=1
|
||||||
|
|
||||||
|
else # if you on the *nix
|
||||||
|
|
||||||
|
system:=$(shell uname -s)
|
||||||
|
|
||||||
|
ifeq ($(system),Linux)
|
||||||
|
new_system=LINUX
|
||||||
|
else
|
||||||
|
|
||||||
|
$(error \
|
||||||
|
Could not automatically detect your system,\
|
||||||
|
try specifying a system manually)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(shell getconf LONG_BIT),64)
|
||||||
|
system+=64-bit
|
||||||
|
new_system:=$(new_system)64
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(info Detected $(system) ($(new_system))...)
|
||||||
|
$(new_system)=1
|
||||||
|
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
# SRB2 data files
|
# SRB2 data files
|
||||||
D_DIR?=../bin/Resources
|
D_DIR?=../bin/Resources
|
||||||
D_FILES=$(D_DIR)/srb2.pk3 \
|
D_FILES=$(D_DIR)/srb2.pk3 \
|
||||||
|
@ -119,7 +171,6 @@ NOPNG=1
|
||||||
NOZLIB=1
|
NOZLIB=1
|
||||||
NONET=1
|
NONET=1
|
||||||
NOHW=1
|
NOHW=1
|
||||||
NOHS=1
|
|
||||||
NOASM=1
|
NOASM=1
|
||||||
NOIPX=1
|
NOIPX=1
|
||||||
EXENAME?=srb2dummy
|
EXENAME?=srb2dummy
|
||||||
|
@ -141,7 +192,6 @@ endif
|
||||||
ifdef PANDORA
|
ifdef PANDORA
|
||||||
NONX86=1
|
NONX86=1
|
||||||
NOHW=1
|
NOHW=1
|
||||||
NOHS=1
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef NOOPENMPT
|
ifndef NOOPENMPT
|
||||||
|
@ -223,13 +273,6 @@ else
|
||||||
$(OBJDIR)/hw_md2load.o $(OBJDIR)/hw_md3load.o $(OBJDIR)/hw_model.o $(OBJDIR)/u_list.o $(OBJDIR)/hw_batching.o
|
$(OBJDIR)/hw_md2load.o $(OBJDIR)/hw_md3load.o $(OBJDIR)/hw_model.o $(OBJDIR)/u_list.o $(OBJDIR)/hw_batching.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef NOHS
|
|
||||||
OPTS+=-DNOHS
|
|
||||||
else
|
|
||||||
OPTS+=-DHW3SOUND
|
|
||||||
OBJS+=$(OBJDIR)/hw3sound.o
|
|
||||||
endif
|
|
||||||
|
|
||||||
OPTS += -DCOMPVERSION
|
OPTS += -DCOMPVERSION
|
||||||
|
|
||||||
ifndef NONX86
|
ifndef NONX86
|
||||||
|
@ -750,19 +793,6 @@ $(OBJDIR)/ogl_win.o: hardware/r_opengl/ogl_win.c hardware/r_opengl/r_opengl.h \
|
||||||
$(CC) $(CFLAGS) $(WFLAGS) -D_WINDOWS -mwindows -c $< -o $@
|
$(CC) $(CFLAGS) $(WFLAGS) -D_WINDOWS -mwindows -c $< -o $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef NOHS
|
|
||||||
$(OBJDIR)/s_ds3d.o: hardware/s_ds3d/s_ds3d.c hardware/hw3dsdrv.h \
|
|
||||||
hardware/hw_dll.h
|
|
||||||
$(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_ds3d.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_ds3d/s_ds3d.c
|
|
||||||
|
|
||||||
$(OBJDIR)/s_fmod.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \
|
|
||||||
hardware/hw_dll.h
|
|
||||||
$(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_fmod.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_fmod/s_fmod.c
|
|
||||||
|
|
||||||
$(OBJDIR)/s_openal.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \
|
|
||||||
hardware/hw_dll.h
|
|
||||||
$(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_openal.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_openal/s_openal.c
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,9 @@ endif
|
||||||
|
|
||||||
# Automatically set version flag, but not if one was manually set
|
# Automatically set version flag, but not if one was manually set
|
||||||
ifeq (,$(filter GCC%,$(.VARIABLES)))
|
ifeq (,$(filter GCC%,$(.VARIABLES)))
|
||||||
ifneq (,$(findstring gcc,$(shell $(CC) --version))) # if it's GCC
|
version:=$(shell $(CC) --version)
|
||||||
|
# check if this is in fact GCC
|
||||||
|
ifneq (,$(or $(findstring gcc,$(version)),$(findstring GCC,$(version))))
|
||||||
version:=$(shell $(CC) -dumpversion)
|
version:=$(shell $(CC) -dumpversion)
|
||||||
|
|
||||||
# Turn version into words of major, minor
|
# Turn version into words of major, minor
|
||||||
|
@ -208,10 +210,7 @@ WFLAGS=-Wall
|
||||||
ifndef GCC295
|
ifndef GCC295
|
||||||
#WFLAGS+=-Wno-packed
|
#WFLAGS+=-Wno-packed
|
||||||
endif
|
endif
|
||||||
ifdef ERRORMODE
|
ifndef RELAXWARNINGS
|
||||||
WARNINGMODE=1
|
|
||||||
endif
|
|
||||||
ifdef WARNINGMODE
|
|
||||||
WFLAGS+=-W
|
WFLAGS+=-W
|
||||||
#WFLAGS+=-Wno-sign-compare
|
#WFLAGS+=-Wno-sign-compare
|
||||||
ifndef GCC295
|
ifndef GCC295
|
||||||
|
|
|
@ -2306,7 +2306,7 @@ static void SL_InsertServer(serverinfo_pak* info, SINT8 node)
|
||||||
M_SortServerList();
|
M_SortServerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#if defined (MASTERSERVER) && defined (HAVE_THREADS)
|
||||||
struct Fetch_servers_ctx
|
struct Fetch_servers_ctx
|
||||||
{
|
{
|
||||||
int room;
|
int room;
|
||||||
|
@ -2351,7 +2351,7 @@ Fetch_servers_thread (struct Fetch_servers_ctx *ctx)
|
||||||
|
|
||||||
free(ctx);
|
free(ctx);
|
||||||
}
|
}
|
||||||
#endif/*HAVE_THREADS*/
|
#endif/*defined (MASTERSERVER) && defined (HAVE_THREADS)*/
|
||||||
|
|
||||||
void CL_QueryServerList (msg_server_t *server_list)
|
void CL_QueryServerList (msg_server_t *server_list)
|
||||||
{
|
{
|
||||||
|
@ -2388,9 +2388,8 @@ void CL_QueryServerList (msg_server_t *server_list)
|
||||||
|
|
||||||
void CL_UpdateServerList(boolean internetsearch, INT32 room)
|
void CL_UpdateServerList(boolean internetsearch, INT32 room)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_THREADS
|
(void)internetsearch;
|
||||||
struct Fetch_servers_ctx *ctx;
|
(void)room;
|
||||||
#endif
|
|
||||||
|
|
||||||
SL_ClearServerList(0);
|
SL_ClearServerList(0);
|
||||||
|
|
||||||
|
@ -2407,9 +2406,12 @@ void CL_UpdateServerList(boolean internetsearch, INT32 room)
|
||||||
if (netgame)
|
if (netgame)
|
||||||
SendAskInfo(BROADCASTADDR);
|
SendAskInfo(BROADCASTADDR);
|
||||||
|
|
||||||
|
#ifdef MASTERSERVER
|
||||||
if (internetsearch)
|
if (internetsearch)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
|
struct Fetch_servers_ctx *ctx;
|
||||||
|
|
||||||
ctx = malloc(sizeof *ctx);
|
ctx = malloc(sizeof *ctx);
|
||||||
|
|
||||||
/* This called from M_Refresh so I don't use a mutex */
|
/* This called from M_Refresh so I don't use a mutex */
|
||||||
|
@ -2436,6 +2438,7 @@ void CL_UpdateServerList(boolean internetsearch, INT32 room)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif/*MASTERSERVER*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ifndef NONET
|
#endif // ifndef NONET
|
||||||
|
@ -2563,7 +2566,6 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||||
*asksent = I_GetTime();
|
*asksent = I_GetTime();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
(void)viams;
|
|
||||||
(void)asksent;
|
(void)asksent;
|
||||||
// No netgames, so we skip this state.
|
// No netgames, so we skip this state.
|
||||||
cl_mode = CL_ASKJOIN;
|
cl_mode = CL_ASKJOIN;
|
||||||
|
@ -3840,8 +3842,10 @@ void D_QuitNetGame(void)
|
||||||
for (i = 0; i < MAXNETNODES; i++)
|
for (i = 0; i < MAXNETNODES; i++)
|
||||||
if (nodeingame[i])
|
if (nodeingame[i])
|
||||||
HSendPacket(i, true, 0, 0);
|
HSendPacket(i, true, 0, 0);
|
||||||
|
#ifdef MASTERSERVER
|
||||||
if (serverrunning && ms_RoomId > 0)
|
if (serverrunning && ms_RoomId > 0)
|
||||||
UnregisterServer();
|
UnregisterServer();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (servernode > 0 && servernode < MAXNETNODES && nodeingame[(UINT8)servernode])
|
else if (servernode > 0 && servernode < MAXNETNODES && nodeingame[(UINT8)servernode])
|
||||||
{
|
{
|
||||||
|
@ -4105,8 +4109,10 @@ boolean SV_SpawnServer(void)
|
||||||
if (netgame && I_NetOpenSocket)
|
if (netgame && I_NetOpenSocket)
|
||||||
{
|
{
|
||||||
I_NetOpenSocket();
|
I_NetOpenSocket();
|
||||||
|
#ifdef MASTERSERVER
|
||||||
if (ms_RoomId > 0)
|
if (ms_RoomId > 0)
|
||||||
RegisterServer();
|
RegisterServer();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// non dedicated server just connect to itself
|
// non dedicated server just connect to itself
|
||||||
|
@ -5568,7 +5574,9 @@ void NetUpdate(void)
|
||||||
// client send the command after a receive of the server
|
// client send the command after a receive of the server
|
||||||
// the server send before because in single player is beter
|
// the server send before because in single player is beter
|
||||||
|
|
||||||
|
#ifdef MASTERSERVER
|
||||||
MasterClient_Ticker(); // Acking the Master Server
|
MasterClient_Ticker(); // Acking the Master Server
|
||||||
|
#endif
|
||||||
|
|
||||||
if (client)
|
if (client)
|
||||||
{
|
{
|
||||||
|
|
|
@ -648,6 +648,7 @@ static void D_Display(void)
|
||||||
V_DrawThinString(80, 40, V_MONOSPACE | V_BLUEMAP, s);
|
V_DrawThinString(80, 40, V_MONOSPACE | V_BLUEMAP, s);
|
||||||
if (rendermode == render_opengl) // OpenGL specific stats
|
if (rendermode == render_opengl) // OpenGL specific stats
|
||||||
{
|
{
|
||||||
|
#ifdef HWRENDER
|
||||||
snprintf(s, sizeof s - 1, "nsrt %d", rs_hw_nodesorttime / divisor);
|
snprintf(s, sizeof s - 1, "nsrt %d", rs_hw_nodesorttime / divisor);
|
||||||
V_DrawThinString(30, 40, V_MONOSPACE | V_YELLOWMAP, s);
|
V_DrawThinString(30, 40, V_MONOSPACE | V_YELLOWMAP, s);
|
||||||
snprintf(s, sizeof s - 1, "ndrw %d", rs_hw_nodedrawtime / divisor);
|
snprintf(s, sizeof s - 1, "ndrw %d", rs_hw_nodedrawtime / divisor);
|
||||||
|
@ -680,6 +681,7 @@ static void D_Display(void)
|
||||||
snprintf(s, sizeof s - 1, "ncol %d", rs_hw_numcolors);
|
snprintf(s, sizeof s - 1, "ncol %d", rs_hw_numcolors);
|
||||||
V_DrawThinString(185, 30, V_MONOSPACE | V_PURPLEMAP, s);
|
V_DrawThinString(185, 30, V_MONOSPACE | V_PURPLEMAP, s);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else // software specific stats
|
else // software specific stats
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
// Use Mixer interface?
|
// Use Mixer interface?
|
||||||
#ifdef HAVE_MIXER
|
#ifdef HAVE_MIXER
|
||||||
#define SOUND SOUND_MIXER
|
#define SOUND SOUND_MIXER
|
||||||
#define NOHS // No HW3SOUND
|
|
||||||
#ifdef HW3SOUND
|
#ifdef HW3SOUND
|
||||||
#undef HW3SOUND
|
#undef HW3SOUND
|
||||||
#endif
|
#endif
|
||||||
|
@ -45,7 +44,6 @@
|
||||||
// Use FMOD?
|
// Use FMOD?
|
||||||
#ifdef HAVE_FMOD
|
#ifdef HAVE_FMOD
|
||||||
#define SOUND SOUND_FMOD
|
#define SOUND SOUND_FMOD
|
||||||
#define NOHS // No HW3SOUND
|
|
||||||
#ifdef HW3SOUND
|
#ifdef HW3SOUND
|
||||||
#undef HW3SOUND
|
#undef HW3SOUND
|
||||||
#endif
|
#endif
|
||||||
|
@ -62,10 +60,6 @@
|
||||||
#if !defined (HWRENDER) && !defined (NOHW)
|
#if !defined (HWRENDER) && !defined (NOHW)
|
||||||
#define HWRENDER
|
#define HWRENDER
|
||||||
#endif
|
#endif
|
||||||
// judgecutor: 3D sound support
|
|
||||||
#if !defined(HW3SOUND) && !defined (NOHS)
|
|
||||||
#define HW3SOUND
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -644,4 +638,10 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||||
/// Maintain compatibility with older 2.2 demos
|
/// Maintain compatibility with older 2.2 demos
|
||||||
#define OLD22DEMOCOMPAT
|
#define OLD22DEMOCOMPAT
|
||||||
|
|
||||||
|
#if defined (HAVE_CURL) && ! defined (NONET)
|
||||||
|
#define MASTERSERVER
|
||||||
|
#else
|
||||||
|
#undef UPDATE_ALERT
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // __DOOMDEF__
|
#endif // __DOOMDEF__
|
||||||
|
|
|
@ -14,7 +14,9 @@ Documentation available here.
|
||||||
<http://mb.srb2.org/MS/tools/api/v1/>
|
<http://mb.srb2.org/MS/tools/api/v1/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CURL
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
#include "d_clisrv.h"
|
#include "d_clisrv.h"
|
||||||
|
@ -49,6 +51,8 @@ consvar_t cv_masterserver_token = {
|
||||||
NULL, 0, NULL, NULL, 0, 0, NULL/* C90 moment */
|
NULL, 0, NULL, NULL, 0, 0, NULL/* C90 moment */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef MASTERSERVER
|
||||||
|
|
||||||
static int hms_started;
|
static int hms_started;
|
||||||
|
|
||||||
static char *hms_api;
|
static char *hms_api;
|
||||||
|
@ -664,10 +668,14 @@ HMS_set_api (char *api)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif/*MASTERSERVER*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
MasterServer_Debug_OnChange (void)
|
MasterServer_Debug_OnChange (void)
|
||||||
{
|
{
|
||||||
|
#ifdef MASTERSERVER
|
||||||
/* TODO: change to 'latest-log.txt' for log files revision. */
|
/* TODO: change to 'latest-log.txt' for log files revision. */
|
||||||
if (cv_masterserver_debug.value)
|
if (cv_masterserver_debug.value)
|
||||||
CONS_Printf("Master server debug messages will appear in log.txt\n");
|
CONS_Printf("Master server debug messages will appear in log.txt\n");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
27
src/m_menu.c
27
src/m_menu.c
|
@ -3842,7 +3842,7 @@ void M_SetupNextMenu(menu_t *menudef)
|
||||||
{
|
{
|
||||||
INT16 i;
|
INT16 i;
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#if defined (MASTERSERVER) && defined (HAVE_THREADS)
|
||||||
if (currentMenu == &MP_RoomDef || currentMenu == &MP_ConnectDef)
|
if (currentMenu == &MP_RoomDef || currentMenu == &MP_ConnectDef)
|
||||||
{
|
{
|
||||||
I_lock_mutex(&ms_QueryId_mutex);
|
I_lock_mutex(&ms_QueryId_mutex);
|
||||||
|
@ -3930,7 +3930,7 @@ void M_Ticker(void)
|
||||||
if (currentMenu == &OP_ScreenshotOptionsDef)
|
if (currentMenu == &OP_ScreenshotOptionsDef)
|
||||||
M_SetupScreenshotMenu();
|
M_SetupScreenshotMenu();
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#if defined (MASTERSERVER) && defined (HAVE_THREADS)
|
||||||
I_lock_mutex(&ms_ServerList_mutex);
|
I_lock_mutex(&ms_ServerList_mutex);
|
||||||
{
|
{
|
||||||
if (ms_ServerList)
|
if (ms_ServerList)
|
||||||
|
@ -11194,8 +11194,9 @@ static boolean M_CheckMODVersion(int id)
|
||||||
} else
|
} else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif/*UPDATE_ALERT*/
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#if defined (MASTERSERVER) && defined (HAVE_THREADS)
|
||||||
static void
|
static void
|
||||||
Check_new_version_thread (int *id)
|
Check_new_version_thread (int *id)
|
||||||
{
|
{
|
||||||
|
@ -11204,7 +11205,9 @@ Check_new_version_thread (int *id)
|
||||||
|
|
||||||
okay = 0;
|
okay = 0;
|
||||||
|
|
||||||
|
#ifdef UPDATE_ALERT
|
||||||
if (M_CheckMODVersion(*id))
|
if (M_CheckMODVersion(*id))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
I_lock_mutex(&ms_QueryId_mutex);
|
I_lock_mutex(&ms_QueryId_mutex);
|
||||||
{
|
{
|
||||||
|
@ -11248,8 +11251,7 @@ Check_new_version_thread (int *id)
|
||||||
|
|
||||||
free(id);
|
free(id);
|
||||||
}
|
}
|
||||||
#endif/*HAVE_THREADS*/
|
#endif/*defined (MASTERSERVER) && defined (HAVE_THREADS)*/
|
||||||
#endif/*UPDATE_ALERT*/
|
|
||||||
|
|
||||||
static void M_ConnectMenu(INT32 choice)
|
static void M_ConnectMenu(INT32 choice)
|
||||||
{
|
{
|
||||||
|
@ -11290,7 +11292,7 @@ UINT32 roomIds[NUM_LIST_ROOMS];
|
||||||
static void M_RoomMenu(INT32 choice)
|
static void M_RoomMenu(INT32 choice)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
#ifdef HAVE_THREADS
|
#if defined (MASTERSERVER) && defined (HAVE_THREADS)
|
||||||
int *id;
|
int *id;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -11312,9 +11314,14 @@ static void M_RoomMenu(INT32 choice)
|
||||||
MP_RoomDef.prevMenu = currentMenu;
|
MP_RoomDef.prevMenu = currentMenu;
|
||||||
M_SetupNextMenu(&MP_RoomDef);
|
M_SetupNextMenu(&MP_RoomDef);
|
||||||
|
|
||||||
#ifdef UPDATE_ALERT
|
#ifdef MASTERSERVER
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
|
#ifdef UPDATE_ALERT
|
||||||
m_waiting_mode = M_WAITING_VERSION;
|
m_waiting_mode = M_WAITING_VERSION;
|
||||||
|
#else/*UPDATE_ALERT*/
|
||||||
|
m_waiting_mode = M_WAITING_ROOMS;
|
||||||
|
#endif/*UPDATE_ALERT*/
|
||||||
|
|
||||||
MP_RoomMenu[0].text = "";
|
MP_RoomMenu[0].text = "";
|
||||||
|
|
||||||
id = malloc(sizeof *id);
|
id = malloc(sizeof *id);
|
||||||
|
@ -11328,17 +11335,19 @@ static void M_RoomMenu(INT32 choice)
|
||||||
I_spawn_thread("check-new-version",
|
I_spawn_thread("check-new-version",
|
||||||
(I_thread_fn)Check_new_version_thread, id);
|
(I_thread_fn)Check_new_version_thread, id);
|
||||||
#else/*HAVE_THREADS*/
|
#else/*HAVE_THREADS*/
|
||||||
|
#ifdef UPDATE_ALERT
|
||||||
if (M_CheckMODVersion(0))
|
if (M_CheckMODVersion(0))
|
||||||
|
#endif/*UPDATE_ALERT*/
|
||||||
{
|
{
|
||||||
GetRoomsList(currentMenu->prevMenu == &MP_ServerDef, 0);
|
GetRoomsList(currentMenu->prevMenu == &MP_ServerDef, 0);
|
||||||
}
|
}
|
||||||
#endif/*HAVE_THREADS*/
|
#endif/*HAVE_THREADS*/
|
||||||
#endif/*UPDATE_ALERT*/
|
#endif/*MASTERSERVER*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_ChooseRoom(INT32 choice)
|
static void M_ChooseRoom(INT32 choice)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_THREADS
|
#if defined (MASTERSERVER) && defined (HAVE_THREADS)
|
||||||
I_lock_mutex(&ms_QueryId_mutex);
|
I_lock_mutex(&ms_QueryId_mutex);
|
||||||
{
|
{
|
||||||
ms_QueryId++;
|
ms_QueryId++;
|
||||||
|
|
67
src/mserv.c
67
src/mserv.c
|
@ -23,6 +23,8 @@
|
||||||
#include "m_menu.h"
|
#include "m_menu.h"
|
||||||
#include "z_zone.h"
|
#include "z_zone.h"
|
||||||
|
|
||||||
|
#ifdef MASTERSERVER
|
||||||
|
|
||||||
static int MSId;
|
static int MSId;
|
||||||
static int MSRegisteredId = -1;
|
static int MSRegisteredId = -1;
|
||||||
|
|
||||||
|
@ -43,17 +45,20 @@ static I_cond MSCond;
|
||||||
# define Unlock_state()
|
# define Unlock_state()
|
||||||
#endif/*HAVE_THREADS*/
|
#endif/*HAVE_THREADS*/
|
||||||
|
|
||||||
static void Update_parameters (void);
|
|
||||||
|
|
||||||
#ifndef NONET
|
#ifndef NONET
|
||||||
static void Command_Listserv_f(void);
|
static void Command_Listserv_f(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif/*MASTERSERVER*/
|
||||||
|
|
||||||
|
static void Update_parameters (void);
|
||||||
|
|
||||||
static void MasterServer_OnChange(void);
|
static void MasterServer_OnChange(void);
|
||||||
|
|
||||||
static CV_PossibleValue_t masterserver_update_rate_cons_t[] = {
|
static CV_PossibleValue_t masterserver_update_rate_cons_t[] = {
|
||||||
{2, "MIN"},
|
{2, "MIN"},
|
||||||
{60, "MAX"},
|
{60, "MAX"},
|
||||||
{0}
|
{0,NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
consvar_t cv_masterserver = {"masterserver", "https://mb.srb2.org/MS/0", CV_SAVE|CV_CALL, NULL, MasterServer_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_masterserver = {"masterserver", "https://mb.srb2.org/MS/0", CV_SAVE|CV_CALL, NULL, MasterServer_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
@ -63,7 +68,7 @@ consvar_t cv_masterserver_update_rate = {"masterserver_update_rate", "15", CV_SA
|
||||||
|
|
||||||
INT16 ms_RoomId = -1;
|
INT16 ms_RoomId = -1;
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#if defined (MASTERSERVER) && defined (HAVE_THREADS)
|
||||||
int ms_QueryId;
|
int ms_QueryId;
|
||||||
I_mutex ms_QueryId_mutex;
|
I_mutex ms_QueryId_mutex;
|
||||||
|
|
||||||
|
@ -91,10 +96,14 @@ void AddMServCommands(void)
|
||||||
CV_RegisterVar(&cv_masterserver_debug);
|
CV_RegisterVar(&cv_masterserver_debug);
|
||||||
CV_RegisterVar(&cv_masterserver_token);
|
CV_RegisterVar(&cv_masterserver_token);
|
||||||
CV_RegisterVar(&cv_servername);
|
CV_RegisterVar(&cv_servername);
|
||||||
|
#ifdef MASTERSERVER
|
||||||
COM_AddCommand("listserv", Command_Listserv_f);
|
COM_AddCommand("listserv", Command_Listserv_f);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MASTERSERVER
|
||||||
|
|
||||||
static void WarnGUI (void)
|
static void WarnGUI (void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
|
@ -395,6 +404,7 @@ Change_masterserver_thread (char *api)
|
||||||
|
|
||||||
void RegisterServer(void)
|
void RegisterServer(void)
|
||||||
{
|
{
|
||||||
|
#ifdef MASTERSERVER
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
I_spawn_thread(
|
I_spawn_thread(
|
||||||
"register-server",
|
"register-server",
|
||||||
|
@ -404,6 +414,7 @@ void RegisterServer(void)
|
||||||
#else
|
#else
|
||||||
Finish_registration();
|
Finish_registration();
|
||||||
#endif
|
#endif
|
||||||
|
#endif/*MASTERSERVER*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static void UpdateServer(void)
|
static void UpdateServer(void)
|
||||||
|
@ -421,6 +432,7 @@ static void UpdateServer(void)
|
||||||
|
|
||||||
void UnregisterServer(void)
|
void UnregisterServer(void)
|
||||||
{
|
{
|
||||||
|
#ifdef MASTERSERVER
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
I_spawn_thread(
|
I_spawn_thread(
|
||||||
"unlist-server",
|
"unlist-server",
|
||||||
|
@ -430,6 +442,7 @@ void UnregisterServer(void)
|
||||||
#else
|
#else
|
||||||
Finish_unlist();
|
Finish_unlist();
|
||||||
#endif
|
#endif
|
||||||
|
#endif/*MASTERSERVER*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean
|
static boolean
|
||||||
|
@ -465,9 +478,33 @@ static inline void SendPingToMasterServer(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MasterClient_Ticker(void)
|
||||||
|
{
|
||||||
|
#ifdef MASTERSERVER
|
||||||
|
SendPingToMasterServer();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
Set_api (const char *api)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
|
I_spawn_thread(
|
||||||
|
"change-masterserver",
|
||||||
|
(I_thread_fn)Change_masterserver_thread,
|
||||||
|
strdup(api)
|
||||||
|
);
|
||||||
|
#else
|
||||||
|
HMS_set_api(strdup(api));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif/*MASTERSERVER*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Update_parameters (void)
|
Update_parameters (void)
|
||||||
{
|
{
|
||||||
|
#ifdef MASTERSERVER
|
||||||
int registered;
|
int registered;
|
||||||
int delayed;
|
int delayed;
|
||||||
|
|
||||||
|
@ -487,29 +524,12 @@ Update_parameters (void)
|
||||||
if (! delayed && registered)
|
if (! delayed && registered)
|
||||||
UpdateServer();
|
UpdateServer();
|
||||||
}
|
}
|
||||||
}
|
#endif/*MASTERSERVER*/
|
||||||
|
|
||||||
void MasterClient_Ticker(void)
|
|
||||||
{
|
|
||||||
SendPingToMasterServer();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
Set_api (const char *api)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_THREADS
|
|
||||||
I_spawn_thread(
|
|
||||||
"change-masterserver",
|
|
||||||
(I_thread_fn)Change_masterserver_thread,
|
|
||||||
strdup(api)
|
|
||||||
);
|
|
||||||
#else
|
|
||||||
HMS_set_api(strdup(api));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MasterServer_OnChange(void)
|
static void MasterServer_OnChange(void)
|
||||||
{
|
{
|
||||||
|
#ifdef MASTERSERVER
|
||||||
UnregisterServer();
|
UnregisterServer();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -527,4 +547,5 @@ static void MasterServer_OnChange(void)
|
||||||
|
|
||||||
if (Online())
|
if (Online())
|
||||||
RegisterServer();
|
RegisterServer();
|
||||||
|
#endif/*MASTERSERVER*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,28 +53,6 @@ ifndef NOHW
|
||||||
OBJS+=$(OBJDIR)/r_opengl.o $(OBJDIR)/ogl_sdl.o
|
OBJS+=$(OBJDIR)/r_opengl.o $(OBJDIR)/ogl_sdl.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef NOHS
|
|
||||||
ifdef OPENAL
|
|
||||||
OBJS+=$(OBJDIR)/s_openal.o
|
|
||||||
OPTS+=-DSTATIC3DS
|
|
||||||
STATICHS=1
|
|
||||||
else
|
|
||||||
ifdef FMOD
|
|
||||||
OBJS+=$(OBJDIR)/s_fmod.o
|
|
||||||
OPTS+=-DSTATIC3DS
|
|
||||||
STATICHS=1
|
|
||||||
else
|
|
||||||
ifdef MINGW
|
|
||||||
ifdef DS3D
|
|
||||||
OBJS+=$(OBJDIR)/s_ds3d.o
|
|
||||||
OPTS+=-DSTATIC3DS
|
|
||||||
STATICHS=1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NOMIXER
|
ifdef NOMIXER
|
||||||
i_sound_o=$(OBJDIR)/sdl_sound.o
|
i_sound_o=$(OBJDIR)/sdl_sound.o
|
||||||
else
|
else
|
||||||
|
|
|
@ -1478,6 +1478,7 @@ static SDL_bool Impl_CreateContext(void)
|
||||||
|
|
||||||
void VID_CheckGLLoaded(rendermode_t oldrender)
|
void VID_CheckGLLoaded(rendermode_t oldrender)
|
||||||
{
|
{
|
||||||
|
(void)oldrender;
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (vid_opengl_state == -1) // Well, it didn't work the first time anyway.
|
if (vid_opengl_state == -1) // Well, it didn't work the first time anyway.
|
||||||
{
|
{
|
||||||
|
|
|
@ -220,6 +220,7 @@ static void var_cleanup(void)
|
||||||
internal_volume = 100;
|
internal_volume = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined (HAVE_LIBGME) && defined (HAVE_ZLIB)
|
||||||
static const char* get_zlib_error(int zErr)
|
static const char* get_zlib_error(int zErr)
|
||||||
{
|
{
|
||||||
switch (zErr)
|
switch (zErr)
|
||||||
|
@ -240,6 +241,7 @@ static const char* get_zlib_error(int zErr)
|
||||||
return "unknown error";
|
return "unknown error";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// ------------------------
|
/// ------------------------
|
||||||
/// Audio System
|
/// Audio System
|
||||||
|
|
Loading…
Reference in a new issue