foreach $line (@lines) {
my ($ally, $planet_name, $player) = ('', '', '');
my ($planet, $moon, $idle, $disabled) = (0, 0, 0, 0);
($galaxy, $system) = ($1, $2) if ($line =~ /$ssystem\s(\d+):(\d+)/);
if ($line =~ /^(\d+)\s\t\t(.*?)\s\tMond\s\(Gr.*?(\d+)\)\s\t\t(.*?)\s\t(.*?)\s\tSpionieren/) {
#11 Imperators Palace Mond (Grö 7416) TLL L.o.D Spionieren Nachricht schreiben Buddyanfrage
($planet, $planet_name, $moon, $player, $ally) = ($1, $2, 1, $4, $5);
print "$planet: match0 firefox - Mond: $3
" if ($debug);
} elsif ($line =~ /^(\d+)\s\t\t(.*?)\s\t\t\t(.*?)\s\t(.*?)\s\tSpionieren/) {
#5 EARTH OF DEATH 7 deathking B.H.H. Spionieren Nachricht schreiben Buddyanfrage
($planet, $planet_name, $moon, $player, $ally) = ($1, $2, 0, $3, $4);
print "$planet: match1 firefox/opera, no moon - $planet_name
" if ($debug);
} elsif ($line =~ /^(\d+)\s\t\t(.*?)\s\tMond\s\(Gr.*?(\d+)\)\s\t\t(.*?)\s\t(.*?)\s/) {
#5 Masters of Puppets Mond (Grö 7416) MetaIIica XCT
($planet, $planet_name, $moon, $player, $ally) = ($1, $2, 1, $4, $5);
print "$planet: match0 firefox - Mond: $3
" if ($debug);
} elsif ($line =~ /^(\d+)\s\t\t(.*?)\s\t\t\t(.*?)\s\t(.*?)\s/) {
#5 Justice for All MetaIIica XCT ($planet, $planet_name, $moon, $player, $ally) = ($1, $2, 0, $3, $4);
print "$planet: match1 firefox/opera, no moon - $planet_name
" if ($debug);
} elsif ($line =~ /^(\d+)\s\t\t(.*?)\s\t\t\t(.*?)\s\t\tSpionieren/) {
#5 kol 174 Little Destroyer (i g I u) Spionieren Nachricht schreiben Buddyanfrage
($planet, $planet_name, $moon, $player, $ally) = ($1, $2, 0, $3, "");
print "$planet: match2 firefox, no moon, no ally - $planet_name
" if ($debug);
} elsif ($line =~ /^(\d+)\s+($destroyed)\s+/) {
$planet = $1;
print "$planet: Zerstörter Planet
" if ($debug);
} elsif ($line =~ /^(\d+)\s+$/) {
$planet = $1;
print "$planet: nicht kolonisiert
" if ($debug);
} elsif ($line =~ /(\d+)\t(Unendliche Weiten)/) {
#16 Unendliche Weiten
print "$1: $2
" if ($debug);
}
$planet_name =~ s/\s\(.*//;
if ($player =~ /\(([a-z]+)\)$/i) {
my $state = $1;
$idle = 1 if ($state =~ /i/);
$idle = 2 if ($state =~ /iI/);
$disabled = 1 if ($state =~ /g/);
$player =~ s/\(([a-z]+)\)$//i;
}
$player =~ s/\s*\(.*//;
if ($planet != 0) {
next if (($galaxy eq "") || ($system eq ""));
$planetsok++;
push(@query, "insert into $uni{'name'}_psm values (?, ?, ?, ?, ?, ?, NOW(), ?, ?, ?);");
push(@vals, $galaxy, $system, $planet, $planet_name, $ally, $player, $idle, $disabled, $moon);
}
}