Date: Wednesday May 29, 2002 @ 17:34 Author: cameron Update of /home/netrek/cvsroot/Vanilla/tools In directory swashbuckler.real-time.com:/var/tmp/cvs-serv13857 Modified Files: Makefile.in scores.c trimscores.c Log Message: trimscores investigation project work **************************************** Index: Vanilla/tools/Makefile.in diff -u Vanilla/tools/Makefile.in:1.4 Vanilla/tools/Makefile.in:1.5 --- Vanilla/tools/Makefile.in:1.4 Tue May 1 21:00:20 2001 +++ Vanilla/tools/Makefile.in Wed May 29 17:34:38 2002 @@ -30,7 +30,8 @@ M_OBJS = ../ntserv/data.o ../ntserv/openmem.o ../ntserv/ltd_stats.o -SRCS = ${srcdir}/loadchecker.c ${srcdir}/mess.c ${srcdir}/mergescores.c \ +SRCS = ${srcdir}/blotpassword.c ${srcdir}/loadchecker.c ${srcdir}/mess.c \ + ${srcdir}/mergescores.c \ ${srcdir}/newscores.c ${srcdir}/planets.c ${srcdir}/players.c \ ${srcdir}/scores.c ${srcdir}/setgalaxy.c ${srcdir}/showgalaxy.c \ ${srcdir}/stat.c ${srcdir}/trimscores.c ${srcdir}/watchmes.c \ @@ -43,7 +44,8 @@ ${srcdir}/../ntserv/smessage.c ${srcdir}/ntpasswd.c \ ${srcdir}/../ntserv/salt.c -EXECS = loadchecker mess message newscores planets players scores \ +EXECS = blotpassword loadchecker mess message newscores planets players \ + scores \ setgalaxy showgalaxy stat trimscores watchmes xtkill \ mergescores keyman updated fun conq_vert convert sortdb cambot \ ntpasswd ltd_dump ltd_convert nuke trekon @@ -62,6 +64,7 @@ /bin/mkdir $(LIBDIR)/tools; \ fi $(INSTALLPROG) $(INSTALLOPTS) ${srcdir}/updatekeys $(LIBDIR)/tools/updatekeys + $(INSTALLPROG) $(INSTALLOPTS) blotpassword $(LIBDIR)/tools/blotpassword $(INSTALLPROG) $(INSTALLOPTS) loadchecker $(LIBDIR)/tools/loadchecker $(INSTALLPROG) $(INSTALLOPTS) mess $(LIBDIR)/tools/mess $(INSTALLPROG) $(INSTALLOPTS) message $(LIBDIR)/tools/message @@ -137,6 +140,9 @@ stat: stat.o $(M_OBJS) $(CC) -o $@ $(CFLAGS) ${LDFLAGS} stat.o $(M_OBJS) $(LIBS) + +blotpassword: blotpassword.o + $(CC) -o $@ $(CFLAGS) ${LDFLAGS} blotpassword.o $(GETPATH) $(LIBS) trimscores: trimscores.o $(GETPATH) $(CC) -o $@ $(CFLAGS) ${LDFLAGS} trimscores.o $(GETPATH) $(LIBS) Index: Vanilla/tools/scores.c diff -u Vanilla/tools/scores.c:1.3 Vanilla/tools/scores.c:1.4 --- Vanilla/tools/scores.c:1.3 Wed Nov 10 19:18:27 1999 +++ Vanilla/tools/scores.c Wed May 29 17:34:38 2002 @@ -332,6 +332,7 @@ usage(); break; case 'A': + case 'X': printout("%10ld %10d %10d %10d %10d %10lf\n", status->time, status->planets, @@ -397,6 +398,16 @@ play_entry.stats.st_sbticks / 10; break; default: + case 'X': + { + unsigned erase_password; + for (erase_password = 0; + erase_password < sizeof (play_entry.password); + erase_password++) + play_entry.password[erase_password] = 'X'; + play_entry.password[sizeof (play_entry.password) - 1] = '\0'; + } + // Fall through case 'A': strcat(play_entry.name, "_"); #ifdef GENO_COUNT @@ -602,6 +613,8 @@ printout("n - print best players in order, showing std. deviations\n"); printout("r - list all players, hours, and ratings (no order)\n"); printout("A - list entire database in ascii form (for use with newscores)\n"); + printout("X - list entire database in ascii form without passwords\n"); + printout(" (for debug use with newscores)\n"); printout("T - print rough number of seconds of play time\n"); printout("O - print players who haven't logged in for 4 weeks\n"); printout("D - list players by DI\n"); Index: Vanilla/tools/trimscores.c diff -u Vanilla/tools/trimscores.c:1.4 Vanilla/tools/trimscores.c:1.5 --- Vanilla/tools/trimscores.c:1.4 Fri Apr 30 15:19:14 1999 +++ Vanilla/tools/trimscores.c Wed May 29 17:34:38 2002 @@ -64,6 +64,7 @@ int i; char buf[MAXBUFFER]; int harsh=10; /* How strict we will be with player trimming */ + const LONG currenttime = time (NULL); if (argc==2) { harsh=atoi(argv[1]); @@ -137,7 +138,7 @@ /* This formula reads: * If (deadtime - (10 + rank^2 + playtime/2.4)*n days > 0, nuke him. */ - if (i!=0 && harsh<100 && ((time(NULL) - play_entry.stats.st_lastlogin - 864000*harsh) - + if (i!=0 && harsh<100 && ((currenttime - play_entry.stats.st_lastlogin - 864000*harsh) - play_entry.stats.st_rank * play_entry.stats.st_rank * harsh * 86400 - (play_entry.stats.st_tticks + play_entry.stats.st_ticks + play_entry.stats.st_sbticks) * harsh > 0)) {