Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4835/src Modified Files: beeplite.c cowmain.c data.c distress.c feature.c socket.c Log Message: Remove unnecessary defines (SERVER and all SERVER related defines, COW, RCD, PING, FEATURE_PACKETS). Discovered a nasty crash bug with RCDs/RCMs and %S on paradise servers, fixed. Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- cowmain.c 25 May 2009 14:43:53 -0000 1.40 +++ cowmain.c 8 Jun 2009 22:26:07 -0000 1.41 @@ -847,9 +847,7 @@ else connectToServer (xtrekPort); -#ifdef FEATURE_PACKETS sendFeature ("FEATURE_PACKETS", 'S', 1, 0, 0); -#endif /* TIMER */ timeStart = time(NULL); Index: distress.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/distress.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- distress.c 8 Apr 2007 22:36:41 -0000 1.6 +++ distress.c 8 Jun 2009 22:26:07 -0000 1.7 @@ -493,11 +493,7 @@ mtext = &message[ADDRLEN]; -#ifndef SERVER MZERO ((char *) dist, sizeof (dist)); -#else - bzero ((char *) dist, sizeof (dist)); -#endif dist->sender = from; dist->distype = (unsigned char) (mtext[0] & 0x1f); @@ -618,14 +614,10 @@ struct player *j; struct planet *l; char *strcap (char *s); - -#ifndef SERVER extern int ping_tloss_sc; /* total % loss 0--100, server to client */ extern int ping_tloss_cs; /* total % loss 0--100, client to server */ extern int ping_av; /* average rt */ extern int ping_sd; /* standard deviation */ - -#endif char c; @@ -766,7 +758,6 @@ *pbuf1++ = sender->p_mapchars[1]; break; case 'W': /* push WTEMP flag into buf */ - #ifdef RCM if (dist->distype == rcm) /* whydead for RCM */ { @@ -774,7 +765,6 @@ } else #endif - if (dist->wtmpflag) *pbuf1++ = '1'; else @@ -805,17 +795,12 @@ else { #endif - sprintf (tmp, "%5.2f\0", j->p_kills); - APPEND (pbuf1, tmp); - #ifdef RCM } #endif - break; - case 'U': /* push player name into buf */ cap = 1; case 'u': /* push player name into buf */ @@ -830,45 +815,25 @@ cap = 0; break; case 'S': /* push ship type into buf */ - -#ifndef SERVER - APPEND (pbuf1, classes[sender->p_ship.s_type]); -#else - APPEND (pbuf1, shiptypes[sender->p_ship.s_type]); -#endif - - break; - -#ifdef SERVER - case 'v': /* push average ping round trip time into buf */ - case 'V': /* push ping stdev into buf */ - case 'y': /* push packet loss into buf */ - *pbuf1++ = '0'; - case 'M': /* push capitalized lastMessage into buf */ - case 'm': /* push lastMessage into buf */ + sprintf (tmp, "%c%c", sender->p_ship.s_desig[0], sender->p_ship.s_desig[1]); + APPEND (pbuf1, tmp); break; -#else case 'M': /* push capitalized lastMessage into buf */ cap = 1; case 'm': /* push lastMessage into buf */ APPEND_CAP (pbuf1, cap, lastMessage); cap = 0; break; - case 'v': /* push average ping round trip time into buf */ APPEND_INT (pbuf1, ping_av); break; - case 'V': /* push ping stdev into buf */ APPEND_INT (pbuf1, ping_sd); break; - case 'y': /* push packet loss into buf */ /* this is the weighting formula used be socket.c ntserv */ APPEND_INT (pbuf1, (2 * ping_tloss_sc + ping_tloss_cs) / 3); break; -#endif - case '*': /* push %* into buf */ case '}': /* push %} into buf */ case '{': /* push %{ into buf */ Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.125 retrieving revision 1.126 diff -u -d -r1.125 -r1.126 --- data.c 3 Jun 2009 02:42:55 -0000 1.125 +++ data.c 8 Jun 2009 22:26:07 -0000 1.126 @@ -440,7 +440,6 @@ #endif /* NEWMACRO */ char lastMessage[80]; -char *classes[] = { "SC", "DD", "CA", "BB", "AS", "SB", "GA", "AT" }; char teamlet[] = { 'I', 'F', 'R', 'X', 'K', 'X', 'X', 'X', 'O', 'X', 'X', 'X', 'X', 'X', 'X', 'A' }; @@ -736,11 +735,8 @@ #endif -#ifdef FEATURE_PACKETS int F_feature_packets = 0; -#endif - int F_cloak_maxwarp = 0; int F_self_8flags = 0; int F_self_8flags2 = 0; Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- feature.c 3 Jun 2009 02:42:55 -0000 1.32 +++ feature.c 8 Jun 2009 22:26:07 -0000 1.33 @@ -21,8 +21,6 @@ /* type is CP_FEATURE, which is 60. feature_spacket is identical. */ #include "config.h" -#ifdef FEATURE_PACKETS - #include <stdio.h> #include <sys/types.h> @@ -360,4 +358,3 @@ checkFeature (packet); } -#endif /* FEATURE_PACKETS */ Index: beeplite.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/beeplite.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- beeplite.c 16 Apr 2008 00:08:05 -0000 1.17 +++ beeplite.c 8 Jun 2009 22:26:07 -0000 1.18 @@ -10,10 +10,7 @@ #include <stdlib.h> #include <signal.h> #include <ctype.h> - -#ifndef SERVER #include "Wlib.h" -#endif #include "defs.h" #include "struct.h" Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- socket.c 6 Jun 2009 03:29:08 -0000 1.70 +++ socket.c 8 Jun 2009 22:26:07 -0000 1.71 @@ -195,9 +195,7 @@ {0, dummy}, /* 59 */ #endif -#ifdef FEATURE_PACKETS {sizeof (struct feature_cpacket), handleFeature}, /* CP_FEATURE; 60 */ -#endif {sizeof (struct rank_spacket), handleRank}, /* SP_RANK */ {sizeof (struct ltd_spacket), handleLtd}, /* SP_LTD */ }; @@ -245,12 +243,7 @@ 0, /* 39 */ 0, /* 40 */ 0, /* 41 */ - -#ifdef PING sizeof (struct ping_cpacket), /* CP_PING_RESPONSE */ -#else - 0, -#endif #ifdef SHORT_PACKETS sizeof (struct shortreq_cpacket), /* CP_S_REQ */ @@ -276,11 +269,7 @@ 0, /* 57 */ 0, /* 58 */ 0, /* 59 */ - -#ifdef FEATURE_PACKETS sizeof (struct feature_cpacket), /* CP_FEATURE; 60 */ -#endif - }; #define NUM_PACKETS (sizeof(handlers) / sizeof(handlers[0]) - 1) @@ -5468,7 +5457,6 @@ ntohl(((struct player_s_spacket *) packet)->y) ); break; #endif -#ifdef PING case SP_PING : /* ping packet */ LineToConsole("\nS->C SP_PING\t"); if (log_packets > 1) @@ -5480,8 +5468,6 @@ ((struct ping_spacket *) packet)->iloss_sc, ((struct ping_spacket *) packet)->iloss_cs ); break; -#endif -#ifdef FEATURE_PACKETS case SP_FEATURE : LineToConsole("\nS->C SP_FEATURE\t"); if (log_packets > 1) @@ -5492,7 +5478,6 @@ ntohl(((struct feature_cpacket *) packet)->value), ((struct feature_cpacket *) packet)->name ); break; -#endif case SP_RANK : LineToConsole("\nS->C SP_RANK\t"); if (log_packets > 1) @@ -6088,7 +6073,6 @@ LineToConsole(" no struct defined,"); break; #endif -#ifdef FEATURE_PACKETS case CP_FEATURE : LineToConsole("\nC->S CP_FEATURE\t"); if (log_packets > 1) @@ -6099,7 +6083,6 @@ ntohl(((struct feature_cpacket *) packet)->value), ((struct feature_cpacket *) packet)->name ); break; -#endif default : LineToConsole("\nC->S UNKNOWN\t"); if(log_packets > 1)