Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4313/src Modified Files: data.c dmessage.c enter.c feature.c planetlist.c socket.c Log Message: Added support for server feature packets F_whydead_2 and the two lame_refit feature packets. Bug fix for paradise handling of macros. Bug fix for addition of 2 extra paradise death messages. Moved planet initialization into its own function. Index: dmessage.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dmessage.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- dmessage.c 24 Feb 2008 00:33:55 -0000 1.10 +++ dmessage.c 6 Apr 2008 22:41:43 -0000 1.11 @@ -150,7 +150,13 @@ } /* aha! A new type distress/macro call came in. parse it appropriately */ - if (flags == (MTEAM | MDISTR | MVALID)) + if ( +#ifdef PARADISE // Not quite sure why this check is here..but apparently it's needed. + // This check needs to be further investigated on the current paradise + // server code, for bombing messages and RCDs. BB 03/11/08 + gen_distress && +#endif + flags == (MTEAM | MDISTR | MVALID)) { HandleGenDistr (message, from, to, &dist); len = makedistress (&dist, message, distmacro[dist.distype].macro); @@ -269,6 +275,10 @@ (instr (message, "was kill") || instr (message, "killed by")) || instr (message, "Credit for")) || +#ifdef PARADISE + instr (message, "burned to a crisp by") || + instr (message, "shot down by") || +#endif (*message != ' ' && instr (message, "We are being attacked"))) { if (!reportKills) Index: enter.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/enter.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- enter.c 24 Feb 2008 00:33:55 -0000 1.14 +++ enter.c 6 Apr 2008 22:41:44 -0000 1.15 @@ -60,7 +60,7 @@ status2 = (struct status2 *) malloc(sizeof(*status2)); #endif status = (struct status *) malloc(sizeof(*status)); - planets = (struct planet *) malloc(sizeof(*planets) * MAXPLANETS); + initialize_planets(); phasers = (struct phaser *) malloc(sizeof(*phasers) * MAXPLAYER); mctl = (struct mctl *) malloc(sizeof(*mctl)); messages = (struct message *) malloc(sizeof(*messages) * MAXMESSAGE); @@ -105,13 +105,6 @@ plasmatorps[i].pt_owner = (short) (i / MAXPLASMA); } - for (i = 0; i < MAXPLANETS; i++) - planets[i].pl_no = i; - - /* initialize planet redraw for moving planets */ - for (i = 0; i < MAXPLANETS; i++) - pl_update[i].plu_update = -1; - /* initialize pointers if ghost start */ if (ghoststart) { Index: planetlist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/planetlist.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- planetlist.c 18 May 2007 19:54:39 -0000 1.9 +++ planetlist.c 6 Apr 2008 22:41:45 -0000 1.10 @@ -38,6 +38,33 @@ "ORI" }; +void initialize_planets(void) +{ + int i; + + planets = (struct planet *)malloc(sizeof(*planets) * MAXPLANETS); + + for(i = 0; i < MAXPLANETS; i++) { + struct planet *curr = &planets[i]; + curr->pl_no = i; + curr->pl_flags = 0; + curr->pl_owner = 0; + curr->pl_x = curr->pl_y = -10000; + sprintf(curr->pl_name, "planet%d", i); + curr->pl_namelen = strlen(curr->pl_name); + curr->pl_armies = 0; + curr->pl_info = 0; + curr->pl_deadtime = 0; + curr->pl_couptime = 0; +#ifdef PARADISE + curr->pl_timestamp = 0; +#endif + + /* initialize planet redraw for moving planets */ + pl_update[i].plu_update = -1; + } +} + /* * Open a window which contains all the planets and their current * * statistics. Players will not know about planets that their team * has not * orbited. */ Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- data.c 29 Nov 2007 05:29:05 -0000 1.101 +++ data.c 6 Apr 2008 22:41:43 -0000 1.102 @@ -251,6 +251,8 @@ int lastUpdateSpeed = 10; /* last update speed client requested */ int server_ups = 10; /* server responded updates per second */ int server_fps = 10; /* server configured frames per second */ +int lame_refit = 1; +int lame_base_refit = 1; #ifdef META /* Metaservers list - comma delimited */ @@ -760,6 +762,7 @@ int F_turn_keys = 0; int F_show_visibility_range = 0; int F_sp_flags_all = 0; +int F_why_dead_2 = 0; #ifdef RECORDGAME int F_many_self = 0; Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- feature.c 17 May 2007 08:49:48 -0000 1.19 +++ feature.c 6 Apr 2008 22:41:44 -0000 1.20 @@ -104,6 +104,7 @@ #else {"SP_FLAGS_ALL", &F_sp_flags_all, 'S', 1, 0, 0}, #endif + {"WHY_DEAD_2", &F_why_dead_2, 'S', 1, 0, 0}, {0, 0, 0, 0, 0, 0} }; @@ -202,7 +203,17 @@ LineToConsole("Server actually sending %d updates per second.\n", value); return; } - + if (strcmpi (packet->name, "LAME_REFIT") == 0) + { + lame_refit = value; + return; + } + if (strcmpi (packet->name, "LAME_BASE_REFIT") == 0) + { + lame_base_refit = value; + return; + } + if (features[i].name == 0) { LineToConsole ("Feature %s from server unknown to client!\n", packet->name); Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- socket.c 24 Feb 2008 00:33:56 -0000 1.37 +++ socket.c 6 Apr 2008 22:41:45 -0000 1.38 @@ -3175,32 +3175,6 @@ } void -initialize_planets(void) -{ - int i; - - planets = (struct planet *)malloc(sizeof(*planets) * MAXPLANETS); - - for(i = 0; i < MAXPLANETS; i++) { - struct planet *curr = &planets[i]; - curr->pl_no = i; - curr->pl_flags = 0; - curr->pl_owner = 0; - curr->pl_x = curr->pl_y = -10000; - sprintf(curr->pl_name, "planet%d", i); - curr->pl_namelen = strlen(curr->pl_name); - curr->pl_armies = 0; - curr->pl_info = 0; - curr->pl_deadtime = 0; - curr->pl_couptime = 0; - curr->pl_timestamp = 0; - - /* initialize planet redraw for moving planets */ - pl_update[i].plu_update = -1; - } -} - -void initialize_ranks(void) { ranks2 = (struct rank2 *) malloc(sizeof(*ranks2) * nranks2);