Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26714/src Modified Files: dashboard.c data.c defaults.c input.c local.c parsemeta.c socket.c war.c Log Message: Resorted the server and client TODO lists as much progress has been made on both fronts. Added an internal showdetcircle variable that acts as toggle, rather than having client change the value of the actual detcircle variable, so that when netrekrc is saved by the in game save option, it doesn't use a false value for detcircle. Added beep sound to invalid button presses in the declare war window. Minimal functionality added to generic_32_spacket. currently receives repair_time, which is also a new field in the player struct (p_repair_time). If server does not support the generic_32 feature, client will calculate repair time locally, as it has done in the past. Netrekrc changes: rearranged keymap order, fixed typo in maxscrolllines message, improved message describing useFullShipInfo, added new macro for clue game mailing list. 2 fixes to the keymap saving routine: support for mapping spacebar, and another fix so that default macrokey is saved as well. Fade out all sounds on quit (checked at end of redraw local). Parsemeta changes: removed duplicate stringdefaults calls and placed them instead all at in the same place, in parsemeta(). Index: dashboard.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- dashboard.c 15 Jun 2006 05:09:04 -0000 1.13 +++ dashboard.c 13 Dec 2006 00:00:00 -0000 1.14 @@ -341,7 +341,7 @@ else if ((me->p_flags & PFREPAIR) && plr->p_speed == 0) { sprintf (buf, "Fix "); - sprintf(buf2, "%d", repair_time()); + sprintf(buf2, "%d", (F_sp_generic_32 ? me->p_repair_time : repair_time())); strcat (buf, buf2); msgtype = 2; color = W_Cyan; @@ -883,7 +883,8 @@ /******************************************************************************/ /*** repair_time() - calculate time left till ship is fully repaired using server defined repair rates. Only called when - ship is at warp 0 and under repair ***/ + ship is at warp 0 and under repair. Made obsolete by + F_sp_generic_32 feature packet ***/ /******************************************************************************/ int repair_time (void) Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- input.c 30 Nov 2006 11:28:57 -0000 1.18 +++ input.c 13 Dec 2006 00:00:00 -0000 1.19 @@ -3023,7 +3023,7 @@ lastdet = curtime; } #endif /* AUTOKEY */ - detCircle = 1; + showdetCircle = 1; } Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- local.c 29 Nov 2006 15:09:35 -0000 1.48 +++ local.c 13 Dec 2006 00:00:00 -0000 1.49 @@ -1174,7 +1174,7 @@ } } /* Det circle */ - if (detCircle) + if (showdetCircle) { if (myPlayer(j) || isObsLockPlayer(j)) { @@ -1184,7 +1184,7 @@ clearzone[2][clearcount] = 2*DETDIST/SCALE + 1; clearzone[3][clearcount] = 2*DETDIST/SCALE + 1; clearcount++; - detCircle--; + showdetCircle--; } } #ifdef HOCKEY_LINES @@ -2672,6 +2672,9 @@ if (doubleBuffering) W_Mem2Win (localSDB); #endif + /* Fade all sounds on quit */ + if (me->p_whydead == KQUIT && me->p_status == PEXPLODE) + Mix_FadeOutChannel(-1, 1000); } Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- socket.c 12 Dec 2006 04:47:08 -0000 1.11 +++ socket.c 13 Dec 2006 00:00:00 -0000 1.12 @@ -2356,7 +2356,7 @@ shipvals[stype].s_height = ntohs (packet->s_height); shipvals[stype].s_phaserdamage = ntohs (packet->s_phaserrange); getship (myship, myship->s_type); - + redrawTstats (); calibrate_stats (); redrawStats (); @@ -2365,24 +2365,12 @@ void handleGeneric32 (struct generic_32_spacket *packet) { -/* - unsigned short stype; - - stype = ntohs (packet->s_type); - shipvals[stype].s_torpspeed = ntohs (packet->s_torpspeed); - shipvals[stype].s_maxshield = ntohl (packet->s_maxshield); - shipvals[stype].s_maxdamage = ntohl (packet->s_maxdamage); - shipvals[stype].s_maxegntemp = ntohl (packet->s_maxegntemp); - shipvals[stype].s_maxwpntemp = ntohl (packet->s_maxwpntemp); - shipvals[stype].s_maxarmies = ntohs (packet->s_maxarmies); - shipvals[stype].s_maxfuel = ntohl (packet->s_maxfuel); - shipvals[stype].s_maxspeed = ntohl (packet->s_maxspeed); - shipvals[stype].s_width = ntohs (packet->s_width); - shipvals[stype].s_height = ntohs (packet->s_height); - shipvals[stype].s_phaserdamage = ntohs (packet->s_phaserrange); - getship (myship, myship->s_type); -*/ + char version; +// char unused; + version = packet->version; + me->p_repair_time = packet->repair_time; + // unused = packet->pad1; } #ifdef RSA Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- data.c 12 Dec 2006 04:47:05 -0000 1.46 +++ data.c 13 Dec 2006 00:00:00 -0000 1.47 @@ -54,7 +54,8 @@ * dashboard, 6/2/93 LAB */ int old_db = 0; /* should be same as * newDashboard */ -int detCircle = 0; /* Show det circle on tactical */ +int detCircle = 0; /* Enable det circle option */ +int showdetCircle = 0; /* Det circle toggles on only when det is hit */ int puckCircle = 0; /* Show maximum puck shooting distance on tactical */ int showArmy = 1; /* Show army count of planet you are orbiting */ int fastQuit = 0; Index: war.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/war.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- war.c 19 May 2006 18:08:07 -0000 1.2 +++ war.c 13 Dec 2006 00:00:00 -0000 1.3 @@ -131,6 +131,7 @@ return; break; default: + W_Beep (); return; break; } Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- parsemeta.c 2 Dec 2006 11:24:43 -0000 1.20 +++ parsemeta.c 13 Dec 2006 00:00:00 -0000 1.21 @@ -348,16 +348,6 @@ char *metaservers; /* our copy of the metaserver host names */ char *token; /* current metaserver host name */ struct sockaddr_in address; /* the address of the metaservers */ - - /* host names of metaservers, default in data.c, comma delimited */ - if ((stringDefault("metaServer")) != NULL) - metaServer = stringDefault("metaServer"); - - /* port number of metaservers, unlikely to change, not a list */ - metaPort = intDefault("metaPort", metaPort); - - /* whether to report everything that happens */ - metaVerbose = booleanDefault("metaVerbose", metaVerbose); /* create the socket */ if (msock < 0) { @@ -781,15 +771,13 @@ char cacheFileName[PATH_MAX]; char tmpFileName[PATH_MAX]; char str[LINE]; - char *cacheName; int i, len; - cacheName = stringDefault("metaUDPCache"); /* overwrite existing file if possible */ - if (cacheName && !findfile(cacheName, cacheFileName)) - strcpy(cacheFileName, cacheName); + if (metaUDPCache && !findfile(metaUDPCache, cacheFileName)) + strcpy(cacheFileName, metaUDPCache); - if (cacheName) + if (metaUDPCache) { len = strlen(cacheFileName); strcpy(tmpFileName, cacheFileName); @@ -841,12 +829,12 @@ /* Can't rename file to existing name under NT */ #ifdef _MSC_VER - _unlink(cacheName); + _unlink(metaUDPCache); #else - unlink(cacheName); + unlink(metaUDPCache); #endif - if (rename(tmpFileName, cacheName) == -1) + if (rename(tmpFileName, metaUDPCache) == -1) perror("Could not rename new cache file"); } @@ -855,7 +843,6 @@ static void LoadMetasCache() { FILE *cache; - char *cacheName; char *buffer; char *p; char cacheFileName[PATH_MAX]; @@ -863,16 +850,13 @@ int i, j; int invalid[MAX_SERVERS] = {0}; - cacheName = stringDefault("metaUDPCache"); - if(!cacheName) + if(!metaUDPCache) { num_servers = 0; return; } - findfile(cacheName, cacheFileName); - cache = fopen(cacheFileName, "r"); if (cache == NULL) { @@ -1035,11 +1019,6 @@ int bufleft = BUF - 1; int len = 0; int sock = 0; - - if (stringDefault ("metaServer") != NULL) - metaServer = stringDefault ("metaServer"); - - metaPort = intDefault ("metaPort", metaPort); /* try each of the comma delimited metaserver host names */ metaservers = strdup(metaServer); @@ -1089,7 +1068,6 @@ return 0; } - metaCache = stringDefault ("metaCache"); if (metaCache && !findfile (metaCache, cacheFileName)) strcpy (cacheFileName, metaCache); /* overwrite existing file if possible */ @@ -1154,8 +1132,6 @@ int len; char cacheFileName[PATH_MAX]; - metaCache = stringDefault ("metaCache"); - if (!metaCache) { LineToConsole ("You must define the netrekrc variable `metaCache' in\n"); @@ -1251,6 +1227,17 @@ * used in newwin() to set the height of the meta-server window. */ { + /* host names of metaservers, default in data.c, comma delimited */ + if ((stringDefault("metaServer")) != NULL) + metaServer = stringDefault("metaServer"); + + /* port number of metaservers, unlikely to change, not a list */ + metaPort = intDefault("metaPort", metaPort); + + /* whether to report everything that happens */ + metaVerbose = booleanDefault("metaVerbose", metaVerbose); + + /* status cutoff for listing servers */ metaStatusLevel = intDefault ("metaStatusLevel", metaStatusLevel); if (metaStatusLevel < 0) @@ -1260,6 +1247,10 @@ statusLevel = metaStatusLevel; + /* cache files */ + metaCache = stringDefault ("metaCache"); + metaUDPCache = stringDefault("metaUDPCache"); + type = metaType; switch (type) { Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- defaults.c 12 Dec 2006 04:47:06 -0000 1.35 +++ defaults.c 13 Dec 2006 00:00:00 -0000 1.36 @@ -225,7 +225,7 @@ }, {"maxScrollLines", &maxScrollLines, RC_INT, { - "Maximum number of lines in message window scrollback", + "Maximum number of scroll lines in a message window (range of values 50-500)", NULL } }, @@ -752,6 +752,8 @@ {"useFullShipInfo", &useFullShipInfo, RC_BOOL, { "Display other ships to 256 directions instead of 16", + "by using long ship packets instead of short ship packets", + "slight increase in bandwidth usage", NULL } }, @@ -1985,7 +1987,7 @@ if (c + 32 != mystats->st_keymap[c]) { if (mystats->st_keymap[c] != 'X' && - (mystats->st_keymap[c] > 32 && + (mystats->st_keymap[c] >= 32 && mystats->st_keymap[c] < 127)) { sprintf (str1, "%c%c", c + 32, mystats->st_keymap[c]); @@ -2020,6 +2022,8 @@ strcpy (macroKey, "TAB"); else if (mystats->st_keymap[155] == 'X') strcpy (macroKey, "ESC"); + else if (mystats->st_keymap[56] == 'X') + strcpy (macroKey, "X"); } if (strlen (macroKey) != 0)