#!/usr/local/bin/perl
# Usage:
# first: compile convdate.c (make convdate or gcc -o convdate convdate.c)
# (1) shut down the game, this cannot be done while running
# (2) create a directory in your main Rot directory called nplayer
# (3) in your /Rot/player directory, do a: ls -1 >../names.txt
# (4) find the long integer equivilant for the cut-off date with convdate.
# (anyone who has not logged in since this date will be deleted,
# except imms)
# (5) put the long integer in the line below marked ###########
# (6) run this program from the /Rot directory (This will take awhile)
# (7) if everything runs ok, delete the player directory and mv the
# nplayer directory to player.
# (8) you should now run fclan to rebuild the clan lists.
# (you may want to have a backup of all the old pfiles)
require "ctime.pl";
require "timelocal.pl";
undef @Names;
open(INFILE, "names.txt");
while (<INFILE>) {
chomp;
push(@Names, $_);
}
close INFILE;
foreach $name (sort(@Names)) {
print $name," ";
undef @Lines;
open (INFILE, "player/$name");
while (<INFILE>) {
chomp;
push(@Lines, $_);
}
close INFILE;
$count = @Lines;
$count--;
$a = 0;
$z = 1;
$b = 0;
while ($a == 0) {
$c = "";
$d = "";
($c,$d) = split(' ', @Lines[$b], 2);
if ($c eq "LogO") {
# !!!replace the ########### below with the long integer from convdate!!!!
if ($d >= 856418400) {
print $d, " ";
$z = 0;
}
} elsif ($c eq "Levl") {
if ($d >= 102) {
$a = 1;
$z = 0;
}
}
$b++;
if ($b >= $count) {
$a= 1;
}
}
if ($z == 0) {
print "Yes\n";
open (OUTFILE, ">nplayer/$name");
foreach $tmp (@Lines) {
print OUTFILE $tmp, "\n";
}
close OUTFILE;
} else {
print "No\n";
}
}
exit;