mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-29 20:20:43 +00:00
fix the server console for static builds (hmm, non-curses only?)
This commit is contained in:
parent
ce9e2e62e3
commit
a619739bab
8 changed files with 51 additions and 8 deletions
|
@ -133,6 +133,10 @@
|
||||||
/* Define this if you want progs typechecking */
|
/* Define this if you want progs typechecking */
|
||||||
#undef TYPECHECK_PROGS
|
#undef TYPECHECK_PROGS
|
||||||
|
|
||||||
|
/* list of server plugins and prototypes */
|
||||||
|
#undef SERVER_PLUGIN_LIST
|
||||||
|
#undef SERVER_PLUGIN_PROTOS
|
||||||
|
|
||||||
/* list of cd plugins and prototypes */
|
/* list of cd plugins and prototypes */
|
||||||
#undef CD_PLUGIN_LIST
|
#undef CD_PLUGIN_LIST
|
||||||
#undef CD_PLUGIN_PROTOS
|
#undef CD_PLUGIN_PROTOS
|
||||||
|
|
18
configure.ac
18
configure.ac
|
@ -1603,6 +1603,8 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PLUGIN_RPATH='-rpath $(plugindir)'
|
PLUGIN_RPATH='-rpath $(plugindir)'
|
||||||
|
SERVER_PLUGIN_TARGETS="libconsole_server.la"
|
||||||
|
SERVER_PLUGIN_STATIC=""
|
||||||
CD_PLUGIN_STATIC=""
|
CD_PLUGIN_STATIC=""
|
||||||
SND_PLUGIN_STATIC=""
|
SND_PLUGIN_STATIC=""
|
||||||
SND_REND_STATIC=""
|
SND_REND_STATIC=""
|
||||||
|
@ -1615,6 +1617,8 @@ if test "x$static_plugins" = xauto -a "x$SYSTYPE" = xWIN32; then
|
||||||
fi
|
fi
|
||||||
if test "x$static_plugins" = xyes; then
|
if test "x$static_plugins" = xyes; then
|
||||||
PLUGIN_RPATH=''
|
PLUGIN_RPATH=''
|
||||||
|
SERVER_PLUGIN_STATIC="$SERVER_PLUGIN_TARGETS"
|
||||||
|
SERVER_PLUGIN_TARGETS=""
|
||||||
CD_PLUGIN_STATIC="$CD_PLUGIN_TARGETS"
|
CD_PLUGIN_STATIC="$CD_PLUGIN_TARGETS"
|
||||||
CD_PLUGIN_TARGETS=""
|
CD_PLUGIN_TARGETS=""
|
||||||
SND_PLUGIN_STATIC="$SND_PLUGIN_TARGETS"
|
SND_PLUGIN_STATIC="$SND_PLUGIN_TARGETS"
|
||||||
|
@ -1626,15 +1630,24 @@ if test "x$static_plugins" = xyes; then
|
||||||
CDTYPE="$CDTYPE (static)"
|
CDTYPE="$CDTYPE (static)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
SERVER_PLUGIN_STATIC_LIBS=""
|
||||||
CD_PLUGIN_STATIC_LIBS=""
|
CD_PLUGIN_STATIC_LIBS=""
|
||||||
SND_PLUGIN_STATIC_LIBS=""
|
SND_PLUGIN_STATIC_LIBS=""
|
||||||
SND_REND_STATIC_LIBS=""
|
SND_REND_STATIC_LIBS=""
|
||||||
|
SERVER_PLUGIN_LIST="{0, 0}"
|
||||||
CD_PLUGIN_LIST="{0, 0}"
|
CD_PLUGIN_LIST="{0, 0}"
|
||||||
SND_OUTPUT_LIST="{0, 0}"
|
SND_OUTPUT_LIST="{0, 0}"
|
||||||
SND_RENDER_LIST="{0, 0}"
|
SND_RENDER_LIST="{0, 0}"
|
||||||
|
SERVER_PLUGIN_PROTOS=""
|
||||||
CD_PLUGIN_PROTOS=""
|
CD_PLUGIN_PROTOS=""
|
||||||
SND_OUTPUT_PROTOS=""
|
SND_OUTPUT_PROTOS=""
|
||||||
SND_RENDER_PROTOS=""
|
SND_RENDER_PROTOS=""
|
||||||
|
for l in $SERVER_PLUGIN_STATIC; do
|
||||||
|
SERVER_PLUGIN_STATIC_LIBS="$SERVER_PLUGIN_STATIC_LIBS "'$(top_builddir)'"/libs/console/$l"
|
||||||
|
n="`echo $l | sed -e 's/.*lib\(.*\)\.la/\1/'`"
|
||||||
|
SERVER_PLUGIN_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SERVER_PLUGIN_LIST"
|
||||||
|
SERVER_PLUGIN_PROTOS="$SERVER_PLUGIN_PROTOS extern QFPLUGIN plugin_t *${n}_PluginInfo (void);"
|
||||||
|
done
|
||||||
for l in $CD_PLUGIN_STATIC; do
|
for l in $CD_PLUGIN_STATIC; do
|
||||||
CD_PLUGIN_STATIC_LIBS="$CD_PLUGIN_STATIC_LIBS cd/$l"
|
CD_PLUGIN_STATIC_LIBS="$CD_PLUGIN_STATIC_LIBS cd/$l"
|
||||||
n="`echo $l | sed -e 's/lib\(.*\)\.la/\1/'`"
|
n="`echo $l | sed -e 's/lib\(.*\)\.la/\1/'`"
|
||||||
|
@ -1653,6 +1666,8 @@ for l in $SND_REND_STATIC; do
|
||||||
SND_RENDER_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SND_RENDER_LIST"
|
SND_RENDER_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SND_RENDER_LIST"
|
||||||
SND_RENDER_PROTOS="$SND_RENDER_PROTOS extern QFPLUGIN plugin_t *${n}_PluginInfo (void);"
|
SND_RENDER_PROTOS="$SND_RENDER_PROTOS extern QFPLUGIN plugin_t *${n}_PluginInfo (void);"
|
||||||
done
|
done
|
||||||
|
AC_DEFINE_UNQUOTED(SERVER_PLUGIN_LIST, $SERVER_PLUGIN_LIST)
|
||||||
|
AC_DEFINE_UNQUOTED(SERVER_PLUGIN_PROTOS, $SERVER_PLUGIN_PROTOS)
|
||||||
AC_DEFINE_UNQUOTED(CD_PLUGIN_LIST, $CD_PLUGIN_LIST)
|
AC_DEFINE_UNQUOTED(CD_PLUGIN_LIST, $CD_PLUGIN_LIST)
|
||||||
AC_DEFINE_UNQUOTED(CD_PLUGIN_PROTOS, $CD_PLUGIN_PROTOS)
|
AC_DEFINE_UNQUOTED(CD_PLUGIN_PROTOS, $CD_PLUGIN_PROTOS)
|
||||||
AC_DEFINE_UNQUOTED(SND_OUTPUT_LIST, $SND_OUTPUT_LIST)
|
AC_DEFINE_UNQUOTED(SND_OUTPUT_LIST, $SND_OUTPUT_LIST)
|
||||||
|
@ -1663,6 +1678,9 @@ AC_DEFINE_UNQUOTED(SND_RENDER_PROTOS, $SND_RENDER_PROTOS)
|
||||||
AC_SUBST(NQ_TARGETS)
|
AC_SUBST(NQ_TARGETS)
|
||||||
AC_SUBST(QW_TARGETS)
|
AC_SUBST(QW_TARGETS)
|
||||||
AC_SUBST(PLUGIN_RPATH)
|
AC_SUBST(PLUGIN_RPATH)
|
||||||
|
AC_SUBST(SERVER_PLUGIN_STATIC)
|
||||||
|
AC_SUBST(SERVER_PLUGIN_STATIC_LIBS)
|
||||||
|
AC_SUBST(SERVER_PLUGIN_TARGETS)
|
||||||
AC_SUBST(CD_PLUGIN_STATIC)
|
AC_SUBST(CD_PLUGIN_STATIC)
|
||||||
AC_SUBST(CD_PLUGIN_STATIC_LIBS)
|
AC_SUBST(CD_PLUGIN_STATIC_LIBS)
|
||||||
AC_SUBST(CD_PLUGIN_TARGETS)
|
AC_SUBST(CD_PLUGIN_TARGETS)
|
||||||
|
|
|
@ -3,7 +3,9 @@ AUTOMAKE_OPTIONS= foreign
|
||||||
INCLUDES= -I$(top_srcdir)/include
|
INCLUDES= -I$(top_srcdir)/include
|
||||||
|
|
||||||
lib_LTLIBRARIES= libQFconsole.la
|
lib_LTLIBRARIES= libQFconsole.la
|
||||||
plugin_LTLIBRARIES= libconsole_server.la #libconsole_client.la
|
plugin_LTLIBRARIES= @SERVER_PLUGIN_TARGETS@ #libconsole_client.la
|
||||||
|
noinst_LTLIBRARIES= @SERVER_PLUGIN_STATIC@
|
||||||
|
EXTRA_LTLIBRARIES= libconsole_server.la
|
||||||
|
|
||||||
common_sources= buffer.c complete.c console.c inputline.c list.c filelist.c
|
common_sources= buffer.c complete.c console.c inputline.c list.c filelist.c
|
||||||
client_sources= client.c
|
client_sources= client.c
|
||||||
|
@ -16,6 +18,6 @@ libQFconsole_la_SOURCES= $(common_sources)
|
||||||
#libconsole_client_la_LDFLAGS= -version-info 1:0:0
|
#libconsole_client_la_LDFLAGS= -version-info 1:0:0
|
||||||
#libconsole_client_la_SOURCES= $(client_sources)
|
#libconsole_client_la_SOURCES= $(client_sources)
|
||||||
|
|
||||||
libconsole_server_la_LDFLAGS= $(plugin_LDFLAGS) -version-info 1:0:0
|
libconsole_server_la_LDFLAGS= $(plugin_LDFLAGS) -version-info 1:0:0 $(PLUGIN_RPATH)
|
||||||
libconsole_server_la_LIBADD= $(CURSES_LIBS) $(plugin_LIBADD)
|
libconsole_server_la_LIBADD= $(CURSES_LIBS) $(plugin_LIBADD)
|
||||||
libconsole_server_la_SOURCES= $(server_sources)
|
libconsole_server_la_SOURCES= $(server_sources)
|
||||||
|
|
|
@ -108,8 +108,14 @@ Con_DPrintf (const char *fmt, ...)
|
||||||
void
|
void
|
||||||
Con_ProcessInput (void)
|
Con_ProcessInput (void)
|
||||||
{
|
{
|
||||||
if (con_module)
|
if (con_module) {
|
||||||
con_module->functions->console->pC_ProcessInput ();
|
con_module->functions->console->pC_ProcessInput ();
|
||||||
else
|
} else {
|
||||||
Con_Printf ("no input for you\n");
|
static int been_there_done_that = 0;
|
||||||
|
|
||||||
|
if (!been_there_done_that) {
|
||||||
|
been_there_done_that = 1;
|
||||||
|
Con_Printf ("no input for you\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,13 +305,18 @@ C_Print (const char *fmt, va_list args)
|
||||||
static int buffer_size;
|
static int buffer_size;
|
||||||
|
|
||||||
size = vsnprintf (buffer, buffer_size, fmt, args) + 1; // +1 for nul
|
size = vsnprintf (buffer, buffer_size, fmt, args) + 1; // +1 for nul
|
||||||
if (size > buffer_size) {
|
//printf ("size = %d\n", size);
|
||||||
buffer_size = (size + 1023) & ~1023; // 1k multiples
|
while (size <= 0 || size > buffer_size) {
|
||||||
|
if (size > 0)
|
||||||
|
buffer_size = (size + 1023) & ~1023; // 1k multiples
|
||||||
|
else
|
||||||
|
buffer_size += 1024;
|
||||||
buffer = realloc (buffer, buffer_size);
|
buffer = realloc (buffer, buffer_size);
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
Sys_Error ("console: could not allocate %d bytes\n",
|
Sys_Error ("console: could not allocate %d bytes\n",
|
||||||
buffer_size);
|
buffer_size);
|
||||||
vsnprintf (buffer, buffer_size, fmt, args);
|
size = vsnprintf (buffer, buffer_size, fmt, args);
|
||||||
|
//printf ("size = %d\n", size);
|
||||||
}
|
}
|
||||||
|
|
||||||
txt = buffer;
|
txt = buffer;
|
||||||
|
|
|
@ -71,6 +71,7 @@ client_LIBFILES= \
|
||||||
$(top_builddir)/libs/console/filelist.o
|
$(top_builddir)/libs/console/filelist.o
|
||||||
|
|
||||||
server_LIBFILES= \
|
server_LIBFILES= \
|
||||||
|
$(SERVER_PLUGIN_STATIC_LIBS) \
|
||||||
$(top_builddir)/libs/models/libQFmodels.la \
|
$(top_builddir)/libs/models/libQFmodels.la \
|
||||||
$(top_builddir)/libs/console/libQFconsole.la
|
$(top_builddir)/libs/console/libQFconsole.la
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ server_sources= crudefile.c sv_ccmds.c sv_cvar.c sv_ents.c \
|
||||||
sv_user.c world.c $(syssv_SRC)
|
sv_user.c world.c $(syssv_SRC)
|
||||||
|
|
||||||
qf_server_LIBS= \
|
qf_server_LIBS= \
|
||||||
|
$(SERVER_PLUGIN_STATIC_LIBS) \
|
||||||
$(top_builddir)/libs/models/libQFmodels.la \
|
$(top_builddir)/libs/models/libQFmodels.la \
|
||||||
$(top_builddir)/libs/gamecode/engine/libQFgamecode.la \
|
$(top_builddir)/libs/gamecode/engine/libQFgamecode.la \
|
||||||
$(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la \
|
$(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la \
|
||||||
|
|
|
@ -80,6 +80,11 @@ static const char rcsid[] =
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "sv_progs.h"
|
#include "sv_progs.h"
|
||||||
|
|
||||||
|
SERVER_PLUGIN_PROTOS
|
||||||
|
static plugin_list_t server_plugin_list[] = {
|
||||||
|
SERVER_PLUGIN_LIST
|
||||||
|
};
|
||||||
|
|
||||||
client_t *host_client; // current client
|
client_t *host_client; // current client
|
||||||
client_static_t cls; //FIXME needed by netchan :/
|
client_static_t cls; //FIXME needed by netchan :/
|
||||||
|
|
||||||
|
@ -2413,6 +2418,7 @@ SV_Init (void)
|
||||||
|
|
||||||
sv_console_plugin = Cvar_Get ("sv_console_plugin", "server",
|
sv_console_plugin = Cvar_Get ("sv_console_plugin", "server",
|
||||||
CVAR_ROM, 0, "Plugin used for the console");
|
CVAR_ROM, 0, "Plugin used for the console");
|
||||||
|
PI_RegisterPlugins (server_plugin_list);
|
||||||
Con_Init (sv_console_plugin->string);
|
Con_Init (sv_console_plugin->string);
|
||||||
Sys_SetPrintf (SV_Print);
|
Sys_SetPrintf (SV_Print);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue