From modemhero at users.sourceforge.net Sat Dec 2 05:24:45 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 02 Dec 2006 11:24:45 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.44, 1.45 parsemeta.c, 1.19, 1.20 Message-ID: <20061202112457.3D007B402@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7612/src Modified Files: data.c parsemeta.c Log Message: hints.dat; updated with new hints regarding changes to close windows and det circle functionality data.c: addition of 3rd metaserver to client. This new metaserver entry is a static DNS that is currently pointing to the IP address of metaserver2.us.netrek.org, but can be changed if needed to point to a non *.netrek.org metaserver, providing a failsafe in case of critical loss of metaserver facilities. The DNS entry is currently controlled by the client author (Bill Balcerski). Multiple minor changes in parsemeta.c, such as formalizing a value for MAX_SERVERS, removing an unneeded variable in a sscanf call in parseInput(). parsemeta.c (version_r()): Handle the new server entry case before the old server entry case, to mimic how other functions are written. parsemeta.c (SaveMetasCache): Rewritten to save data as text rather than a binary file. parsemeta.c (LoadMetasCache): Rerwritten to load the new text cache file into a buffer, and parse the data, making sure to check for invalid entries. parsemeta.c (metasort): New function that sorts servers by status and player count, in the case of the UDP metaserver, as server order in the server list array may need to be changed as servers gain or lose players. Called upon metawindow creation, and any time the user requests a server refresh. Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- parsemeta.c 1 Dec 2006 00:49:56 -0000 1.19 +++ parsemeta.c 2 Dec 2006 11:24:43 -0000 1.20 @@ -64,6 +64,7 @@ #define BUF 6144 #define LINE 80 /* Width of a meta-server line */ +#define MAX_SERVERS 2048 /* Maximum number of servers allowed */ #define MAXMETABYTES 2048 /* maximum metaserver UDP packet size */ static int msock = -1; /* the socket to talk to the metaservers */ static int sent = 0; /* number of solicitations sent */ @@ -290,7 +291,7 @@ /* Is this a line we want? */ - if (sscanf (line, "-h %s -p %d %d %*d", + if (sscanf (line, "-h %s -p %d %d", slist->address, &(slist->port), &(slist->age)) != 3) { continue; @@ -485,7 +486,7 @@ servers = atoi(p); /* sanity check on number of servers */ - if (servers > 2048) return; + if (servers > MAX_SERVERS) return; if (servers < 0) return; if (metaVerbose) @@ -533,8 +534,8 @@ type = p[0]; /* Metaserver and client define status level differently, must convert - status so that client option metaStatusLevel works properly. And - temporarily record player field as well. */ + status before the throwaway checks so that client option metaStatusLevel + works properly. And temporarily record player field as well. */ switch (status) { case SS_QUEUE: tempstatus = statusWait; @@ -574,8 +575,19 @@ /* find in current server list? */ sp = server_find(host, port); + /* if it was not found, add it to the end of the list */ + if (sp == NULL) { + grow(1); + sp = serverlist + num_servers; + num_servers++; + strncpy(sp->address,host,LINE); + sp->port = port; + sp->age = age; + sp->when = now; + sp->lifetime = 4; + } /* if it was found, check age */ - if (sp != NULL) { + else { if ((now-age) < (sp->when-sp->age)) { sp->age = (int)now - (int)(sp->when-sp->age); sp->when = now; @@ -587,23 +599,13 @@ sp->when = now; sp->lifetime = 20; } - } else { - /* not found, store it at the end of the list */ - grow(1); - sp = serverlist + num_servers; - num_servers++; - strncpy(sp->address,host,LINE); - sp->port = port; - sp->age = age; - sp->when = now; - sp->lifetime = 4; - } - sp->refresh = 1; - + } /* Use converted status and player values */ sp->status = tempstatus; sp->players = tempplayers; + sp->refresh = 1; + sp->typeflag = type; strcpy(sp->comment, ""); #ifdef METAPING @@ -778,8 +780,9 @@ FILE *cache; char cacheFileName[PATH_MAX]; char tmpFileName[PATH_MAX]; + char str[LINE]; char *cacheName; - int len; + int i, len; cacheName = stringDefault("metaUDPCache"); /* overwrite existing file if possible */ @@ -811,14 +814,29 @@ cache = NULL; } - if (cache != NULL) { - - fwrite(&statusLevel, sizeof(statusLevel), 1, cache); - fwrite(&num_servers, sizeof(num_servers), 1, cache); - fwrite(serverlist, sizeof(struct servers), num_servers, cache); - + /* Save status level and number of servers on first line - these variables + determine whether to use the cache during LoadMetasCache() */ + sprintf (str, "%d,%d\n", statusLevel, num_servers); + fputs (str, cache); + + /* Save important data in a similar, but not identical, manner to how the + metaserver sends the UDP metadata. The internal status types are not saved, + instead they default to "Active". */ + for (i = 0; i < num_servers; i++) + { + sprintf(str,"%s,%d,%lld,%d,%d,%d,%d,%c\n", + serverlist[i].address, + serverlist[i].port, + serverlist[i].when, + serverlist[i].age, + serverlist[i].lifetime, + serverlist[i].players, + ((serverlist[i].status <= statusNull) ? serverlist[i].status : statusNull), + serverlist[i].typeflag); + fputs (str, cache); + } fclose(cache); /* Can't rename file to existing name under NT */ @@ -838,8 +856,12 @@ { FILE *cache; char *cacheName; + char *buffer; + char *p; char cacheFileName[PATH_MAX]; + long lSize; int i, j; + int invalid[MAX_SERVERS] = {0}; cacheName = stringDefault("metaUDPCache"); @@ -857,31 +879,133 @@ num_servers = 0; return; } - - /* ignore the cache if user changed statusLevel */ - fread(&i, sizeof(i), 1, cache); + /* Obtain file size. */ + fseek (cache , 0 , SEEK_END); + lSize = ftell (cache); + rewind (cache); + + /* Allocate memory to contain the whole file. */ + buffer = (char*) malloc (lSize); + if (buffer == NULL) + { + num_servers = 0; + fclose(cache); + return; + } + + /* Copy the file into the buffer. */ + fread (buffer,1,lSize,cache); + + /* Read in statusLevel */ + p = strtok(buffer,","); + if (p == NULL) + { + num_servers = 0; + fclose(cache); + return; + } + i = atoi(p); + + /* Ignore the cache if user changed statusLevel */ if (i != statusLevel) { num_servers = 0; fclose(cache); return; } - + + /* Read in number of servers */ + p = strtok(NULL,"\n"); + if (p == NULL) + { + num_servers = 0; + fclose(cache); + return; + } + num_servers = atoi(p); - /* read the server list into memory from the file */ - fread(&num_servers, sizeof(num_servers), 1, cache); + /* Allocate memory for server list */ serverlist = (struct servers *) malloc(sizeof(struct servers)*num_servers); - fread(serverlist, sizeof(struct servers), num_servers, cache); + + /* Load servers into server list */ + for(i = 0; i < num_servers; i++) + { + p = strtok(NULL,","); /* hostname */ + if (p == NULL) { + invalid[i] = 1; + continue; + } + strcpy(serverlist[i].address, p); + + p = strtok(NULL,","); /* port */ + if (p == NULL) { + invalid[i] = 1; + continue; + } + serverlist[i].port = atoi(p); + + p = strtok(NULL,","); /* when */ + if (p == NULL) { + invalid[i] = 1; + continue; + } + serverlist[i].when = atoi(p); + + p = strtok(NULL,","); /* age */ + if (p == NULL) { + invalid[i] = 1; + continue; + } + serverlist[i].age = atoi(p); + + p = strtok(NULL,","); /* lifetime */ + if (p == NULL) { + invalid[i] = 1; + continue; + } + serverlist[i].lifetime = atoi(p); + + p = strtok(NULL,","); /* players */ + if (p == NULL) { + invalid[i] = 1; + continue; + } + serverlist[i].players = atoi(p); + + p = strtok(NULL,","); /* status */ + if (p == NULL) { + invalid[i] = 1; + continue; + } + serverlist[i].status = atoi(p); + + p = strtok(NULL,"\n"); /* type */ + if (p == NULL) { + invalid[i] = 1; + continue; + } + serverlist[i].typeflag = p[0]; + + strcpy(serverlist[i].comment, ""); + + /* mark each server as needing to be refreshed */ + serverlist[i].refresh = 1; + +#ifdef METAPING + /* Initialize the ping rtt fields */ + for (j = 0; j < RTT_AVG_BUFLEN; ++j ) + serverlist[i].pkt_rtt[j] = (unsigned long) -1; +#endif + } + fclose(cache); - + /* hunt and kill old server lines from cache */ for(i=0;i 0) continue; + /* skip the deletion below if the entry was received recently, + and all the data was valid */ + if (serverlist[i].lifetime-- > 0 && !invalid[i]) continue; /* delete this entry by moving the ones above down */ for(j=i;j serverlist[i+1].players) + change = 1; + } + else + { + /* If the server above it has a wait queue, don't swap. */ + if (serverlist[i+1].status != statusWait) + { + /* Server has wait queue? Swap up (since we know the one above + doesn't have a queue */ + if (serverlist[i].status == statusWait) + change = 1; + /* Server has lower status? Swap up */ + else if (serverlist[i].status < serverlist[i+1].status) + change = 1; + } + } + if (change) + { + /* Copy bottom entry (i) into temp space */ + strcpy (tempaddress, serverlist[i].address); + tempport = serverlist[i].port; + tempage = serverlist[i].age; + tempwhen = serverlist[i].when; + temprefresh = serverlist[i].refresh; + templifetime = serverlist[i].lifetime; + tempplayers = serverlist[i].players; + tempstatus = serverlist[i].status; + temptypeflag = serverlist[i].typeflag; + strcpy (tempcomment, serverlist[i].comment); +#ifdef METAPING + tempip_addr = serverlist[i].ip_addr; + for (j = 0; j < RTT_AVG_BUFLEN; j++) + temppkt_rtt[j] = serverlist[i].pkt_rtt[j]; +#endif + /* Move top entry (i+1) into bottom entry (i) */ + strcpy (serverlist[i].address, serverlist[i+1].address); + serverlist[i].port = serverlist[i+1].port; + serverlist[i].age = serverlist[i+1].age; + serverlist[i].when = serverlist[i+1].when; + serverlist[i].refresh = serverlist[i+1].refresh; + serverlist[i].lifetime = serverlist[i+1].lifetime; + serverlist[i].players = serverlist[i+1].players; + serverlist[i].status = serverlist[i+1].status; + serverlist[i].typeflag = serverlist[i+1].typeflag; + strcpy (serverlist[i].comment, serverlist[i+1].comment); +#ifdef METAPING + serverlist[i].ip_addr = serverlist[i+1].ip_addr; + for (j = 0; j < RTT_AVG_BUFLEN; j++) + serverlist[i].pkt_rtt[j] = serverlist[i+1].pkt_rtt[j]; +#endif + /* Copy temp entry into top entry (i+1) */ + strcpy (serverlist[i+1].address, tempaddress); + serverlist[i+1].port = tempport; + serverlist[i+1].age = tempage; + serverlist[i+1].when = tempwhen; + serverlist[i+1].refresh = temprefresh; + serverlist[i+1].lifetime = templifetime; + serverlist[i+1].players = tempplayers; + serverlist[i+1].status = tempstatus; + serverlist[i+1].typeflag = temptypeflag; + strcpy (serverlist[i+1].comment, tempcomment); +#ifdef METAPING + serverlist[i+1].ip_addr = tempip_addr; + for (j = 0; j < RTT_AVG_BUFLEN; j++) + serverlist[i+1].pkt_rtt[j] = temppkt_rtt[j]; +#endif + /* Start back at beginning - could be more efficient */ + i = 0; + change = 0; + } + } +} static void metarefresh (int i, @@ -1383,6 +1615,11 @@ W_WriteText(metaWin, 0, 0, W_Yellow, header, strlen(header), 0); + /* Sort the server list */ + if (type == 1) + metasort(); + + /* Write the metaserver lines */ for (i = 0; i < metaHeight; i++) metarefresh (i, textColor); @@ -1481,6 +1718,7 @@ { W_WriteText(metaWin, 0, metaHeight-3, W_Red, "Asking for refresh from metaservers and nearby servers", 54, 0); ReadMetasSend(); + metasort(); } else if (data->y == (metaHeight-2)) /* Quit selected */ { @@ -1793,7 +2031,7 @@ serverlist[i].ip_addr = inet_addr(serverlist[i].address); // INADDR_NONE if failed else serverlist[i].ip_addr = *((u_long FAR *) (hp->h_addr)); - } + } // Create a Raw socket rawSocket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- data.c 29 Nov 2006 15:01:33 -0000 1.44 +++ data.c 2 Dec 2006 11:24:43 -0000 1.45 @@ -229,7 +229,7 @@ #ifdef META /* Metaservers list - comma delimited */ -char *metaServer = "metaserver.us.netrek.org, metaserver2.us.netrek.org"; +char *metaServer = "metaserver.us.netrek.org, metaserver2.us.netrek.org, metaserver.servegame.org"; int metaPort = 3521; int metaVerbose = 0; char *metaCache = NULL; From modemhero at users.sourceforge.net Sat Dec 2 05:24:44 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 02 Dec 2006 11:24:44 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.78, 1.79 clientr.suo, 1.47, 1.48 Message-ID: <20061202112455.50A62B3EB@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7612 Modified Files: NetrekXP to do list.C clientr.suo Log Message: hints.dat; updated with new hints regarding changes to close windows and det circle functionality data.c: addition of 3rd metaserver to client. This new metaserver entry is a static DNS that is currently pointing to the IP address of metaserver2.us.netrek.org, but can be changed if needed to point to a non *.netrek.org metaserver, providing a failsafe in case of critical loss of metaserver facilities. The DNS entry is currently controlled by the client author (Bill Balcerski). Multiple minor changes in parsemeta.c, such as formalizing a value for MAX_SERVERS, removing an unneeded variable in a sscanf call in parseInput(). parsemeta.c (version_r()): Handle the new server entry case before the old server entry case, to mimic how other functions are written. parsemeta.c (SaveMetasCache): Rewritten to save data as text rather than a binary file. parsemeta.c (LoadMetasCache): Rerwritten to load the new text cache file into a buffer, and parse the data, making sure to check for invalid entries. parsemeta.c (metasort): New function that sorts servers by status and player count, in the case of the UDP metaserver, as server order in the server list array may need to be changed as servers gain or lose players. Called upon metawindow creation, and any time the user requests a server refresh. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- NetrekXP to do list.C 1 Dec 2006 00:43:10 -0000 1.78 +++ NetrekXP to do list.C 2 Dec 2006 11:24:40 -0000 1.79 @@ -54,6 +54,7 @@ to save settings. Text in windows should adjust to new window size. 2) Save options for observer/servernick/servertype need to be saved 4) Get source code for installer from Joe. +4a) Add a Cambot playback and Cambot record shortcut links to the installation package. 5) Get square planet bitmaps so I can turn them into mapped rotating globes. 7) problem with message windows, text getting garbled near top, goes away with flushing with scroll button. Doesn't show up initially, but do something like use @@ -68,11 +69,8 @@ Stas's list: - color coded playerlist. -- check inl server for behavior (observers and tractor/pressor packets) ! server: ita won't block RCDs (why not ?) -- add usage on metaserver window (well, what would you write there ?) ! after res if there cloaker around he will be seen briefly (speed 0 bug) -- whydead dies when out of range (not confirmed) - add "reset to defaults" to options menu - add bitmap themes option (change default bitmap naming and processing) - add shiftMouse, controlMouse on/off Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 Binary files /tmp/cvsTUtqrJ and /tmp/cvsrNxYLA differ From modemhero at users.sourceforge.net Sat Dec 2 05:24:45 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 02 Dec 2006 11:24:45 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs hints.dat,1.8,1.9 Message-ID: <20061202112455.5483AB400@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7612/resources/docs Modified Files: hints.dat Log Message: hints.dat; updated with new hints regarding changes to close windows and det circle functionality data.c: addition of 3rd metaserver to client. This new metaserver entry is a static DNS that is currently pointing to the IP address of metaserver2.us.netrek.org, but can be changed if needed to point to a non *.netrek.org metaserver, providing a failsafe in case of critical loss of metaserver facilities. The DNS entry is currently controlled by the client author (Bill Balcerski). Multiple minor changes in parsemeta.c, such as formalizing a value for MAX_SERVERS, removing an unneeded variable in a sscanf call in parseInput(). parsemeta.c (version_r()): Handle the new server entry case before the old server entry case, to mimic how other functions are written. parsemeta.c (SaveMetasCache): Rewritten to save data as text rather than a binary file. parsemeta.c (LoadMetasCache): Rerwritten to load the new text cache file into a buffer, and parse the data, making sure to check for invalid entries. parsemeta.c (metasort): New function that sorts servers by status and player count, in the case of the UDP metaserver, as server order in the server list array may need to be changed as servers gain or lose players. Called upon metawindow creation, and any time the user requests a server refresh. Index: hints.dat =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/hints.dat,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- hints.dat 24 Jun 2006 23:48:57 -0000 1.8 +++ hints.dat 2 Dec 2006 11:24:42 -0000 1.9 @@ -1,5 +1,7 @@ -to disable this window permanently you should add "showHints: off" to your rc file -the red circle you may see around your ship is the range at which you can detonate enemy torpedoes, you can turn this circle off through the ship menu. +to disable this window permanently you should add "showHints: off" to your rc file. +you can close this window with shift-right click if you don't have a middle mouse button. +most windows (such as this one) can be closed by the unmap special windows key. +the red circle you may see flash around your ship when detting is the range at which you can detonate enemy torpedoes, you can turn this circle off through the ship menu. you can use Alt+Enter to toggle the main title bar on and off. you can send messages from the player list window. Left click for individual messages, middle mouse button click for all board messages, and right click for team messages. you can remap keys by pointing at the key in the help window and pushing the key you want that option to be. From modemhero at users.sourceforge.net Sat Dec 9 04:18:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 09 Dec 2006 10:18:30 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.79, 1.80 clientr.suo, 1.48, 1.49 Message-ID: <20061209101839.94F0EB3F0@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30613 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Removed several solved bugs, both from client and server, from the todo list. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- NetrekXP to do list.C 2 Dec 2006 11:24:40 -0000 1.79 +++ NetrekXP to do list.C 9 Dec 2006 10:18:27 -0000 1.80 @@ -7,7 +7,6 @@ 1) Player list messaging doesn't work if you can't see player (cloaked, too far away, etc). Don't think this is fixable. 2) torp_other and plasma_other not working right due to lack of torp fuse info -3) Can't bomb enemy 3rd space planets in your T-mode opponent's space. 4) in orbit.c, pftranswarp strangeness. 5) look into swar/war in repair time, with obs and plr - doesn't seem to be any way for an obs to know what the war decs are of the person he is observing. Best solution @@ -17,19 +16,12 @@ where a ship is seen to have pressors on constantly, even when they are off 8) Triple mode blanks planet names, if you vote to dogfight or hockey, names are not restored 9) "The 0 0 20 minutes before empire collapses" - with surrenderstart = 1 -11) all observer ghostbusts now do a double ghostbust: no ping observ, no ping alive 12) mars - lose nb_robots 13) newbie/pret: monitor vs full_hostname 14) on daemon exit in newbie/pret, kill any hosed bot slots 15) end game bots are stupid, and on timericide don't act right 16) if obs in game when merlin quits, queues still open..should be closed dammit 17) final planet count and cscore would be nice in pw_stats - -Sturgeon problems -1) after free upgrade, ship cap packet not being sent to everyone..seems to - only be sent to 1 person. -1b) someone got my super ship cap packet when he had a normal GA -2) need ship cap packet sent after xtkill super Things that go wrong when short packets are on: 1) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did if Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 Binary files /tmp/cvsA3PJlF and /tmp/cvsVEkSBp differ From modemhero at users.sourceforge.net Sat Dec 9 20:49:16 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 10 Dec 2006 02:49:16 +0000 Subject: [netrek-cvs] client/netrekxp/src cowmain.c, 1.18, 1.19 planetlist.c, 1.2, 1.3 short.c, 1.9, 1.10 socket.c, 1.9, 1.10 Message-ID: <20061210024925.061E428FD5@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15113/src Modified Files: cowmain.c planetlist.c short.c socket.c Log Message: planetlist.c: New function updatePlanetw(), which only updates lines in the planet list if the new formatted planet string differs from the prior string. Prior strings are stored in a static priorplanets string array. Planetlist() rewritten to initialize string array to blank strings then call updatePlanetw(). socket.c, short.c: Call to updatePlanetw() when new planet data is received Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- short.c 26 May 2006 05:58:08 -0000 1.9 +++ short.c 10 Dec 2006 02:49:14 -0000 1.10 @@ -1191,6 +1191,8 @@ #endif /* ATM */ } /* FOR */ + if (W_IsMapped (planetw)) /* planet window */ + updatePlanetw (); } Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- cowmain.c 1 Dec 2006 00:43:11 -0000 1.18 +++ cowmain.c 10 Dec 2006 02:49:14 -0000 1.19 @@ -1046,10 +1046,10 @@ W_MapWindow (hintWin); if (W_IsMapped (pStats)) /* support ping stuff */ - { - BringWindowToTop (((Window *) pStats)->hwnd); + { + BringWindowToTop (((Window *) pStats)->hwnd); redrawPStats (); - } + } if (isFirstEntry) { Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- socket.c 30 Nov 2006 01:32:36 -0000 1.9 +++ socket.c 10 Dec 2006 02:49:14 -0000 1.10 @@ -1577,6 +1577,8 @@ { plan->pl_flags |= PLREDRAW; } + if (W_IsMapped (planetw)) /* planet window */ + updatePlanetw (); } void Index: planetlist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/planetlist.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- planetlist.c 16 May 2006 05:10:13 -0000 1.2 +++ planetlist.c 10 Dec 2006 02:49:14 -0000 1.3 @@ -18,6 +18,11 @@ #include "data.h" #include "proto.h" +/* Local functions */ +void updatePlanetw (void); + +static char priorplanets[MAXPLANETS][BUFSIZ]; + static char *teamname[9] = { "IND", "FED", @@ -33,19 +38,29 @@ /* * Open a window which contains all the planets and their current * * statistics. Players will not know about planets that their team * has not * orbited. */ - void planetlist (void) { register int i; - register int k = 0; char buf[BUFSIZ]; - register struct planet *j; /* W_ClearWindow(planetw); */ (void) sprintf (buf, "Planet Name own armies REPAIR FUEL AGRI CORE info"); W_WriteText (planetw, 2, 1, textColor, buf, strlen (buf), W_RegularFont); - k = 2; + /* Initialize planet window string array */ + for (i = 0; i < MAXPLANETS; i++) + strcpy(priorplanets[i], ""); + updatePlanetw (); +} + +/* Update only lines that have changed */ +void +updatePlanetw (void) +{ + register int i; + char buf[BUFSIZ]; + register struct planet *j; + for (i = 0, j = &planets[i]; i < MAXPLANETS; i++, j++) { if (j->pl_info & me->p_team) @@ -62,14 +77,24 @@ (j->pl_info & ROM ? 'R' : ' '), (j->pl_info & KLI ? 'K' : ' '), (j->pl_info & ORI ? 'O' : ' ')); - W_WriteText (planetw, 2, k++, planetColor (j), buf, strlen (buf), - planetFont (j)); + if (strcmp(priorplanets[i], buf)) + { + W_ClearArea (planetw, 2, i+2, 55, 1); + W_WriteText (planetw, 2, i+2, planetColor (j), buf, strlen (buf), + planetFont (j)); + strcpy(priorplanets[i], buf); + } } else { (void) sprintf (buf, "%-16s", j->pl_name); - W_WriteText (planetw, 2, k++, unColor, buf, strlen (buf), - W_RegularFont); + if (strcmp(priorplanets[i], buf)) + { + W_ClearArea (planetw, 2, i+2, 55, 1); + W_WriteText (planetw, 2, i+2, unColor, buf, strlen (buf), + W_RegularFont); + strcpy(priorplanets[i], buf); + } } } -} +} \ No newline at end of file From modemhero at users.sourceforge.net Sat Dec 9 20:49:16 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 10 Dec 2006 02:49:16 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.80, 1.81 clientr.suo, 1.49, 1.50 Message-ID: <20061210024924.DBDAF28FD4@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15113 Modified Files: NetrekXP to do list.C clientr.suo Log Message: planetlist.c: New function updatePlanetw(), which only updates lines in the planet list if the new formatted planet string differs from the prior string. Prior strings are stored in a static priorplanets string array. Planetlist() rewritten to initialize string array to blank strings then call updatePlanetw(). socket.c, short.c: Call to updatePlanetw() when new planet data is received Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- NetrekXP to do list.C 9 Dec 2006 10:18:27 -0000 1.80 +++ NetrekXP to do list.C 10 Dec 2006 02:49:13 -0000 1.81 @@ -7,7 +7,6 @@ 1) Player list messaging doesn't work if you can't see player (cloaked, too far away, etc). Don't think this is fixable. 2) torp_other and plasma_other not working right due to lack of torp fuse info -4) in orbit.c, pftranswarp strangeness. 5) look into swar/war in repair time, with obs and plr - doesn't seem to be any way for an obs to know what the war decs are of the person he is observing. Best solution is to just have server send repair time and planet orbit info. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 Binary files /tmp/cvsZvdRQJ and /tmp/cvseOD6uQ differ From modemhero at users.sourceforge.net Sat Dec 9 20:49:16 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 10 Dec 2006 02:49:16 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.93,1.94 Message-ID: <20061210024924.ECD78B3F0@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15113/resources/docs Modified Files: changes.txt Log Message: planetlist.c: New function updatePlanetw(), which only updates lines in the planet list if the new formatted planet string differs from the prior string. Prior strings are stored in a static priorplanets string array. Planetlist() rewritten to initialize string array to blank strings then call updatePlanetw(). socket.c, short.c: Call to updatePlanetw() when new planet data is received Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- changes.txt 29 Nov 2006 15:09:35 -0000 1.93 +++ changes.txt 10 Dec 2006 02:49:14 -0000 1.94 @@ -1,4 +1,5 @@ Netrek XP 2006, Version 1.2: +- planet window now updates regularly when planet status changes - det circle changed so it only flashes on det, rather than be on all the time - added "metaVerbose: on/(off)" and "metaUDPCache: (filename)" options to netrekrc and help docs, these were part of the UDP metaserver merge From modemhero at users.sourceforge.net Mon Dec 11 22:47:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 12 Dec 2006 04:47:10 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.45, 1.46 defaults.c, 1.34, 1.35 feature.c, 1.3, 1.4 planetlist.c, 1.3, 1.4 playback.c, 1.14, 1.15 socket.c, 1.10, 1.11 Message-ID: <20061212044721.EAAFAB3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5901/src Modified Files: data.c defaults.c feature.c planetlist.c playback.c socket.c Log Message: Added support for new server feature packet FULL_DIRECTION_RESOLUTION. Added partial support for support for new server feature packet SP_GENERIC_32. Added new netrekrc option useFullShipInfo, to determine whether user wants to use the FULL_DIRECTION_RESOLUTION feature packet (all other feature packets are hard coded in as to on/off). Index: planetlist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/planetlist.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- planetlist.c 10 Dec 2006 02:49:14 -0000 1.3 +++ planetlist.c 12 Dec 2006 04:47:08 -0000 1.4 @@ -18,9 +18,6 @@ #include "data.h" #include "proto.h" -/* Local functions */ -void updatePlanetw (void); - static char priorplanets[MAXPLANETS][BUFSIZ]; static char *teamname[9] = { Index: playback.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playback.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- playback.c 29 Nov 2006 12:40:22 -0000 1.14 +++ playback.c 12 Dec 2006 04:47:08 -0000 1.15 @@ -506,6 +506,7 @@ case SP_S_YOU_SS: case SP_S_PLAYER: case SP_SHIP_CAP: + case SP_GENERIC_32: case SP_S_TORP: case SP_S_TORP_INFO: case SP_S_8_TORP: Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- defaults.c 30 Nov 2006 11:28:56 -0000 1.34 +++ defaults.c 12 Dec 2006 04:47:06 -0000 1.35 @@ -749,6 +749,12 @@ NULL } }, + {"useFullShipInfo", &useFullShipInfo, RC_BOOL, + { + "Display other ships to 256 directions instead of 16", + NULL + } + }, #ifdef BEEPLITE {"useLite", &useLite, RC_BOOL, { @@ -1491,6 +1497,7 @@ newQuit = booleanDefault ("newQuit", newQuit); newSound = booleanDefault ("newSound", newSound); newSoundAngles = booleanDefault ("newSoundAngles", newSoundAngles); + useFullShipInfo = booleanDefault ("useFullShipInfo", useFullShipInfo); tpDotDist = intDefault ("tpDotDist", tpDotDist); omitTeamLetter = booleanDefault ("omitTeamLetter", omitTeamLetter); beepOnPrivateMessage = booleanDefault ("beepOnPrivateMessage", beepOnPrivateMessage); Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- data.c 2 Dec 2006 11:24:43 -0000 1.45 +++ data.c 12 Dec 2006 04:47:05 -0000 1.46 @@ -660,6 +660,8 @@ int F_self_19flags = 1; int F_ship_cap = 0; int F_show_all_tractors = 1; +int F_sp_generic_32 = 0; +int F_full_direction_resolution = 0; #ifdef RECORDGAME int F_many_self = 0; @@ -786,4 +788,6 @@ int richText = 0; /* temporary variable to select rich text message windows */ int newQuit = 0; /* new quit clock */ int newSound = 1; /* use new SDL sound */ -int newSoundAngles = 1; /* use new SDL sound with angular 3d component */ \ No newline at end of file +int newSoundAngles = 1; /* use new SDL sound with angular 3d component */ + +int useFullShipInfo = 1; /* Prefer SP_PLAYER packets over SP_S_PLAYER packets */ \ No newline at end of file Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- feature.c 21 Apr 2006 12:00:06 -0000 1.3 +++ feature.c 12 Dec 2006 04:47:08 -0000 1.4 @@ -76,6 +76,8 @@ {"SELF_8FLAGS2", &F_self_8flags2, 'S', 0, 0, 0}, {"19FLAGS", &F_self_19flags, 'S', 1, 0, 0}, {"SHIP_CAP", &F_ship_cap, 'S', 1, 0, 0}, + {"SP_GENERIC_32", &F_sp_generic_32, 'S', 1, 0, 0}, + {"FULL_DIRECTION_RESOLUTION", &F_full_direction_resolution, 'S', 1, 0, 0}, #ifdef WARP_DEAD {"DEAD_WARP", &F_dead_warp, 'S', 1, 0, 0}, @@ -107,12 +109,13 @@ if (strcmpi (f->name, "FEATURE_PACKETS") != 0) sendFeature (f->name, f->feature_type, - f->value, + (!strcmp(f->name, "FULL_DIRECTION_RESOLUTION") ? useFullShipInfo : f->value), (char) (f->arg1 ? *f->arg1 : 0), (char) (f->arg2 ? *f->arg2 : 0)); #ifdef DEBUG - LineToConsole ("(C->S) %s (%c): %d\n", f->name, f->feature_type, f->value); + LineToConsole ("(C->S) %s (%c): %d\n", f->name, f->feature_type, + !strcmp(f->name, "FULL_DIRECTION_RESOLUTION") ? useFullShipInfo : f->value); #endif } } Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- socket.c 10 Dec 2006 02:49:14 -0000 1.10 +++ socket.c 12 Dec 2006 04:47:08 -0000 1.11 @@ -145,7 +145,7 @@ {0, dummy}, /* #31, and dummy won't */ #endif - {0, dummy}, /* 32 */ + {sizeof (struct generic_32_spacket), handleGeneric32}, /* SP_GENERIC_32 */ {0, dummy}, /* 33 */ {0, dummy}, /* 34 */ {0, dummy}, /* 35 */ @@ -1680,6 +1680,8 @@ strcpy (packet.login, login); packet.type = CP_LOGIN; packet.query = query; + //packet.pad2 = 0x69; /* Paradise support */ + //packet.pad3 = 0x43; /* Paradise support */ sendServerPacket ((struct player_spacket *) &packet); } @@ -2360,6 +2362,29 @@ redrawStats (); } +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); +*/ + +} + #ifdef RSA void handleRSAKey (struct rsa_key_spacket *packet) From modemhero at users.sourceforge.net Mon Dec 11 22:47:07 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 12 Dec 2006 04:47:07 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.41, 1.42 packets.h, 1.1.1.1, 1.2 proto.h, 1.25, 1.26 Message-ID: <20061212044745.B4178B3F0@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5901/include Modified Files: data.h packets.h proto.h Log Message: Added support for new server feature packet FULL_DIRECTION_RESOLUTION. Added partial support for support for new server feature packet SP_GENERIC_32. Added new netrekrc option useFullShipInfo, to determine whether user wants to use the FULL_DIRECTION_RESOLUTION feature packet (all other feature packets are hard coded in as to on/off). Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- data.h 29 Nov 2006 15:01:33 -0000 1.41 +++ data.h 12 Dec 2006 04:47:05 -0000 1.42 @@ -555,6 +555,8 @@ extern int F_self_19flags; extern int F_ship_cap; extern int F_show_all_tractors; +extern int F_sp_generic_32; +extern int F_full_direction_resolution; #ifdef RECORDGAME extern int F_many_self; @@ -689,4 +691,6 @@ extern int newQuit; /* new quit clock */ extern int newSound; /* Use new SDL sound interface */ extern int newSoundAngles; /* Use SDL with angular 3D sound */ + +extern int useFullShipInfo; /* Prefer SP_PLAYER packets over SP_S_PLAYER packets */ #endif /* _h_data */ Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- packets.h 21 Jan 2003 21:27:54 -0000 1.1.1.1 +++ packets.h 12 Dec 2006 04:47:05 -0000 1.2 @@ -83,7 +83,9 @@ * verification */ #endif -#define SP_SHIP_CAP 39 /* Handles server ship mods */ +#define SP_GENERIC_32 32 /* 32 byte packet, currently sends ship + repair time, room for future info */ +#define SP_SHIP_CAP 39 /* Handles server ship mods */ #ifdef SHORT_PACKETS #define SP_S_REPLY 40 /* reply to send-short @@ -871,6 +873,13 @@ unsigned short s_bitmap; }; +struct generic_32_spacket { + char type; /* SP_GENERIC_32 Header */ + char version; + int repair_time; /* Estimated repair time, in seconds */ + char pad1; /* TODO: Change to union */ +}; + #ifdef SHORT_PACKETS struct shortreq_cpacket { /* CP_S_REQ */ Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- proto.h 6 Jun 2006 19:50:38 -0000 1.25 +++ proto.h 12 Dec 2006 04:47:05 -0000 1.26 @@ -864,6 +864,7 @@ /*** planetlist.c /******************************************************************************/ void planetlist (void); +void updatePlanetw (void); /******************************************************************************/ /*** playback.c @@ -1107,6 +1108,8 @@ int sock); struct ship_cap_spacket; void handleShipCap (struct ship_cap_spacket *packet); +struct generic_32_spacket; +void handleGeneric32 (struct generic_32_spacket *packet); struct rsa_key_spacket; void handleRSAKey (struct rsa_key_spacket *packet); #ifdef INCLUDE_SCAN From modemhero at users.sourceforge.net Mon Dec 11 22:47:07 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 12 Dec 2006 04:47:07 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.94, 1.95 netrekrc, 1.13, 1.14 netrekrc_options.txt, 1.18, 1.19 Message-ID: <20061212044745.C021D28F17@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5901/resources/docs Modified Files: changes.txt netrekrc netrekrc_options.txt Log Message: Added support for new server feature packet FULL_DIRECTION_RESOLUTION. Added partial support for support for new server feature packet SP_GENERIC_32. Added new netrekrc option useFullShipInfo, to determine whether user wants to use the FULL_DIRECTION_RESOLUTION feature packet (all other feature packets are hard coded in as to on/off). Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- netrekrc 29 Nov 2006 15:01:33 -0000 1.13 +++ netrekrc 12 Dec 2006 04:47:05 -0000 1.14 @@ -388,6 +388,9 @@ # 1-10 range updatesPerSec: 10 +# Display other ships to 256 directions instead of 16 +useFullShipInfo: on + # Use beeplite useLite: on Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- netrekrc_options.txt 29 Nov 2006 15:01:33 -0000 1.18 +++ netrekrc_options.txt 12 Dec 2006 04:47:05 -0000 1.19 @@ -275,6 +275,7 @@ udpDebug: (0/1) debug UDP traffic udpSequenceCheck: (on/off) check UDP sequence updatesPerSec: (0-10) how much data updates per second to request from server +useFullShipInfo: (on/off) display other ships to 256 directions instead of 16 useLite: (on/off) use beeplite defLite: (on/off) use default beeplite settings useRSA: (on/off) use RSA client verification Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- changes.txt 10 Dec 2006 02:49:14 -0000 1.94 +++ changes.txt 12 Dec 2006 04:47:05 -0000 1.95 @@ -1,4 +1,16 @@ Netrek XP 2006, Version 1.2: +- added "UseFullShipInfo: (on)/off" to choose whether to use short or long type packets + for other player info. Default is on. This netrekrc setting controls whether the + feature packet FULL_DIRECTION_RESOLUTION is used. +- support for new server feature packet FULL_DIRECTION_RESOLUTION. This is a great change, + for it now uses long packets instead of short packets for other players ship info. + This means, finally, other ships can be displayed to 256 directions instead of 16, + and other player's speeds can be displayed correctly above warp 16. For those using + the high res bitmap sets, it is a subtle yet noticeable improvement. The one downside + is the player packets are now 12 bytes instead of 4 bytes. At 10 updates/sec and 10 + players on the screen, it is an extra 800 bytes/sec, or .8 kb/sec, of bandwidth. If + you can't afford that bandwidth, you probably have no business being on the internet, + anyways. - planet window now updates regularly when planet status changes - det circle changed so it only flashes on det, rather than be on all the time - added "metaVerbose: on/(off)" and "metaUDPCache: (filename)" options to netrekrc From modemhero at users.sourceforge.net Mon Dec 11 22:47:07 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 12 Dec 2006 04:47:07 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.20, 1.21 Message-ID: <20061212044745.9EA3C28F13@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5901/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Added support for new server feature packet FULL_DIRECTION_RESOLUTION. Added partial support for support for new server feature packet SP_GENERIC_32. Added new netrekrc option useFullShipInfo, to determine whether user wants to use the FULL_DIRECTION_RESOLUTION feature packet (all other feature packets are hard coded in as to on/off). Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- generalconfig.html 29 Nov 2006 15:01:33 -0000 1.20 +++ generalconfig.html 12 Dec 2006 04:47:05 -0000 1.21 @@ -1264,6 +1264,16 @@ 1-10
default: 10 +useFullShipInfo +Display other ships to 256 directions instead of 16 + + + + + useRsa Use RSA client verification From modemhero at users.sourceforge.net Mon Dec 11 22:47:07 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 12 Dec 2006 04:47:07 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.81, 1.82 clientr.suo, 1.50, 1.51 Message-ID: <20061212044745.5645FB3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5901 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Added support for new server feature packet FULL_DIRECTION_RESOLUTION. Added partial support for support for new server feature packet SP_GENERIC_32. Added new netrekrc option useFullShipInfo, to determine whether user wants to use the FULL_DIRECTION_RESOLUTION feature packet (all other feature packets are hard coded in as to on/off). Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- NetrekXP to do list.C 10 Dec 2006 02:49:13 -0000 1.81 +++ NetrekXP to do list.C 12 Dec 2006 04:47:04 -0000 1.82 @@ -25,10 +25,6 @@ Things that go wrong when short packets are on: 1) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did if there is no movement anywhere on map, and observer sound also messes up -2) The new smooth turning only working on self, not obs or others - short packets only -send headings of 16 positions. -3) Others speed only sent to 16..messed up for obs locked onto puck in hockey, -or twarpers Things that are sorta fixed, but could use improvement: 1) Bug with waraction..was being called even when clicking on border (broke function) Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 Binary files /tmp/cvsh2L56z and /tmp/cvscCGcQr differ From modemhero at users.sourceforge.net Tue Dec 12 18:00:02 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 00:00:02 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.82, 1.83 clientr.suo, 1.51, 1.52 Message-ID: <20061213000013.30A8EB3F6@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26714 Modified Files: NetrekXP to do list.C clientr.suo 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: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- NetrekXP to do list.C 12 Dec 2006 04:47:04 -0000 1.82 +++ NetrekXP to do list.C 12 Dec 2006 23:59:58 -0000 1.83 @@ -2,57 +2,50 @@ 1) there should be some sort of chance to give default resolution in GUI, which then maps windows accordingly. 2) fix netrekrc append so that it doesn't keep adding new lines to the netrekrc +3) Get source code for installer from Joe. +4) Add a Cambot playback and Cambot record shortcut links to the installation package. Things not gonna happen, or server problems: 1) Player list messaging doesn't work if you can't see player (cloaked, too far away, etc). Don't think this is fixable. 2) torp_other and plasma_other not working right due to lack of torp fuse info -5) look into swar/war in repair time, with obs and plr - doesn't seem to be any way -for an obs to know what the war decs are of the person he is observing. Best solution -is to just have server send repair time and planet orbit info. -6) twarping to base docked on base causes the twarp problem, but hard to reproduce -7) Server sometimes not updating tract/press flags for observers, several instances +3) twarping to base docked on base causes the twarp problem, but hard to reproduce +4) Server sometimes not updating tract/press flags for observers, several instances where a ship is seen to have pressors on constantly, even when they are off -8) Triple mode blanks planet names, if you vote to dogfight or hockey, names are not restored -9) "The 0 0 20 minutes before empire collapses" - with surrenderstart = 1 -12) mars - lose nb_robots -13) newbie/pret: monitor vs full_hostname -14) on daemon exit in newbie/pret, kill any hosed bot slots -15) end game bots are stupid, and on timericide don't act right -16) if obs in game when merlin quits, queues still open..should be closed dammit -17) final planet count and cscore would be nice in pw_stats - -Things that go wrong when short packets are on: -1) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did if -there is no movement anywhere on map, and observer sound also messes up +5) Triple mode blanks planet names, if you vote to dogfight or hockey, names are not restored +6) "The 0 0 20 minutes before empire collapses" - with surrenderstart = 1 +7) mars - lose nb_robots +8) newbie/pret: monitor vs full_hostname +9) on daemon exit in newbie/pret, kill any hosed bot slots +10) end game bots are stupid, and on timericide don't act right +11) if obs in game when merlin quits, queues still open..should be closed dammit +12) final planet count and cscore would be nice in pw_stats Things that are sorta fixed, but could use improvement: -1) Bug with waraction..was being called even when clicking on border (broke function) -..I added a default return to switch statement, but the underlying bug still remains. -2) Border issue - quite complex problem, how to know the borders to obey after the bitmap +1) Border issue - quite complex problem, how to know the borders to obey after the bitmap is rotated. Only solution so far is to ignore borders with scaled bitmaps. -3) AddFontResourceEx caused problems with win 98 machines. Commented out, and using +2) AddFontResourceEx caused problems with win 98 machines. Commented out, and using old AddFontResource function. -4) planet resource placement and refresh (for new planet bitmaps) will need adjusting if +3) planet resource placement and refresh (for new planet bitmaps) will need adjusting if local is scaled Things to do: 1) resizeable message windows. Perhaps memory of window positions if you choose to save settings. Text in windows should adjust to new window size. 2) Save options for observer/servernick/servertype need to be saved -4) Get source code for installer from Joe. -4a) Add a Cambot playback and Cambot record shortcut links to the installation package. -5) Get square planet bitmaps so I can turn them into mapped rotating globes. -7) problem with message windows, text getting garbled near top, goes away with +3) Get square planet bitmaps so I can turn them into mapped rotating globes. +4) problem with message windows, text getting garbled near top, goes away with flushing with scroll button. Doesn't show up initially, but do something like use scroll button, alt-enter, change to review all..and it shows up. -7a) review all scrolling messes up text, if bottom of window is below the visible +4a) review all scrolling messes up text, if bottom of window is below the visible bottom border of netrek window. Actually will happen to whatever window is mapped down there at bottom of screen. Apprently the native windows function doesn't properly scroll text that is outside the viewable window. -8) Have client utilize new server torp vector code -10) Fade out ship explosion sound on quit -11) Pop-up dialog box for bad version response +5) Have client utilize new server torp vector code +6) Pop-up dialog box for bad version response +7) new UDP metaserver code has several problems re loading/saving metacache, status +field not updating due to refresh not happening when it should, metawindow still can't +handle correctly the case where servers would overwrite the quit button Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 Binary files /tmp/cvsBwVLve and /tmp/cvsIPRylD differ From modemhero at users.sourceforge.net Tue Dec 12 18:00:02 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 00:00:02 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.95, 1.96 netrekrc, 1.14, 1.15 Message-ID: <20061213000013.361D728F13@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26714/resources/docs Modified Files: changes.txt netrekrc 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: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- netrekrc 12 Dec 2006 04:47:05 -0000 1.14 +++ netrekrc 13 Dec 2006 00:00:00 -0000 1.15 @@ -8,7 +8,7 @@ buttonmap: 1P2k # Key mapping -keymap: Ppa%d_eyftg^jmnrpPrls3tfuwvDwsye dW Zv +keymap: PpW Zva%d_eyftg^jmnrpPrls3tfuwvDwsye d # Key to switch to macro mode # TAB, ESC could be used too @@ -113,7 +113,7 @@ # Start main window with title bar on (can be toggled by alt+enter) mainTitleBar: off -# maximum number of scroll lines in a message window (range of values 50-500) +# Maximum number of scroll lines in a message window (range of values 50-500) maxScrollLines: 300 # Message hold threshold @@ -389,6 +389,8 @@ updatesPerSec: 10 # Display other ships to 256 directions instead of 16 +# by using long ship packets instead of short ship packets, +# slight increase in bandwidth usage useFullShipInfo: on # Use beeplite @@ -878,11 +880,16 @@ macro.9.A:% .:>: .> >. :/*/:./.X__ | macro.9.A:% --------------------:--:--**#:-<<:^/^<**#**#**:._/--------/->--- -macro.).A: /* Get the latest version of Netrek XP 2006 today! */ -macro.).A: /* Current version is 1.1, released June 26, 2006 */ -macro.).A: /* Download it at http://www.netrek.org/files/NetrekXP_2006/ */ -macro.).A: /* or */ -macro.).A: /* http://www.playnetrek.org/ */ +macro.).A:/* Join the netrek clue game mailing list today! At */ +macro.).A:/* http://groups.google.com/group/netrek-clue-games */ +macro.).A:/* INL-style timed bronco games are every Wednesday */ +macro.).A:/* 10pm EST/7pm PST on ports 4566/4577 at netrek.warped.us */ + +macro.(.A: /* Get the latest version of Netrek XP 2006 today! */ +macro.(.A: /* Current version is 1.1, released June 26, 2006 */ +macro.(.A: /* Download it at http://www.netrek.org/files/NetrekXP_2006/ */ +macro.(.A: /* or */ +macro.(.A: /* http://www.playnetrek.org/ */ mac.e.T: Escorting %g (%d%%D %s%%S %f%%F) Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- changes.txt 12 Dec 2006 04:47:05 -0000 1.95 +++ changes.txt 13 Dec 2006 00:00:00 -0000 1.96 @@ -1,4 +1,9 @@ Netrek XP 2006, Version 1.2: +- sound now fades out over 1 second upon quitting +- support for new server feature packet SP_GENERIC_32. This is a great upgrade to the server + as it allows for future data to be sent in this packet (lots of empty room). Currently + it sends your ship's repair time..removing the need for the client side repair time + calculation, which had several flaws and didn't work well with observers. - added "UseFullShipInfo: (on)/off" to choose whether to use short or long type packets for other player info. Default is on. This netrekrc setting controls whether the feature packet FULL_DIRECTION_RESOLUTION is used. From modemhero at users.sourceforge.net Tue Dec 12 18:00:03 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 00:00:03 +0000 Subject: [netrek-cvs] client/netrekxp/src dashboard.c, 1.13, 1.14 data.c, 1.46, 1.47 defaults.c, 1.35, 1.36 input.c, 1.18, 1.19 local.c, 1.48, 1.49 parsemeta.c, 1.20, 1.21 socket.c, 1.11, 1.12 war.c, 1.2, 1.3 Message-ID: <20061213000015.AD3F628F17@smtpgrey-1.real-time.com> 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) From modemhero at users.sourceforge.net Tue Dec 12 18:00:02 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 00:00:02 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.42, 1.43 packets.h, 1.2, 1.3 struct.h, 1.11, 1.12 Message-ID: <20061213000015.D6B35B400@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26714/include Modified Files: data.h packets.h struct.h 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: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- data.h 12 Dec 2006 04:47:05 -0000 1.42 +++ data.h 13 Dec 2006 00:00:00 -0000 1.43 @@ -175,6 +175,7 @@ extern int colorWeapons; extern int newDashboard, old_db; extern int detCircle; +extern int showdetCircle; extern int puckCircle; extern int showArmy; extern int niftyNewMessages; Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- packets.h 12 Dec 2006 04:47:05 -0000 1.2 +++ packets.h 13 Dec 2006 00:00:00 -0000 1.3 @@ -874,12 +874,24 @@ }; struct generic_32_spacket { - char type; /* SP_GENERIC_32 Header */ - char version; - int repair_time; /* Estimated repair time, in seconds */ - char pad1; /* TODO: Change to union */ + char type; /* SP_GENERIC_32 */ + char version; /* alphabetic */ + short repair_time; /* server estimate of repair time in seconds */ + char pad1[28]; }; +/* versioning instructions: we start with version 'a', and each time a + field is added increment the version and reduce the pad size, + keeping the packet the same size ... client is entitled to trust + fields in struct that were defined at a particular version. */ + +/* + packet.type = SP_GENERIC_32; + packet.version = GENERIC_32_VERSION; + if (sizeof(struct generic_32_spacket) != GENERIC_32_LENGTH) abort(); +*/ + + #ifdef SHORT_PACKETS struct shortreq_cpacket { /* CP_S_REQ */ Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- struct.h 10 Aug 2006 10:00:52 -0000 1.11 +++ struct.h 13 Dec 2006 00:00:00 -0000 1.12 @@ -287,6 +287,7 @@ * lock */ int p_pos; /* My position in the player * file */ + short p_repair_time; /* estimated time in seconds to a full repair */ }; struct statentry From modemhero at users.sourceforge.net Tue Dec 12 21:14:58 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 03:14:58 +0000 Subject: [netrek-cvs] client/netrekxp/src defaults.c, 1.36, 1.37 parsemeta.c, 1.21, 1.22 sound.c, 1.18, 1.19 Message-ID: <20061213031508.D4F0EB3F2@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv357/src Modified Files: defaults.c parsemeta.c sound.c Log Message: Minor formatting fixes. Moved sound mixer error message to a DEBUG only statement. Added new tracking variable metaPartition to make sure metaserver doesn't try to display more lines than the window has allocated, in the case where 2nd or subsequent metaserver packets provide additional servers. If there are too many servers, metawindow closes, is redefined, and relaunched. Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- parsemeta.c 13 Dec 2006 00:00:00 -0000 1.21 +++ parsemeta.c 13 Dec 2006 03:14:54 -0000 1.22 @@ -110,6 +110,8 @@ int metaHeight = 0; /* The number of list lines. */ char *metaWindowName; /* The window's name. */ int statusLevel; +static int metaPartition = 0; /* Cutoff line at which servers end, + and bottom headers begin */ #ifdef METAPING u_short metaPing_procId = 0; /* Process id helps identify own ping replies */ @@ -760,6 +762,20 @@ /* if this is the first call, return on first reply, for sizing list */ if (x == -1 && isawsomething) return 1; + /* Check window size now that we have received multiple metaserver packets */ + if (type == 1 && num_servers >= metaPartition) + { + /* Metaserver window too small, restart it */ + LineToConsole("Resizing metaserver window, standby.\n"); + metaHeight = num_servers + 7; + metaPartition = metaHeight - 3; + W_UnmapWindow (metaWin); + metaWin = W_MakeMenu ("MetaServer List", 0, 0, 80, metaHeight, NULL, 2); + W_SetWindowKeyDownHandler (metaWin, metaaction); + W_SetWindowButtonHandler (metaWin, metaaction); + metawindow(); + } + /* if we have seen the same number of replies to what we sent, end */ if (sent == seen) return 1; } @@ -775,7 +791,7 @@ /* overwrite existing file if possible */ if (metaUDPCache && !findfile(metaUDPCache, cacheFileName)) - strcpy(cacheFileName, metaUDPCache); + strncpy(cacheFileName, metaUDPCache, PATH_MAX); if (metaUDPCache) { @@ -1069,7 +1085,7 @@ } if (metaCache && !findfile (metaCache, cacheFileName)) - strcpy (cacheFileName, metaCache); /* overwrite existing file if possible */ + strncpy (cacheFileName, metaCache, PATH_MAX); /* overwrite existing file if possible */ if (metaCache) { @@ -1267,14 +1283,16 @@ /* Allocate 4 spots for header/refresh/quit/link, and 8 server slots */ metaHeight = num_servers + 12; } + metaPartition = metaHeight - 3; return; break; case 2: if (ReadFromCache() || ReadFromMeta()) { /* Allocate 3 spots for header/quit/link */ - metaHeight = num_servers + 3; - return; + metaHeight = num_servers + 3; + metaPartition = metaHeight - 2; + return; } terminate(0); break; @@ -1283,6 +1301,7 @@ { /* Allocate 3 spots for header/quit/link */ metaHeight = num_servers + 3; + metaPartition = metaHeight - 2; return; } terminate(0); @@ -1416,7 +1435,7 @@ /* can't say a thing if line is beyond server list */ if (i >= num_servers) { /* but we can at least blank the line shown */ - if (i < metaHeight-3) + if (i < metaPartition) W_WriteText(metaWin, 0, i+1, color, "", 0, 0); return; } @@ -1812,13 +1831,13 @@ u_char VIHL; // Version and IHL u_char TOS; // Type Of Service short TotLen; // Total Length - short ID; // Identification + short ID; // Identification short FlagOff; // Flags and Fragment Offset u_char TTL; // Time To Live u_char Protocol; // Protocol u_short Checksum; // Checksum - struct in_addr iaSrc; // Internet Address - Source - struct in_addr iaDst; // Internet Address - Destination + struct in_addr iaSrc; // Internet Address - Source + struct in_addr iaDst; // Internet Address - Destination }IPHDR, *PIPHDR; @@ -1828,7 +1847,7 @@ u_char Type; // Type u_char Code; // Code u_short Checksum; // Checksum - u_short ID; // Identification + u_short ID; // Identification u_short Seq; // Sequence char Data; // Data }ICMPHDR, *PICMPHDR; @@ -1897,7 +1916,7 @@ */ sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ sum += (sum >> 16); /* add carry */ - answer = (unsigned short) (~sum); /* truncate to 16 bits */ + answer = (unsigned short) (~sum); /* truncate to 16 bits */ return (answer); } Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- defaults.c 13 Dec 2006 00:00:00 -0000 1.36 +++ defaults.c 13 Dec 2006 03:14:53 -0000 1.37 @@ -2022,7 +2022,7 @@ strcpy (macroKey, "TAB"); else if (mystats->st_keymap[155] == 'X') strcpy (macroKey, "ESC"); - else if (mystats->st_keymap[56] == 'X') + else if (mystats->st_keymap[56] == 'X') strcpy (macroKey, "X"); } Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- sound.c 20 Sep 2006 13:04:53 -0000 1.18 +++ sound.c 13 Dec 2006 03:14:55 -0000 1.19 @@ -247,7 +247,10 @@ if ((channel = Mix_PlayChannel(-1, newsounds[type], 0)) < 0) { +#if DEBUG + /* Frequent occurence is more than 16 channels playing sound */ LineToConsole("Mix_PlayChannel: %s\n", Mix_GetError()); +#endif return; } @@ -290,8 +293,8 @@ if ((channel = Mix_PlayChannel(-1, newsounds[type], 0)) < 0) { - LineToConsole("Mix_PlayChannel: %s\n", Mix_GetError()); - return; + LineToConsole("Mix_PlayChannel: %s\n", Mix_GetError()); + return; } /* Make sure distance in boundary range that function accepts */ if (distance < 0) @@ -303,7 +306,7 @@ // Adjust volume with distance and angle if (Mix_SetPosition(channel, angle, distance) == 0) { - LineToConsole("Mix_SetPosition: %s\n", Mix_GetError()); + LineToConsole("Mix_SetPosition: %s\n", Mix_GetError()); return; } } @@ -312,7 +315,7 @@ // Adjust volume with distance if (Mix_SetDistance(channel, distance) == 0) { - LineToConsole("Mix_SetDistance: %s\n", Mix_GetError()); + LineToConsole("Mix_SetDistance: %s\n", Mix_GetError()); return; } } From modemhero at users.sourceforge.net Tue Dec 12 21:14:55 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 03:14:55 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.83,1.84 Message-ID: <20061213031506.0503BB3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv357 Modified Files: NetrekXP to do list.C Log Message: Minor formatting fixes. Moved sound mixer error message to a DEBUG only statement. Added new tracking variable metaPartition to make sure metaserver doesn't try to display more lines than the window has allocated, in the case where 2nd or subsequent metaserver packets provide additional servers. If there are too many servers, metawindow closes, is redefined, and relaunched. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- NetrekXP to do list.C 12 Dec 2006 23:59:58 -0000 1.83 +++ NetrekXP to do list.C 13 Dec 2006 03:14:51 -0000 1.84 @@ -44,8 +44,7 @@ 5) Have client utilize new server torp vector code 6) Pop-up dialog box for bad version response 7) new UDP metaserver code has several problems re loading/saving metacache, status -field not updating due to refresh not happening when it should, metawindow still can't -handle correctly the case where servers would overwrite the quit button +field not updating due to refresh not happening when it should Stas's list: - color coded playerlist. From modemhero at users.sourceforge.net Wed Dec 13 01:16:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 07:16:30 +0000 Subject: [netrek-cvs] client/netrekxp/src parsemeta.c,1.22,1.23 Message-ID: <20061213071639.7667CB3F0@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24894/src Modified Files: parsemeta.c Log Message: Parsemeta.c changes: Moved initialization of server ip lookup out of the metaping thread into it's own function, metapinginit(). New server field ip_lookup to track which servers have been looked up. Call to metapinginit() if the server window has been resized (i.e. new servers have been added to the server list). The ip lookup causes a noticeable delay, thus we only want to do this once the metawindow has been created, and only for servers we haven't tried already. Also changed the metawindow size so there are no more blank entries, as new servers will increase metawindow size automatically. Rewrote metasort function to be much cleaner by using memcpy instead of manually swapping all the server fields. Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- parsemeta.c 13 Dec 2006 03:14:54 -0000 1.22 +++ parsemeta.c 13 Dec 2006 07:16:28 -0000 1.23 @@ -98,8 +98,9 @@ char typeflag; char comment[LINE]; #ifdef METAPING - u_long ip_addr; /* Cache the ip address after DNS lookup */ - DWORD pkt_rtt[RTT_AVG_BUFLEN]; /* store last # ping samples for avg rtt */ + int ip_lookup; /* 0 if IP needs looking up, 1 if not */ + u_long ip_addr; /* Cache the ip address after DNS lookup */ + DWORD pkt_rtt[RTT_AVG_BUFLEN]; /* store last # ping samples for avg rtt */ /* -1:init, -2:unknown host, -3:timeout */ /* >=0:round trip time in ms */ #endif @@ -323,6 +324,7 @@ strcpy(slist->comment, ""); #ifdef METAPING + slist->ip_lookup = 0; /* Initialize the ping rtt fields */ for (i = 0; i < RTT_AVG_BUFLEN; ++i ) slist->pkt_rtt[i] = (unsigned long) -1; @@ -601,6 +603,7 @@ sp->typeflag = type; strcpy(sp->comment, ""); #ifdef METAPING + sp->ip_lookup = 0; /* Initialize the ping rtt fields */ for (i = 0; i < RTT_AVG_BUFLEN; ++i ) sp->pkt_rtt[i] = (unsigned long) -1; @@ -678,6 +681,7 @@ strncpy(sp->comment, comment, LINE); free(comment); #ifdef METAPING + sp->ip_lookup = 0; /* Initialize the ping rtt fields */ for (i = 0; i < RTT_AVG_BUFLEN; ++i ) sp->pkt_rtt[i] = (unsigned long) -1; @@ -767,13 +771,16 @@ { /* Metaserver window too small, restart it */ LineToConsole("Resizing metaserver window, standby.\n"); - metaHeight = num_servers + 7; + metaHeight = num_servers + 4; metaPartition = metaHeight - 3; W_UnmapWindow (metaWin); metaWin = W_MakeMenu ("MetaServer List", 0, 0, 80, metaHeight, NULL, 2); W_SetWindowKeyDownHandler (metaWin, metaaction); W_SetWindowButtonHandler (metaWin, metaaction); metawindow(); +#ifdef METAPING + metapinginit(); +#endif } /* if we have seen the same number of replies to what we sent, end */ @@ -992,6 +999,7 @@ serverlist[i].refresh = 1; #ifdef METAPING + serverlist[i].ip_lookup = 0; /* Initialize the ping rtt fields */ for (j = 0; j < RTT_AVG_BUFLEN; ++j ) serverlist[i].pkt_rtt[j] = (unsigned long) -1; @@ -1275,13 +1283,13 @@ LoadMetasCache(); if (num_servers == 0) ReadMetasRecv(-1); if (num_servers != 0) { - /* Allocate 4 spots for header/refresh/quit/link, and 3 slots for additional servers */ - metaHeight = num_servers + 7; + /* Allocate 4 spots for header/refresh/quit/link */ + metaHeight = num_servers + 4; } else { LineToConsole("Warning: no response from metaservers, are you firewalled?\n" " (no reply to probe on UDP port %d)\n", metaPort); - /* Allocate 4 spots for header/refresh/quit/link, and 8 server slots */ - metaHeight = num_servers + 12; + /* Allocate 4 spots for header/refresh/quit/link, and 1 server slot */ + metaHeight = num_servers + 5; } metaPartition = metaHeight - 3; return; @@ -1317,18 +1325,11 @@ a request for updated server stats make one server more populated than it was before */ { - struct servers *sp; - char tempaddress[LINE]; - int tempport, tempage; - time_t tempwhen; - int temprefresh, templifetime, tempplayers, tempstatus; - char temptypeflag; - char tempcomment[LINE]; -#ifdef METAPING - u_long tempip_addr; - DWORD temppkt_rtt[RTT_AVG_BUFLEN]; -#endif - int i, j, change; + struct servers *tempserver; + int i, change; + + /* Allocate memory for temporary server */ + tempserver = (struct servers *) malloc(sizeof(struct servers)); /* Tracks if we performed a sorting action */ change = 0; @@ -1337,8 +1338,6 @@ server to the one above it on the list. */ for (i = 0; i < (num_servers - 1); i++) { - sp = serverlist; - /* Sorting order is: status, then player_count/queue_size */ /* If status is equal, the server with more players should be higher */ @@ -1363,59 +1362,17 @@ } if (change) { - /* Copy bottom entry (i) into temp space */ - strcpy (tempaddress, serverlist[i].address); - tempport = serverlist[i].port; - tempage = serverlist[i].age; - tempwhen = serverlist[i].when; - temprefresh = serverlist[i].refresh; - templifetime = serverlist[i].lifetime; - tempplayers = serverlist[i].players; - tempstatus = serverlist[i].status; - temptypeflag = serverlist[i].typeflag; - strcpy (tempcomment, serverlist[i].comment); -#ifdef METAPING - tempip_addr = serverlist[i].ip_addr; - for (j = 0; j < RTT_AVG_BUFLEN; j++) - temppkt_rtt[j] = serverlist[i].pkt_rtt[j]; -#endif - /* Move top entry (i+1) into bottom entry (i) */ - strcpy (serverlist[i].address, serverlist[i+1].address); - serverlist[i].port = serverlist[i+1].port; - serverlist[i].age = serverlist[i+1].age; - serverlist[i].when = serverlist[i+1].when; - serverlist[i].refresh = serverlist[i+1].refresh; - serverlist[i].lifetime = serverlist[i+1].lifetime; - serverlist[i].players = serverlist[i+1].players; - serverlist[i].status = serverlist[i+1].status; - serverlist[i].typeflag = serverlist[i+1].typeflag; - strcpy (serverlist[i].comment, serverlist[i+1].comment); -#ifdef METAPING - serverlist[i].ip_addr = serverlist[i+1].ip_addr; - for (j = 0; j < RTT_AVG_BUFLEN; j++) - serverlist[i].pkt_rtt[j] = serverlist[i+1].pkt_rtt[j]; -#endif - /* Copy temp entry into top entry (i+1) */ - strcpy (serverlist[i+1].address, tempaddress); - serverlist[i+1].port = tempport; - serverlist[i+1].age = tempage; - serverlist[i+1].when = tempwhen; - serverlist[i+1].refresh = temprefresh; - serverlist[i+1].lifetime = templifetime; - serverlist[i+1].players = tempplayers; - serverlist[i+1].status = tempstatus; - serverlist[i+1].typeflag = temptypeflag; - strcpy (serverlist[i+1].comment, tempcomment); -#ifdef METAPING - serverlist[i+1].ip_addr = tempip_addr; - for (j = 0; j < RTT_AVG_BUFLEN; j++) - serverlist[i+1].pkt_rtt[j] = temppkt_rtt[j]; -#endif - /* Start back at beginning - could be more efficient */ + /* Perform the swap */ + memcpy(&tempserver[0],&serverlist[i],sizeof(struct servers)); + memcpy(&serverlist[i],&serverlist[i+1],sizeof(struct servers)); + memcpy(&serverlist[i+1],&tempserver[0],sizeof(struct servers)); + /* Start back at beginning - could be more efficient with maybe + a qsort but the serverlist is so small it doesn't matter much */ i = 0; change = 0; } } + free(tempserver); } static void @@ -2020,6 +1977,24 @@ } +/* Look up and cache all ip addresses */ +void metapinginit(void) +{ + int i; + struct hostent *hp; + + for (i = 0; i < num_servers; ++i) + { + if (serverlist[i].ip_lookup == 0) + { + if ((hp = gethostbyname(serverlist[i].address)) == NULL) + serverlist[i].ip_addr = inet_addr(serverlist[i].address); // INADDR_NONE if failed + else + serverlist[i].ip_addr = *((u_long FAR *) (hp->h_addr)); + serverlist[i].ip_lookup = 1; + } + } +} DWORD WINAPI metaPing_thread(void) { @@ -2032,16 +2007,8 @@ SOCKET rawSocket; struct sockaddr_in saDest; struct sockaddr_in saSrc; - struct hostent *hp; - // First look up and cache all ip addresses - for (i = 0; i < num_servers; ++i) - { - if ((hp = gethostbyname(serverlist[i].address)) == NULL) - serverlist[i].ip_addr = inet_addr(serverlist[i].address); // INADDR_NONE if failed - else - serverlist[i].ip_addr = *((u_long FAR *) (hp->h_addr)); - } + metapinginit(); // Create a Raw socket rawSocket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); From modemhero at users.sourceforge.net Wed Dec 13 01:16:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 07:16:30 +0000 Subject: [netrek-cvs] client/netrekxp/include proto.h,1.26,1.27 Message-ID: <20061213071639.9A0E028F17@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24894/include Modified Files: proto.h Log Message: Parsemeta.c changes: Moved initialization of server ip lookup out of the metaping thread into it's own function, metapinginit(). New server field ip_lookup to track which servers have been looked up. Call to metapinginit() if the server window has been resized (i.e. new servers have been added to the server list). The ip lookup causes a noticeable delay, thus we only want to do this once the metawindow has been created, and only for servers we haven't tried already. Also changed the metawindow size so there are no more blank entries, as new servers will increase metawindow size automatically. Rewrote metasort function to be much cleaner by using memcpy instead of manually swapping all the server fields. Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- proto.h 12 Dec 2006 04:47:05 -0000 1.26 +++ proto.h 13 Dec 2006 07:16:28 -0000 1.27 @@ -836,6 +836,7 @@ void metaaction (W_Event * data); void metainput (void); #ifdef METAPING +void metapinginit(void); DWORD WINAPI metaPing_thread(void); #endif From modemhero at users.sourceforge.net Wed Dec 13 01:16:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 07:16:30 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.84,1.85 Message-ID: <20061213071639.7BD4828F13@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24894 Modified Files: NetrekXP to do list.C Log Message: Parsemeta.c changes: Moved initialization of server ip lookup out of the metaping thread into it's own function, metapinginit(). New server field ip_lookup to track which servers have been looked up. Call to metapinginit() if the server window has been resized (i.e. new servers have been added to the server list). The ip lookup causes a noticeable delay, thus we only want to do this once the metawindow has been created, and only for servers we haven't tried already. Also changed the metawindow size so there are no more blank entries, as new servers will increase metawindow size automatically. Rewrote metasort function to be much cleaner by using memcpy instead of manually swapping all the server fields. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- NetrekXP to do list.C 13 Dec 2006 03:14:51 -0000 1.84 +++ NetrekXP to do list.C 13 Dec 2006 07:16:28 -0000 1.85 @@ -43,8 +43,10 @@ scroll text that is outside the viewable window. 5) Have client utilize new server torp vector code 6) Pop-up dialog box for bad version response -7) new UDP metaserver code has several problems re loading/saving metacache, status -field not updating due to refresh not happening when it should +7) new UDP metaserver code has 2 problems +Possible corruption with loading/saving metacache +Possible that status field not updating due to refresh not happening when it should + Stas's list: - color coded playerlist. From modemhero at users.sourceforge.net Wed Dec 13 03:03:03 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 09:03:03 +0000 Subject: [netrek-cvs] client/netrekxp/include packets.h, 1.3, 1.4 struct.h, 1.12, 1.13 Message-ID: <20061213090312.AB08128F13@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13252/include Modified Files: packets.h struct.h Log Message: Check on size of generic32 packet. New player field p_orbit, to hold planet# that server tells you that you are orbitting. Updated generic32 structure to include p_orbit. Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- packets.h 13 Dec 2006 00:00:00 -0000 1.3 +++ packets.h 13 Dec 2006 09:03:00 -0000 1.4 @@ -877,18 +877,16 @@ char type; /* SP_GENERIC_32 */ char version; /* alphabetic */ short repair_time; /* server estimate of repair time in seconds */ - char pad1[28]; + short pl_orbit; /* what planet player orbiting, -1 if none */ + char pad1[25]; }; +#define GENERIC_32_VERSION 'a' +#define GENERIC_32_LENGTH 32 /* versioning instructions: we start with version 'a', and each time a field is added increment the version and reduce the pad size, keeping the packet the same size ... client is entitled to trust - fields in struct that were defined at a particular version. */ - -/* - packet.type = SP_GENERIC_32; - packet.version = GENERIC_32_VERSION; - if (sizeof(struct generic_32_spacket) != GENERIC_32_LENGTH) abort(); + fields in struct that were defined at a particular version. */ Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- struct.h 13 Dec 2006 00:00:00 -0000 1.12 +++ struct.h 13 Dec 2006 09:03:00 -0000 1.13 @@ -252,7 +252,8 @@ * with */ float p_kills; /* Enemies killed */ short p_planet; /* Planet orbiting or locked - * onto */ + * onto, set only client */ + short pl_orbit; /* Planet orbiting, sent by server */ short p_playerl; /* Player locked onto */ #ifdef ARMY_SLIDER From modemhero at users.sourceforge.net Wed Dec 13 03:03:03 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 13 Dec 2006 09:03:03 +0000 Subject: [netrek-cvs] client/netrekxp/src dashboard.c, 1.14, 1.15 local.c, 1.49, 1.50 socket.c, 1.12, 1.13 Message-ID: <20061213090312.AD02228F17@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13252/src Modified Files: dashboard.c local.c socket.c Log Message: Check on size of generic32 packet. New player field p_orbit, to hold planet# that server tells you that you are orbitting. Updated generic32 structure to include p_orbit. Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- local.c 13 Dec 2006 00:00:00 -0000 1.49 +++ local.c 13 Dec 2006 09:03:01 -0000 1.50 @@ -528,7 +528,7 @@ } if (showArmy && (me->p_flags & PFORBIT) - && (get_closest_planet(me->p_x, me->p_y) == l->pl_no)) + && (F_sp_generic_32 ? me->pl_orbit : get_closest_planet(me->p_x, me->p_y)) == l->pl_no) { char armbuf[4]; int armbuflen; Index: dashboard.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- dashboard.c 13 Dec 2006 00:00:00 -0000 1.14 +++ dashboard.c 13 Dec 2006 09:03:01 -0000 1.15 @@ -884,7 +884,7 @@ /*** 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. Made obsolete by - F_sp_generic_32 feature packet ***/ + F_sp_generic_32 feature packet. ***/ /******************************************************************************/ int repair_time (void) @@ -956,7 +956,8 @@ /******************************************************************************/ /*** get_closest_planet() - find closest planet to given location - Useful for determining which planet you are orbitting ***/ + Useful for determining which planet you are orbitting. + Made obsolete by F_sp_generic_32 feature packet. ***/ /******************************************************************************/ int get_closest_planet(int x, int y) { Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- socket.c 13 Dec 2006 00:00:00 -0000 1.12 +++ socket.c 13 Dec 2006 09:03:01 -0000 1.13 @@ -2368,8 +2368,16 @@ char version; // char unused; + if (sizeof(*packet) != GENERIC_32_LENGTH) + { +#ifdef DEBUG + LineToConsole("Generic32 packet length of %d, ignoring packet.\n", sizeof(*packet)); +#endif + return; + } version = packet->version; me->p_repair_time = packet->repair_time; + me->pl_orbit = packet->pl_orbit; // unused = packet->pad1; } From quozl at users.sourceforge.net Wed Dec 13 17:39:35 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Wed, 13 Dec 2006 23:39:35 +0000 Subject: [netrek-cvs] client/netrekxp/src dashboard.c,1.15,1.16 Message-ID: <20061213233944.6485728F13@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3547 Modified Files: dashboard.c Log Message: fix typo in comment Index: dashboard.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- dashboard.c 13 Dec 2006 09:03:01 -0000 1.15 +++ dashboard.c 13 Dec 2006 23:39:33 -0000 1.16 @@ -956,8 +956,8 @@ /******************************************************************************/ /*** get_closest_planet() - find closest planet to given location - Useful for determining which planet you are orbitting. - Made obsolete by F_sp_generic_32 feature packet. ***/ + Used to determine which planet you are orbiting, when the server + does not provide the SP_GENERIC_32 packet. ***/ /******************************************************************************/ int get_closest_planet(int x, int y) { From quozl at users.sourceforge.net Wed Dec 13 17:47:17 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Wed, 13 Dec 2006 23:47:17 +0000 Subject: [netrek-cvs] client/netrekxp/src socket.c,1.13,1.14 Message-ID: <20061213234725.9E4F6B3F2@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6648 Modified Files: socket.c Log Message: fix generic 32 handling Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- socket.c 13 Dec 2006 09:03:01 -0000 1.13 +++ socket.c 13 Dec 2006 23:47:15 -0000 1.14 @@ -2365,20 +2365,18 @@ void handleGeneric32 (struct generic_32_spacket *packet) { - char version; -// char unused; - if (sizeof(*packet) != GENERIC_32_LENGTH) + if (sizeof(struct generic_32_spacket) != GENERIC_32_LENGTH) { #ifdef DEBUG - LineToConsole("Generic32 packet length of %d, ignoring packet.\n", sizeof(*packet)); + LineToConsole("Generic32 packet length of %d, ignoring packet.\n", sizeof(struct generic_32_spacket)); #endif return; } - version = packet->version; + if (packet->version < 'a') return; me->p_repair_time = packet->repair_time; me->pl_orbit = packet->pl_orbit; - // unused = packet->pad1; + if (packet->version < 'b') return; } #ifdef RSA From modemhero at users.sourceforge.net Sun Dec 17 18:13:07 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 18 Dec 2006 00:13:07 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.85, 1.86 clientr.suo, 1.52, 1.53 Message-ID: <20061218001316.4F35C28F39@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19375 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Minor todo list, comment, and changes.txt update. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- NetrekXP to do list.C 13 Dec 2006 07:16:28 -0000 1.85 +++ NetrekXP to do list.C 18 Dec 2006 00:13:04 -0000 1.86 @@ -6,8 +6,6 @@ 4) Add a Cambot playback and Cambot record shortcut links to the installation package. Things not gonna happen, or server problems: -1) Player list messaging doesn't work if you can't see player (cloaked, too far -away, etc). Don't think this is fixable. 2) torp_other and plasma_other not working right due to lack of torp fuse info 3) twarping to base docked on base causes the twarp problem, but hard to reproduce 4) Server sometimes not updating tract/press flags for observers, several instances @@ -41,11 +39,11 @@ bottom border of netrek window. Actually will happen to whatever window is mapped down there at bottom of screen. Apprently the native windows function doesn't properly scroll text that is outside the viewable window. -5) Have client utilize new server torp vector code 6) Pop-up dialog box for bad version response 7) new UDP metaserver code has 2 problems Possible corruption with loading/saving metacache Possible that status field not updating due to refresh not happening when it should +8) Fix generic_32 size check Stas's list: Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 Binary files /tmp/cvsUHHh4c and /tmp/cvsPth58r differ From modemhero at users.sourceforge.net Sun Dec 17 18:13:07 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 18 Dec 2006 00:13:07 +0000 Subject: [netrek-cvs] client/netrekxp/include packets.h,1.4,1.5 Message-ID: <20061218001316.59A8328F3A@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19375/include Modified Files: packets.h Log Message: Minor todo list, comment, and changes.txt update. Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- packets.h 13 Dec 2006 09:03:00 -0000 1.4 +++ packets.h 18 Dec 2006 00:13:05 -0000 1.5 @@ -83,8 +83,7 @@ * verification */ #endif -#define SP_GENERIC_32 32 /* 32 byte packet, currently sends ship - repair time, room for future info */ +#define SP_GENERIC_32 32 /* 32 byte generic, see struct */ #define SP_SHIP_CAP 39 /* Handles server ship mods */ #ifdef SHORT_PACKETS From modemhero at users.sourceforge.net Sun Dec 17 18:13:07 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 18 Dec 2006 00:13:07 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.96,1.97 Message-ID: <20061218001316.4B07AB402@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19375/resources/docs Modified Files: changes.txt Log Message: Minor todo list, comment, and changes.txt update. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- changes.txt 13 Dec 2006 00:00:00 -0000 1.96 +++ changes.txt 18 Dec 2006 00:13:05 -0000 1.97 @@ -41,7 +41,10 @@ solicit other servers as if they were a metaserver, and supports the server option to display a comment rather than server name. There is also support for multicast server packets. This change also renames the old -m option to -M, and changes -m option to - the UDP metaserver. + the UDP metaserver. As multiple metaservers (and servers) may be polled, it is + possible the metaserver window may need to be resized as more metaserver packets are + received. Thus the metaserver window may briefly close/reopen in order to resize. + The time delay on closing/reopening is not even noticeable, from my testing. - moved position of planet owner on galactic (if showPlanetOwner on) so that it does not overlap with the fuel can graphic. The letter indicating planet owner is now in the upper right hand corner of the planet rather than the center right. From modemhero at users.sourceforge.net Sun Dec 17 20:02:59 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 18 Dec 2006 02:02:59 +0000 Subject: [netrek-cvs] client/netrekxp/src parsemeta.c,1.23,1.24 Message-ID: <20061218020312.B428F28F39@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32707/src Modified Files: parsemeta.c Log Message: Change metaserver window name to reflect it is a server list, not a list of metaservers. Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- parsemeta.c 13 Dec 2006 07:16:28 -0000 1.23 +++ parsemeta.c 18 Dec 2006 02:02:57 -0000 1.24 @@ -1139,7 +1139,7 @@ } free (sockbuf); - metaWindowName = "Netrek XP 2006 MetaServer List"; + metaWindowName = "Netrek XP 2006 Server List"; return 1; } From modemhero at users.sourceforge.net Mon Dec 18 00:36:17 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 18 Dec 2006 06:36:17 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.86,1.87 Message-ID: <20061218063626.CBAE9B42E@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18352 Modified Files: NetrekXP to do list.C Log Message: Todo list update. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- NetrekXP to do list.C 18 Dec 2006 00:13:04 -0000 1.86 +++ NetrekXP to do list.C 18 Dec 2006 06:36:14 -0000 1.87 @@ -44,7 +44,8 @@ Possible corruption with loading/saving metacache Possible that status field not updating due to refresh not happening when it should 8) Fix generic_32 size check - +9) Some sort of click action on player list brings up a menu with settings for that +player's candock, cantranswarp, ban, ignore, etc. Stas's list: - color coded playerlist. From modemhero at users.sourceforge.net Tue Dec 19 08:30:56 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 19 Dec 2006 14:30:56 +0000 Subject: [netrek-cvs] client/netrekxp/src parsemeta.c,1.24,1.25 Message-ID: <20061219143113.A1A5528F39@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19873/src Modified Files: parsemeta.c Log Message: Updated compile instructions based on experience setting up development environment from scratch. Fixed bug in version_r with metaping. Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- parsemeta.c 18 Dec 2006 02:02:57 -0000 1.24 +++ parsemeta.c 19 Dec 2006 14:30:53 -0000 1.25 @@ -473,6 +473,9 @@ char *p; int servers, i; time_t now = time(NULL); +#ifdef METAPING + int j; +#endif /* number of servers */ p = strtok(NULL,"\n"); @@ -605,8 +608,8 @@ #ifdef METAPING sp->ip_lookup = 0; /* Initialize the ping rtt fields */ - for (i = 0; i < RTT_AVG_BUFLEN; ++i ) - sp->pkt_rtt[i] = (unsigned long) -1; + for (j = 0; j < RTT_AVG_BUFLEN; ++j ) + sp->pkt_rtt[j] = (unsigned long) -1; #endif } } From modemhero at users.sourceforge.net Tue Dec 19 08:30:55 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 19 Dec 2006 14:30:55 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo, 1.53, 1.54 compile.txt, 1.11, 1.12 Message-ID: <20061219143113.A286D28F43@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19873 Modified Files: clientr.suo compile.txt Log Message: Updated compile instructions based on experience setting up development environment from scratch. Fixed bug in version_r with metaping. Index: compile.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/compile.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- compile.txt 30 Nov 2006 01:25:05 -0000 1.11 +++ compile.txt 19 Dec 2006 14:30:53 -0000 1.12 @@ -34,14 +34,21 @@ This is the preferred compiler. You will need the SDK from the web, as the software doesn't come with the necessary files. Additionally, DirectX SDK is probably needed too, -for the SDL support. If you use the studio files that come with the source, -it should already have all the proper configuration set up, such as links to the -lib files and using the proper resource files. +for the SDL support. You will also need the HTML help workshop (from Microsoft) to +compile the help file. If you use the studio files that come with the source, +it should already have most of the proper configuration set up, such as links to the +lib files and using the proper resource files. The following webpage indicates how +to properly install the Microsoft SDK. The name of the article on this webpage is +"Using Visual C++ 2005 Express Edition with the Microsoft Platform SDK" +http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ +Especially important are steps 3 and 4. Step 4 was necessary to get winkey to compile. Step 3: -------- Open command prompt in the source tree directory and run build.cmd. Note that this build -script must use borland make, not GNU make, so don't try and run it under cygwin. +script must use borland make, not GNU make, so don't try and run it under cygwin. Also +note that since the script is run in DOS, it can't handle directory names with spaces or +quotations. Highly recommend having netrekxp folder in root, i.e. c:\netrekxp If everything is correct and working then after a couple of minutes you will have compiled a working client under InstCWD\netrek. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 Binary files /tmp/cvsMBBwGg and /tmp/cvs3XHtSk differ From modemhero at users.sourceforge.net Thu Dec 21 07:48:35 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 Dec 2006 13:48:35 +0000 Subject: [netrek-cvs] client/netrekxp/resources/sounds nt_engine.wav, NONE, 1.1 Message-ID: <20061221134844.000BAB42C@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/sounds In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21397/resources/sounds Added Files: nt_engine.wav Log Message: Changed default metaStatusLevel from 3 to 2, so as not to include timed out servers New engine sound that replaces the old static-like engine sound, the sound file is still not used in normal gameplay though Changed default beeplite settings to include highlighting and sound effects for carrying, take and escorting RCDs. Fixed unnecessary reinitialization of metaping info for servers already found in server list Moved all metaping IP lookup initialization into the main metaping thread --- NEW FILE: nt_engine.wav --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Thu Dec 21 07:48:32 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 Dec 2006 13:48:32 +0000 Subject: [netrek-cvs] client/netrekxp/tools cygwin1.dll,1.2,1.3 Message-ID: <20061221134915.0FCB5B42C@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/tools In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21397/tools Modified Files: cygwin1.dll Log Message: Changed default metaStatusLevel from 3 to 2, so as not to include timed out servers New engine sound that replaces the old static-like engine sound, the sound file is still not used in normal gameplay though Changed default beeplite settings to include highlighting and sound effects for carrying, take and escorting RCDs. Fixed unnecessary reinitialization of metaping info for servers already found in server list Moved all metaping IP lookup initialization into the main metaping thread Index: cygwin1.dll =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/tools/cygwin1.dll,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsNC1sKk and /tmp/cvscRLmKt differ From modemhero at users.sourceforge.net Thu Dec 21 07:48:28 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 Dec 2006 13:48:28 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.87, 1.88 clientr.suo, 1.54, 1.55 Message-ID: <20061221134908.428A5B42C@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21397 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Changed default metaStatusLevel from 3 to 2, so as not to include timed out servers New engine sound that replaces the old static-like engine sound, the sound file is still not used in normal gameplay though Changed default beeplite settings to include highlighting and sound effects for carrying, take and escorting RCDs. Fixed unnecessary reinitialization of metaping info for servers already found in server list Moved all metaping IP lookup initialization into the main metaping thread Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- NetrekXP to do list.C 18 Dec 2006 06:36:14 -0000 1.87 +++ NetrekXP to do list.C 21 Dec 2006 13:48:21 -0000 1.88 @@ -46,6 +46,7 @@ 8) Fix generic_32 size check 9) Some sort of click action on player list brings up a menu with settings for that player's candock, cantranswarp, ban, ignore, etc. +10) add auto guest# name generation for INL server Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 Binary files /tmp/cvsSexUNv and /tmp/cvs3S9bbz differ From modemhero at users.sourceforge.net Thu Dec 21 07:48:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 Dec 2006 13:48:30 +0000 Subject: [netrek-cvs] client/netrekxp/src parsemeta.c,1.25,1.26 Message-ID: <20061221134908.F215828F1E@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21397/src Modified Files: parsemeta.c Log Message: Changed default metaStatusLevel from 3 to 2, so as not to include timed out servers New engine sound that replaces the old static-like engine sound, the sound file is still not used in normal gameplay though Changed default beeplite settings to include highlighting and sound effects for carrying, take and escorting RCDs. Fixed unnecessary reinitialization of metaping info for servers already found in server list Moved all metaping IP lookup initialization into the main metaping thread Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- parsemeta.c 19 Dec 2006 14:30:53 -0000 1.25 +++ parsemeta.c 21 Dec 2006 13:48:27 -0000 1.26 @@ -142,7 +142,7 @@ statusNull, statusCantConnect, statusDefault, statusConnecting }; -int metaStatusLevel = statusTout; +int metaStatusLevel = statusNobody; /* Functions */ @@ -439,7 +439,7 @@ token = strtok(NULL,","); } /* while (token != NULL) */ - metaWindowName = "Netrek XP 2006 MetaServer List"; + metaWindowName = "Netrek XP 2006 Server List"; return sent; } @@ -582,6 +582,12 @@ sp->age = age; sp->when = now; sp->lifetime = 4; +#ifdef METAPING + sp->ip_lookup = 0; + /* Initialize the ping rtt fields */ + for (j = 0; j < RTT_AVG_BUFLEN; ++j ) + sp->pkt_rtt[j] = (unsigned long) -1; +#endif } /* if it was found, check age */ else { @@ -605,12 +611,6 @@ sp->typeflag = type; strcpy(sp->comment, ""); -#ifdef METAPING - sp->ip_lookup = 0; - /* Initialize the ping rtt fields */ - for (j = 0; j < RTT_AVG_BUFLEN; ++j ) - sp->pkt_rtt[j] = (unsigned long) -1; -#endif } } @@ -669,10 +669,19 @@ grow(1); sp = serverlist + num_servers; num_servers++; +#ifdef METAPING + sp->ip_lookup = 0; + /* Initialize the ping rtt fields */ + for (i = 0; i < RTT_AVG_BUFLEN; ++i ) + sp->pkt_rtt[i] = (unsigned long) -1; +#endif } /* add or update the entry */ - strncpy(sp->address, host, LINE); + if (host != NULL) + strncpy(sp->address, host, LINE); + else + strcpy(sp->address, "Unknown address"); sp->port = port; sp->age = 0; sp->when = now; @@ -683,12 +692,6 @@ sp->typeflag = type; strncpy(sp->comment, comment, LINE); free(comment); -#ifdef METAPING - sp->ip_lookup = 0; - /* Initialize the ping rtt fields */ - for (i = 0; i < RTT_AVG_BUFLEN; ++i ) - sp->pkt_rtt[i] = (unsigned long) -1; -#endif } static int ReadMetasRecv(int x) @@ -780,10 +783,6 @@ metaWin = W_MakeMenu ("MetaServer List", 0, 0, 80, metaHeight, NULL, 2); W_SetWindowKeyDownHandler (metaWin, metaaction); W_SetWindowButtonHandler (metaWin, metaaction); - metawindow(); -#ifdef METAPING - metapinginit(); -#endif } /* if we have seen the same number of replies to what we sent, end */ @@ -1282,7 +1281,7 @@ switch (type) { case 1: - ReadMetasSend(); + ReadMetasSend(); LoadMetasCache(); if (num_servers == 0) ReadMetasRecv(-1); if (num_servers != 0) { @@ -1990,11 +1989,11 @@ { if (serverlist[i].ip_lookup == 0) { + serverlist[i].ip_lookup = 1; if ((hp = gethostbyname(serverlist[i].address)) == NULL) serverlist[i].ip_addr = inet_addr(serverlist[i].address); // INADDR_NONE if failed else serverlist[i].ip_addr = *((u_long FAR *) (hp->h_addr)); - serverlist[i].ip_lookup = 1; } } } @@ -2011,7 +2010,6 @@ struct sockaddr_in saDest; struct sockaddr_in saSrc; - metapinginit(); // Create a Raw socket rawSocket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); @@ -2023,6 +2021,9 @@ while (!thread_ready) { + // Lookup any IP addresses if necessary + metapinginit(); + // Flood ping all netrek servers at once for (i = 0; i < num_servers; ++i) { From modemhero at users.sourceforge.net Thu Dec 21 07:48:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 Dec 2006 13:48:30 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.21, 1.22 Message-ID: <20061221134908.49B8E28F1C@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21397/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Changed default metaStatusLevel from 3 to 2, so as not to include timed out servers New engine sound that replaces the old static-like engine sound, the sound file is still not used in normal gameplay though Changed default beeplite settings to include highlighting and sound effects for carrying, take and escorting RCDs. Fixed unnecessary reinitialization of metaping info for servers already found in server list Moved all metaping IP lookup initialization into the main metaping thread Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- generalconfig.html 12 Dec 2006 04:47:05 -0000 1.21 +++ generalconfig.html 21 Dec 2006 13:48:27 -0000 1.22 @@ -493,8 +493,8 @@ From modemhero at users.sourceforge.net Thu Dec 21 07:48:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 21 Dec 2006 13:48:30 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.97, 1.98 netrekrc, 1.15, 1.16 netrekrc_options.txt, 1.19, 1.20 Message-ID: <20061221134909.4731728F39@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21397/resources/docs Modified Files: changes.txt netrekrc netrekrc_options.txt Log Message: Changed default metaStatusLevel from 3 to 2, so as not to include timed out servers New engine sound that replaces the old static-like engine sound, the sound file is still not used in normal gameplay though Changed default beeplite settings to include highlighting and sound effects for carrying, take and escorting RCDs. Fixed unnecessary reinitialization of metaping info for servers already found in server list Moved all metaping IP lookup initialization into the main metaping thread Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- netrekrc 13 Dec 2006 00:00:00 -0000 1.15 +++ netrekrc 21 Dec 2006 13:48:26 -0000 1.16 @@ -131,10 +131,10 @@ # What servers to get from metaserver # 0 - with players # 1 - as above + with queue -# 2 - as above + with nobody playing -# 3 - as above + timed out servers (default) +# 2 - as above + with nobody playing (default) +# 3 - as above + timed out servers # 4 - as above + servers that metaserver could not connect to -metaStatusLevel: 3 +metaStatusLevel: 2 # What type of metaserver to use # 1 - UDP multiple metaservers @@ -928,10 +928,12 @@ # Beeplite macros -lite.take: /c/l +lite.take: /c/l/3 lite.base_ogg: /g/m/1/|OGG THE BASE!| lite.pickup: /p lite.help: %?%S=SB%{/c%}%?%a>0%{/c%} +lite.carrying: /c +lite.escorting: /c/p/4 # Receiver configurable messages Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- netrekrc_options.txt 12 Dec 2006 04:47:05 -0000 1.19 +++ netrekrc_options.txt 21 Dec 2006 13:48:26 -0000 1.20 @@ -93,8 +93,8 @@ metaStatusLevel: (0-4) what servers to display # 0 - servers with players, but not on a wait queue # 1 - servers with players and with a wait queue -# 2 - servers with nobody playing -# 3 - servers timed out to metaserver (default) +# 2 - servers with nobody playing (default) +# 3 - servers timed out to metaserver # 4 - servers that metaServer could not contact metaType: (1-3) what type of metaserver to use Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- changes.txt 18 Dec 2006 00:13:05 -0000 1.97 +++ changes.txt 21 Dec 2006 13:48:26 -0000 1.98 @@ -1,4 +1,9 @@ Netrek XP 2006, Version 1.2: +- changed default metaStatusLevel from 3 to 2, so as not to include timed out servers +- new engine sound that replaces the old static-like engine sound, the sound file is still + not used in normal gameplay though +- changed default beeplite settings to include highlighting and sound effects for + carrying, take and escorting RCDs. - sound now fades out over 1 second upon quitting - support for new server feature packet SP_GENERIC_32. This is a great upgrade to the server as it allows for future data to be sent in this packet (lots of empty room). Currently