From 0bbfe82e9d52fa6b6e5649ed56f800a022e9b9e6 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Fri, 19 Oct 2001 00:33:30 +0000 Subject: [PATCH] Trying to get network working on win32 --- include/args.h | 8 ++++++-- include/ipx.h | 9 ++++++--- main/Makefile.am | 4 ++++ main/inferno.c | 15 ++++++++++----- main/network.c | 5 ++++- main/network.h | 4 ++++ 6 files changed, 34 insertions(+), 11 deletions(-) diff --git a/include/args.h b/include/args.h index 307c8fdb..77d59637 100644 --- a/include/args.h +++ b/include/args.h @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/include/args.h,v $ - * $Revision: 1.2 $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-24 04:29:45 $ + * $Date: 2001-10-19 00:31:51 $ * * Prototypes for accessing arguments. * * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/24 04:29:45 bradleyb + * changed args_find to FindArg + * * Revision 1.1.1.1 2001/01/19 03:30:16 bradleyb * Import of d2x-0.0.8 * @@ -54,5 +57,6 @@ extern int Num_args; extern char * Args[]; extern int FindArg( char * s ); extern void args_init( int argc, char **argv ); +extern int Inferno_verbose; #endif diff --git a/include/ipx.h b/include/ipx.h index 61d35c02..44b65d2a 100644 --- a/include/ipx.h +++ b/include/ipx.h @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/include/ipx.h,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:16 $ + * $Date: 2001-10-19 00:31:51 $ * * Prototype for IPX communications. * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:30:16 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 22:02:16 donut * Import of d1x 1.37 source. * @@ -119,7 +122,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. // -3 if IPX not installed. // -4 if couldn't allocate low dos memory // -5 if error with getting internetwork address -extern int ipx_init( int socket_number, int show_address ); +extern int ipx_init( int socket_number); extern int ipx_change_default_socket( ushort socket_number ); diff --git a/main/Makefile.am b/main/Makefile.am index 9f2962a6..194e2484 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -19,8 +19,12 @@ endif d2x_LDADD = ${ARCH_LIBS} ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../video/libvideo.a ../arch/libarch.a ../sound/libsound.a ../input/libinput.a if MINGW32 +if USE_NETWORK d2x_sdl_LDADD = ${d2x_LDADD} ${SDL_LIBS} -lwsock32 else +d2x_sdl_LDADD = ${d2x_LDADD} ${SDL_LIBS} +endif +else d2x_sdl_LDADD = ${d2x_LDADD} -lm -ldl -lpthread ${SDL_LIBS} endif d2x_ogl_LDADD = ${d2x_sdl_LDADD} ${OGL_LIBS} diff --git a/main/inferno.c b/main/inferno.c index a0507cac..ce3de177 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -13,13 +13,16 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. /* * $Source: /cvs/cvsroot/d2x/main/inferno.c,v $ - * $Revision: 1.7 $ + * $Revision: 1.8 $ * $Author: bradleyb $ - * $Date: 2001-10-18 00:01:01 $ + * $Date: 2001-10-19 00:31:51 $ * * FIXME: put description here * * $Log: not supported by cvs2svn $ + * Revision 1.7 2001/10/18 00:01:01 bradleyb + * RCS headers added/changed + * * */ @@ -294,7 +297,7 @@ void print_commandline_help() #ifdef SDL_VIDEO printf( " -nosdlvidmodecheck %s\n", "Some X servers don't like checking vidmode first, so just switch"); #endif -#ifdef __ENV_LINUX__ +#ifdef __linux__ printf( " -serialdevice %s\n", "Set serial/modem device to "); printf( " -serialread %s\n", "Set serial/modem to read from "); #endif @@ -357,14 +360,14 @@ void do_register_player(ubyte *title_pal) void do_network_init() { if (!FindArg( "-nonetwork" )) { - int socket=0, showaddress=0, t; + int socket=0, t; int ipx_error; con_printf(CON_VERBOSE, "\n%s ", TXT_INITIALIZING_NETWORK); if ((t=FindArg("-socket"))) socket = atoi( Args[t+1] ); //@@if ( FindArg("-showaddress") ) showaddress=1; - if ((ipx_error=ipx_init(IPX_DEFAULT_SOCKET+socket,showaddress))==0) { + if ((ipx_error=ipx_init(IPX_DEFAULT_SOCKET+socket))==0) { con_printf(CON_VERBOSE, "%s %d.\n", TXT_IPX_CHANNEL, socket ); Network_active = 1; } else { @@ -406,6 +409,8 @@ extern int MenuHiresAvailable; int intro_played = 0; #endif +int Inferno_verbose = 0; + int open_movie_file(char *filename,int must_have); #if defined(POLY_ACC) diff --git a/main/network.c b/main/network.c index 63b0d482..9d9578ef 100644 --- a/main/network.c +++ b/main/network.c @@ -16,7 +16,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: network.c,v 1.4 2001-01-31 15:17:54 bradleyb Exp $"; +static char rcsid[] = "$Id: network.c,v 1.5 2001-10-19 00:31:51 bradleyb Exp $"; #endif #ifdef NETWORK @@ -244,6 +244,9 @@ int Network_games_changed = 0; int Network_socket = 0; int Network_allow_socket_changes = 1; +int Network_initial_pps = 10; +int Network_initial_shortpackets = 0; + int NetSecurityFlag=NETSECURITY_OFF; int NetSecurityNum=0; int Network_sending_extras=0; diff --git a/main/network.h b/main/network.h index c20597f0..ffeab864 100644 --- a/main/network.h +++ b/main/network.h @@ -127,6 +127,10 @@ extern int Network_status; extern fix LastPacketTime[MAX_PLAYERS]; extern ushort my_segments_checksum; + +extern int Network_initial_pps; +extern int Network_initial_shortpackets; + // By putting an up-to-20-char-message into Network_message and // setting Network_message_reciever to the player num you want to // send it to (100 for broadcast) the next frame the player will -- 2.39.2