link in hw, move the qw and nq networking code into libs/net and make

hw-master use libnetchan. there are evil include hacks that will need to be
taken care of in net*.[ch]
This commit is contained in:
Bill Currie 2003-02-11 22:48:57 +00:00
parent 4bd1718475
commit 21d8b4f8dc
42 changed files with 137 additions and 69 deletions

View file

@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS= foreign
SUBDIRS= RPM debian doc include libs qw nq tools ruamoko
SUBDIRS= RPM debian doc include libs hw nq qw tools ruamoko
## configure.ac needs to be listed here for older autoconfs
EXTRA_DIST= ChangeLog configure.ac \

View file

@ -1503,6 +1503,7 @@ QF_WITH_TARGETS(
)
unset CL_TARGETS
HW_TARGETS=""
QW_TARGETS=""
NQ_TARGETS=""
@ -1652,6 +1653,7 @@ if test "x$ENABLE_servers_nq" = xyes; then
QF_NEED(nq, [common net server])
fi
if test "x$ENABLE_servers_master" = xyes; then
HW_TARGETS="hw-master\$(EXEEXT) $HW_TARGETS"
QW_TARGETS="qw-master\$(EXEEXT) $QW_TARGETS"
SV_TARGETS="$SV_TARGETS master"
fi
@ -1898,6 +1900,7 @@ AC_DEFINE_UNQUOTED(SND_OUTPUT_PROTOS, $SND_OUTPUT_PROTOS, [list of sound output
AC_DEFINE_UNQUOTED(SND_RENDER_LIST, $SND_RENDER_LIST, [list of sound render plugins])
AC_DEFINE_UNQUOTED(SND_RENDER_PROTOS, $SND_RENDER_PROTOS, [list of sound render prototypes])
AC_SUBST(HW_TARGETS)
AC_SUBST(NQ_TARGETS)
AC_SUBST(QW_TARGETS)
AC_SUBST(SERVER_PLUGIN_STATIC)
@ -2030,6 +2033,9 @@ AC_OUTPUT(
libs/models/alias/Makefile
libs/models/brush/Makefile
libs/models/sprite/Makefile
libs/net/Makefile
libs/net/nc/Makefile
libs/net/nm/Makefile
libs/util/Makefile
libs/video/Makefile
libs/video/renderer/Makefile
@ -2038,6 +2044,10 @@ AC_OUTPUT(
libs/video/renderer/sw32/Makefile
libs/video/targets/Makefile
hw/Makefile
hw/include/Makefile
hw/source/Makefile
nq/Makefile
nq/include/Makefile
nq/source/Makefile

View file

@ -40,7 +40,7 @@ EXTRA_PROGRAMS= hw-master
common_ldflags= -export-dynamic
hw_master_SOURCES= master.c
hw_master_LDADD= $(top_builddir)/qw/source/libqw_net.a $(SERVER_PLUGIN_STATIC_LIBS) $(top_builddir)/libs/console/libQFconsole.la $(top_builddir)/libs/util/libQFutil.la $(NET_LIBS)
hw_master_LDADD= $(top_builddir)/libs/net/libnet_chan.la $(SERVER_PLUGIN_STATIC_LIBS) $(top_builddir)/libs/console/libQFconsole.la $(top_builddir)/libs/util/libQFutil.la $(NET_LIBS)
hw_master_LDFLAGS= $(common_ldflags) -static
# Kill the temp files, hopefully.

View file

@ -12,7 +12,7 @@
#include "QF/qargs.h"
#include "QF/sizebuf.h"
#include "QF/sys.h"
#include "../qw/include/net.h"
#include "netchan.h"
#include "defs.h"
qboolean is_server = true;

View file

@ -4,10 +4,11 @@ SUBDIRS = QF
EXTRA_DIST = asm_i386.h alsa_funcs_list.h adivtab.h anorm_dots.h anorms.h \
asm_draw.h block16.h block8.h buildnum.h compat.h context_sdl.h \
context_x11.h d_iface.h d_ifacea.h d_local.h dga_check.h exp.h fbset.h \
getopt.h gl_warp_sin.h in_win.h logos.h menu.h old_keys.h ops.h qstring.h \
quakeasm.h regex.h r_cvar.h r_dynamic.h r_local.h r_screen.h r_shared.h \
sbar.h skin_stencil.h snd_render.h varrays.h vgamodes.h view.h vregset.h \
winquake.h world.h \
getopt.h gl_warp_sin.h in_win.h logos.h menu.h net_dgrm.h net_loop.h \
net_udp.h net_vcr.h net_wins.h netchan.h netmain.h old_keys.h ops.h \
qstring.h quakeasm.h regex.h r_cvar.h r_dynamic.h r_local.h r_screen.h \
r_shared.h sbar.h skin_stencil.h snd_render.h varrays.h vgamodes.h \
view.h vregset.h winquake.h world.h \
\
win32/fnmatch.h \
\

View file

@ -30,7 +30,7 @@
#define __net_loop_h
#include "QF/qtypes.h"
#include "net.h"
#include "netmain.h"
int Loop_Init (void);
void Loop_Listen (qboolean state);

View file

@ -34,7 +34,7 @@
#include "QF/qdefs.h"
#include "QF/sizebuf.h"
#include "bothdefs.h"
#include "../qw/include/bothdefs.h"
#define PORT_ANY -1

View file

@ -1,3 +1,3 @@
AUTOMAKE_OPTIONS= foreign
SUBDIRS= audio console gamecode gib models video util
SUBDIRS= audio console gamecode gib models net video util

7
libs/net/.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
*.la
*.lo
.deps
.libs
.vimrc
Makefile
Makefile.in

17
libs/net/Makefile.am Normal file
View file

@ -0,0 +1,17 @@
AUTOMAKE_OPTIONS= foreign
SUBDIRS= nc nm
AM_CFLAGS= @PREFER_NON_PIC@
INCLUDES= -I$(top_srcdir)/include
noinst_LTLIBRARIES= libnet_chan.la libnet_main.la
libnet_chan_la_LIBADD= nc/libnc.la
libnet_chan_la_LDFLAGS= -static
libnet_chan_la_SOURCES= net_chan.c
libnet_chan_la_DEPENDENCIES= nc/libnc.la
libnet_main_la_LIBADD= nm/libnm.la
libnet_main_la_LDFLAGS= -static
libnet_main_la_SOURCES= net_main.c
libnet_main_la_DEPENDENCIES= nm/libnm.la

7
libs/net/nc/.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
*.la
*.lo
.deps
.libs
.vimrc
Makefile
Makefile.in

17
libs/net/nc/Makefile.am Normal file
View file

@ -0,0 +1,17 @@
AUTOMAKE_OPTIONS= foreign
AM_CFLAGS= @PREFER_NON_PIC@
INCLUDES= -I$(top_srcdir)/include
noinst_LTLIBRARIES= libnc.la
ipv6_src= net_udp6.c
ipv4_src= net_udp.c
if NETTYPE_IPV6
ipvX_src= $(ipv6_src)
else
ipvX_src= $(ipv4_src)
endif
libnc_la_SOURCES= $(ipvX_src)
libnc_la_LDFLAGS= -static
EXTRA_libnc_la_SOURCES= $(ipv4_src) $(ipv6_src)

View file

@ -75,7 +75,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/qargs.h"
#include "compat.h"
#include "net.h"
#include "netchan.h"
#ifdef _WIN32
# include <windows.h>

View file

@ -107,7 +107,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/qtypes.h"
#include "QF/sys.h"
#include "net.h"
#include "netchan.h"
#ifndef MAXHOSTNAMELEN
# define MAXHOSTNAMELEN 512

View file

@ -49,9 +49,10 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/msg.h"
#include "QF/sys.h"
#include "client.h"
#include "compat.h"
#include "net.h"
#include "netchan.h"
#include "../qw/include/client.h"
#define PACKET_HEADER 8

View file

@ -48,10 +48,11 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/sizebuf.h"
#include "QF/sys.h"
#include "host.h"
#include "net.h"
#include "netmain.h"
#include "net_vcr.h"
#include "server.h"
#include "../nq/include/host.h"
#include "../nq/include/server.h"
qsocket_t *net_activeSockets = NULL;
qsocket_t *net_freeSockets = NULL;

7
libs/net/nm/.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
*.la
*.lo
.deps
.libs
.vimrc
Makefile
Makefile.in

18
libs/net/nm/Makefile.am Normal file
View file

@ -0,0 +1,18 @@
AUTOMAKE_OPTIONS= foreign
AM_CFLAGS= @PREFER_NON_PIC@
INCLUDES= -I$(top_srcdir)/include
noinst_LTLIBRARIES= libnm.la
if SYSTYPE_WIN32
net_sources= net_win.c net_wins.c
else
net_sources= net_bsd.c net_udp.c
endif
libnm_la_SOURCES= net_dgrm.c net_loop.c net_vcr.c $(net_sources)
libnm_la_LDFLAGS= -static
EXTRA_libnm_la_SOURCES= \
net_bsd.c net_win.c net_wins.c net_udp.c

View file

@ -31,7 +31,7 @@
static __attribute__ ((unused)) const char rcsid[] =
"$Id$";
#include "net.h"
#include "netmain.h"
#include "net_loop.h"
#include "net_dgrm.h"

View file

@ -48,11 +48,12 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/screen.h"
#include "QF/console.h"
#include "client.h"
#include "server.h"
#include "net.h"
#include "game.h"
#include "sv_progs.h"
#include "netmain.h"
#include "../nq/include/client.h"
#include "../nq/include/server.h"
#include "../nq/include/game.h"
#include "../nq/include/sv_progs.h"
// This is enables a simple IP banning mechanism
#define BAN_TEST

View file

@ -36,10 +36,11 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/console.h"
#include "QF/sys.h"
#include "net.h"
#include "netmain.h"
#include "net_loop.h"
#include "client.h"
#include "server.h"
#include "../nq/include/client.h"
#include "../nq/include/server.h"
qboolean localconnectpending = false;
qsocket_t *loop_client = NULL;

View file

@ -84,7 +84,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/console.h"
#include "compat.h"
#include "net.h"
#include "netmain.h"
#ifdef _WIN32
# undef EWOULDBLOCK

View file

@ -34,9 +34,10 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/msg.h"
#include "QF/sys.h"
#include "net.h"
#include "netmain.h"
#include "net_vcr.h"
#include "server.h"
#include "../nq/include/server.h"
// This is the playback portion of the VCR. It reads the file produced

View file

@ -39,7 +39,7 @@
#include "QF/render.h"
#include "game.h"
#include "net.h"
#include "netmain.h"
#include "protocol.h"
#include "r_local.h"

View file

@ -37,7 +37,7 @@
#include "QF/sizebuf.h"
#include "client.h"
#include "net.h"
#include "netmain.h"
#include "protocol.h"
#include "sv_progs.h"

View file

@ -45,7 +45,7 @@ asm=
endif
noinst_LIBRARIES= @nq_libs@ $(asm)
EXTRA_LIBRARIES=libasm.a libnq_client.a libnq_common.a libnq_net.a libnq_sdl.a libnq_server.a
EXTRA_LIBRARIES=libasm.a libnq_client.a libnq_common.a libnq_sdl.a libnq_server.a
libasm_a_SOURCES= worlda.S
libnq_common_a_SOURCES=game.c locs.c world.c com.c
@ -54,17 +54,6 @@ libnq_sdl_a_CFLAGS= $(SDL_CFLAGS)
common_ldflags= -export-dynamic
# ... Networking
if SYSTYPE_WIN32
net_sources= net_win.c net_wins.c
else
net_sources= net_bsd.c net_udp.c
endif
libnq_net_a_SOURCES= net_dgrm.c net_loop.c net_main.c net_vcr.c $(net_sources)
EXTRA_libnq_net_a_SOURCES= \
net_bsd.c net_win.c net_wins.c net_udp.c
cl_plugin_LIBS= \
$(CLIENT_PLUGIN_STATIC_LIBS) \
$(top_builddir)/libs/gamecode/builtins/libQFcsqc.la
@ -76,12 +65,11 @@ client_LIBFILES= \
server_LIBFILES= \
$(SERVER_PLUGIN_STATIC_LIBS) \
$(top_builddir)/libs/models/libQFmodels.la \
$(top_builddir)/libs/console/libQFconsole.la
$(top_builddir)/libs/models/libQFmodels.la
common_LIBFILES= \
libasm.a \
libnq_net.a \
$(top_builddir)/libs/net/libnet_main.la \
$(top_builddir)/libs/console/libQFconsole.la \
$(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la \
$(top_builddir)/libs/gamecode/engine/libQFgamecode.la \

View file

@ -34,7 +34,7 @@
#include "QF/vid.h"
#include "QF/zone.h"
#include "net.h"
#include "netchan.h"
#include "protocol.h"
#include "r_local.h"
#include "QF/render.h"

View file

@ -38,7 +38,7 @@
#include "QF/sizebuf.h"
#include "host.h"
#include "net.h"
#include "netchan.h"
#include "protocol.h"
#define QW_SERVER

View file

@ -46,7 +46,7 @@ asm=
endif
noinst_LIBRARIES= @qw_libs@ $(asm)
EXTRA_LIBRARIES=libasm.a libqw_client.a libqw_common.a libqw_net.a libqw_sdl.a libqw_server.a
EXTRA_LIBRARIES=libasm.a libqw_client.a libqw_common.a libqw_sdl.a libqw_server.a
libasm_a_SOURCES= worlda.S
@ -56,17 +56,6 @@ libqw_sdl_a_CFLAGS=$(SDL_CFLAGS)
common_ldflags= -export-dynamic
# ... Network type
ipv6_src= net_udp6.c
ipv4_src= net_udp.c
if NETTYPE_IPV6
ipvX_src= $(ipv6_src)
else
ipvX_src= $(ipv4_src)
endif
libqw_net_a_SOURCES= net_chan.c $(ipvX_src)
EXTRA_libqw_net_a_SOURCES= $(ipv4_src) $(ipv6_src)
# Server builds
#
# ... System type
@ -85,6 +74,7 @@ libqw_server_a_SOURCES= \
qf_server_LIBS= \
$(SERVER_PLUGIN_STATIC_LIBS) \
$(top_builddir)/libs/net/libnet_chan.la \
$(top_builddir)/libs/gamecode/builtins/libQFcsqc.la \
$(top_builddir)/libs/models/libQFmodels.la \
$(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la \
@ -94,9 +84,9 @@ qf_server_LIBS= \
$(top_builddir)/libs/gib/libQFgib.la
qw_server_SOURCES= sv_model.c
qw_server_LDADD= libqw_server.a libqw_common.a libqw_net.a libasm.a $(qf_server_LIBS) $(NET_LIBS) $(DL_LIBS) $(CURSES_LIBS)
qw_server_LDADD= libqw_server.a libqw_common.a libasm.a $(qf_server_LIBS) $(NET_LIBS) $(DL_LIBS) $(CURSES_LIBS)
qw_server_LDFLAGS= $(common_ldflags)
qw_server_DEPENDENCIES= libqw_common.a libqw_server.a libqw_net.a libasm.a $(qf_server_LIBS)
qw_server_DEPENDENCIES= libqw_common.a libqw_server.a libasm.a $(qf_server_LIBS)
qw_master_SOURCES= master.c
qw_master_LDADD= $(top_builddir)/libs/util/libQFutil.la $(NET_LIBS)
@ -107,6 +97,7 @@ cl_plugin_LIBS= \
$(top_builddir)/libs/gamecode/builtins/libQFcsqc.la
qf_client_LIBS= \
$(top_builddir)/libs/net/libnet_chan.la \
$(top_builddir)/libs/console/libQFconsole.la \
$(top_builddir)/libs/video/targets/libQFjs.la \
$(top_builddir)/libs/gamecode/builtins/libQFgamecode_builtins.la \
@ -116,7 +107,7 @@ qf_client_LIBS= \
$(top_builddir)/libs/util/libQFutil.la \
$(top_builddir)/libs/gib/libQFgib.la
client_LIBS= libqw_net.a libasm.a $(qf_client_LIBS)
client_LIBS= libasm.a $(qf_client_LIBS)
client_libs= libqw_client.a libqw_common.a
libqw_client_a_SOURCES= \

View file

@ -102,7 +102,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "compat.h"
#include "game.h"
#include "host.h"
#include "net.h"
#include "netchan.h"
#include "pmove.h"
#include "r_cvar.h"
#include "r_dynamic.h"

View file

@ -58,7 +58,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/sys.h"
#include "host.h"
#include "net.h"
#include "netchan.h"
int noconinput = 0;
qboolean is_server = false;

View file

@ -54,7 +54,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "client.h"
#include "compat.h"
#include "host.h"
#include "net.h"
#include "netchan.h"
#include "win32/resources/resource.h"
#define MAXIMUM_WIN_MEMORY 0x1000000

View file

@ -43,7 +43,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/sys.h"
#include "msg_ucmd.h"
#include "net.h"
#include "netchan.h"
#include "protocol.h"
struct usercmd_s nullcmd;

View file

@ -56,7 +56,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/va.h"
#include "compat.h"
#include "net.h"
#include "netchan.h"
#include "protocol.h"
#include "server.h"

View file

@ -89,7 +89,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "client.h" //FIXME needed by cls below (for netchan)
#include "crudefile.h"
#include "game.h"
#include "net.h"
#include "netchan.h"
#include "pmove.h"
#include "server.h"
#include "sv_demo.h"