Date: Monday April 30, 2001 @ 4:13 Author: cameron Update of /home/netrek/cvsroot/Vanilla/tools In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv20887/tools Modified Files: ltd_dump.c players.c Log Message: * tools/ltd_dump.c: add ability to query LTD statistics by player name. Planned for use with a PHP script to display LTD statistics. Maybe it is time for a database back-end for the .players file. Need to do some thinking about this. * tools/players.c (main): change "Display" to "Host name". * ntserv/distress.c (makedistress): core dump on continuum, an RCD was being decoded for transmission to slot R0 "arizzi" from a slot (Xc) which was now in login, with a p_team of 15, causing the APPEND_CAP macro to (probably) wander off. **************************************** Index: Vanilla/tools/ltd_dump.c diff -u Vanilla/tools/ltd_dump.c:1.7 Vanilla/tools/ltd_dump.c:1.8 --- Vanilla/tools/ltd_dump.c:1.7 Thu Apr 20 18:38:06 2000 +++ Vanilla/tools/ltd_dump.c Mon Apr 30 04:13:03 2001 @@ -1,4 +1,4 @@ -/* $Id: ltd_dump.c,v 1.7 2000/04/20 23:38:06 ahn Exp $ +/* $Id: ltd_dump.c,v 1.8 2001/04/30 09:13:03 cameron Exp $ * * Dave Ahn * @@ -28,7 +28,7 @@ #define LEN_ABBR 4 #define LEN_NAME 30 -static const char rcsid [] = "$Id: ltd_dump.c,v 1.7 2000/04/20 23:38:06 ahn Exp $"; +static const char rcsid [] = "$Id: ltd_dump.c,v 1.8 2001/04/30 09:13:03 cameron Exp $"; static FILE *fp; @@ -298,6 +298,7 @@ struct statentry p; int plf; int race; + char *who; #ifdef LTD_PER_RACE @@ -326,6 +327,11 @@ else plf = open(PlayerFile, O_RDONLY, 0744); + if (argc == 3) + who = argv[2]; + else + who = NULL; + if (plf <= -1) { fprintf(stderr, "ltd_dump: can't open playerfile\n"); @@ -343,9 +349,13 @@ while (read(plf, &p, sizeof(struct statentry)) > 1) { for (race=0; race<LTD_NUM_RACES; race++) { + + if ((who == NULL)||(strcmp(who, p.name) == 0)) { - dump_sb_stats1(p.name, races[race][0], p.stats.ltd[race]); + dump_sb_stats1(p.name, races[race][0], p.stats.ltd[race]); + } + } } @@ -364,9 +374,13 @@ while (read(plf, &p, sizeof(struct statentry)) > 1) { for (race=0; race<LTD_NUM_RACES; race++) { + + if ((who == NULL)||(strcmp(who, p.name) == 0)) { - dump_sb_stats2(p.name, races[race][0], p.stats.ltd[race]); + dump_sb_stats2(p.name, races[race][0], p.stats.ltd[race]); + } + } } @@ -385,8 +399,12 @@ for (race=0; race<LTD_NUM_RACES; race++) { + + if ((who == NULL)||(strcmp(who, p.name) == 0)) { + + dump_full(p.name, races[race], p.stats.ltd[race]); - dump_full(p.name, races[race], p.stats.ltd[race]); + } } Index: Vanilla/tools/players.c diff -u Vanilla/tools/players.c:1.6 Vanilla/tools/players.c:1.7 --- Vanilla/tools/players.c:1.6 Fri Jun 23 04:12:59 2000 +++ Vanilla/tools/players.c Mon Apr 30 04:13:03 2001 @@ -67,7 +67,7 @@ break; case 'm': - output(" Pl: Rank Name Login Display Type\n"); + output(" Pl: Rank Name Login Host name Type\n"); break; case 'v': @@ -75,7 +75,7 @@ break; default: - output(" Pl: Rank Name Login Display Ratings DI\n"); + output(" Pl: Rank Name Login Host name Ratings DI\n"); break; } output("<>=======================================================================<>\n");