From f46fc4176363316408e2ad1b621ed15ec4f20324 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 5 Sep 2003 14:32:37 +0000 Subject: [PATCH] By default the client does not contain the server code anymore. It can still be enabled manually at the compile time. Idea by alfie. --- Makefile | 8 +++++++- README | 7 ++++--- tetrinet.c | 9 ++++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3744f15..b5d6543 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,13 @@ CC = cc + CFLAGS = -O2 -I/usr/include/ncurses -DHAVE_IPV6 -g +OBJS = sockets.o tetrinet.o tetris.o tty.o xwin.o + +### If you want to have -server tetrinet client option, comment the two lines +### above and uncomment this instead. -OBJS = server.o sockets.o tetrinet.o tetris.o tty.o xwin.o +# CFLAGS = -O2 -I/usr/include/ncurses -DHAVE_IPV6 -g -DBUILTIN_SERVER +# OBJS = server.o sockets.o tetrinet.o tetris.o tty.o xwin.o ######## diff --git a/README b/README index 1c668fe..989145e 100644 --- a/README +++ b/README @@ -95,9 +95,6 @@ You can also give Tetrinet any of the following options: after pressing the spacebar during which a piece can "slide" left or right before it solidifies.) - -server Start the server instead of the client. (See - "Starting the server".) - -slide Opposite of -noslide; allows pieces to "slide" after being dropped. If both -slide and -noslide are given, -slide takes precedence. If both -windows and -slide @@ -117,6 +114,10 @@ There are two ways to start the Tetrinet server. One way is to give the tetrinet -server +Note that this is the deprecated way and support for this may be removed in +the future releases. You must also explicitly enable it in the Makefile during +compilation. + The other is to run the "tetrinet-server" program. Both of these are exactly equivalent. The server can be stopped with ^C or a "kill" command. diff --git a/tetrinet.c b/tetrinet.c index e80289e..cc79151 100644 --- a/tetrinet.c +++ b/tetrinet.c @@ -556,7 +556,9 @@ int init(int ac, char **av) unsigned char ip[4]; char iphashbuf[32]; int len; +#ifdef BUILTIN_SERVER int start_server = 0; /* Start the server? (-server) */ +#endif int slide = 0; /* Do we definitely want to slide? (-slide) */ @@ -573,9 +575,12 @@ io=&tty_interface; /* because Xwin isn't done yet */ for (i = 1; i < ac; i++) { if (*av[i] == '-') { +#ifdef BUILTIN_SERVER if (strcmp(av[i], "-server") == 0) { start_server = 1; - } else if (strcmp(av[i], "-fancy") == 0) { + } else +#endif + if (strcmp(av[i], "-fancy") == 0) { fancy = 1; } else if (strcmp(av[i], "-log") == 0) { log = 1; @@ -610,8 +615,10 @@ io=&tty_interface; /* because Xwin isn't done yet */ } if (slide) noslide = 0; +#ifdef BUILTIN_SERVER if (start_server) exit(server_main()); +#endif if (!server) { help(); return 1; -- 2.11.4.GIT