diff -ru tanked-0.90/client/Imakefile tanked-0.90-linux/client/Imakefile --- tanked-0.90/client/Imakefile Sun Apr 12 01:34:29 1998 +++ tanked-0.90-linux/client/Imakefile Sat May 16 12:11:23 1998 @@ -110,7 +110,7 @@ -DSOUNDDEV=\"$(SOUNDDEV)\" #endif - LOCAL_LIBRARIES = $(XSPRITELIB) $(XPMLIB) $(XLIB) -lm + LOCAL_LIBRARIES = $(XSPRITELIB) $(XPMLIB) $(XLIB) -lm -lgigs DEPLIBS = $(DEPXLIB) libsprite/libXsprite.a diff -ru tanked-0.90/client/main.c tanked-0.90-linux/client/main.c --- tanked-0.90/client/main.c Sun Apr 12 01:34:30 1998 +++ tanked-0.90-linux/client/main.c Sat May 16 12:15:51 1998 @@ -11,6 +11,9 @@ #include "Wlib.h" #include "data.h" #include "defs.h" +#if defined(HAVE_LIBGIGS) +#include +#endif #include "proto.h" #include "images.h" @@ -29,12 +32,18 @@ -p (Default 12592)\n\ -n (Default guest)\n\ -r Defaults file (default ~/.tankedrc)\n\ -%s\n\ -", CLIENTVERSION/100, CLIENTVERSION%100, +%s\ +%s\ +", CLIENTVERSION/100, CLIENTVERSION%100 #ifdef UDP_PROXY - " -P " + ," -P \n" +#else + ,"" +#endif +#if defined(HAVE_LIBGIGS) + ,"-query Choose server using GIGS\n" #else - "" + ,"" #endif ); } @@ -57,7 +66,9 @@ char *cname = 0, *cserver=0, *deffile = 0; int start; char *dpyname=0; - +#if defined(HAVE_LIBGIGS) + int query_gigs = 0; +#endif for(ac = 1; ac < argc; ac++) { if(*argv[ac] == '-') { if(strcmp(argv[ac], "-display") == 0 && (ac+1 < argc)) { @@ -68,6 +79,10 @@ cport = atoi(argv[++ac]); } else if(strcmp(argv[ac], "-n")==0 && (ac+1 < argc)) { cname = argv[++ac]; +#if defined(HAVE_LIBGIGS) + } else if(strcmp(argv[ac], "-query")==0) { + query_gigs = 1; +#endif } else if(strcmp(argv[ac], "-r")== 0 && (ac+1 < argc)) { deffile = argv[++ac]; #ifdef UDP_PROXY @@ -94,6 +109,11 @@ } read_defaults(deffile); + +#if defined(HAVE_LIBGIGS) + if (query_gigs) + cserver = GIGS_chooseServer(NAME, &cport, NULL, GIGS_chooser_X11); +#endif callServer(cport ? cport : port, cserver ? cserver : server); sendLogin(cname ? cname : name, getLogin()); diff -ru tanked-0.90/common/defs.h tanked-0.90-linux/common/defs.h --- tanked-0.90/common/defs.h Sun Apr 12 01:34:28 1998 +++ tanked-0.90-linux/common/defs.h Sat May 16 13:14:16 1998 @@ -9,10 +9,16 @@ #ifndef defs_h #define defs_h +/* Define if you want to use GIGS, http://www.hungry.com/~pere/gigs/ */ +#define HAVE_LIBGIGS + +#define NAME "Get Tanked" + /* port to listen on */ #define TANKEDPORT 12592 #define CLIENTVERSION 84 #define SERVERVERSION 84 +#define SERVERVERSIONS "0.84" /* size in pixels of the combat window */ #define WINWIDTH 300 diff -ru tanked-0.90/server/Makefile tanked-0.90-linux/server/Makefile --- tanked-0.90/server/Makefile Sun Apr 12 02:18:42 1998 +++ tanked-0.90-linux/server/Makefile Sat May 16 12:17:35 1998 @@ -13,7 +13,7 @@ # and a hosed make .c.o: ; $(CC) $(CFLAGS) -c $*.c -LIBS = $(EXTRALIBS) -lc -lm +LIBS = $(EXTRALIBS) -lc -lm -lgigs CFLAGS = $(OPT) $(FLAGS) $(EXTRAFLAGS) $(FILES) $(DIRS) $(PORT) $(INCLUDES) diff -ru tanked-0.90/server/main.c tanked-0.90-linux/server/main.c --- tanked-0.90/server/main.c Sun Apr 12 01:34:29 1998 +++ tanked-0.90-linux/server/main.c Sat May 16 12:15:31 1998 @@ -13,6 +13,9 @@ #include #include #include "defs.h" +#if defined( HAVE_LIBGIGS ) +#include +#endif #include "global.h" #include "socket.h" @@ -110,8 +113,18 @@ /* Read the player database */ database_init(); +#if defined( HAVE_LIBGIGS ) + GIGS_init(); + /* Make sure we report first time we come up. */ + GIGS_notifySimple(NAME, TANKEDPORT, SERVERVERSIONS, -2); +#endif + /* This is it, NET_checkSockets() does all the real work. */ while (1) { +#if defined( HAVE_LIBGIGS ) + GIGS_notifySimple(NAME, TANKEDPORT, SERVERVERSIONS, + /* num_clients is unknown */-1); +#endif NET_checkSockets(); } }