changeset 330:484aaddeef66

fixed the order of armies
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 12 Feb 2009 01:50:52 +0800
parents c29c8dad0673
children 6eac624efc80
files Ikariam.pm
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Ikariam.pm	Thu Feb 12 01:24:59 2009 +0800
+++ b/Ikariam.pm	Thu Feb 12 01:50:52 2009 +0800
@@ -1035,13 +1035,14 @@
     my $cityId = shift;
     my %force_types;
 
-    $force_types{'army'} = [ qw/undef undef Slinger Swordsman Phalanx Ram Archer Catapult Gunsman Mortar SteamGiant Gyrocopter Bombardier Doctor Cook/ ];
-    $force_types{'fleet'} = [ qw/undef undef Ram-Ship BallistaShip Flamethrower CatapultShip MortarShip PaddleWheelRam DivingBoat/ ];
+    $force_types{'army'} = [ qw/undef undef Slinger Swordsman Phalanx Archer Gunsman Gyrocopter SteamGiant Bombardier Ram Catapult Mortar Doctor Cook/ ];
+    $force_types{'fleet'} = [ qw/undef undef Ram-Ship BallistaShip Flamethrower CatapultShip PaddleWheelRam MortarShip DivingBoat/ ];
 
     foreach my $x (qw/army fleet/) {
         $self->{'cities'}->{$cityId}->{$x} = {};
         my $res = $self->{mech}->get(sprintf('http://%s/index.php?view=cityMilitary-%s&id=%d', $self->{server}, $x, $cityId));
         my @numbers = Ikariam::Extractor->new(content => $res->content)->find('//table//tr/td');
+        print(Dumper(@numbers));
         foreach my $j (0..$#{$force_types{$x}}) {
             next if(!defined($force_types{$x}[$j]));
             if ($numbers[$j] == '-') {
@@ -1051,6 +1052,7 @@
             }
         }
     }
+    print(Dumper($self->{'cities'}->{$cityId}->{'army'}));
 }
 
 sub checkFriends