comparison scan.pl @ 239:38e1a82627a9

commented out the debug message
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 07 Nov 2008 11:46:03 +0800
parents 1a7b2d42fcbf
children a654d43731f0
comparison
equal deleted inserted replaced
238:1a7b2d42fcbf 239:38e1a82627a9
14 warn ("empty cities list.\n"); 14 warn ("empty cities list.\n");
15 return; 15 return;
16 } 16 }
17 17
18 foreach my $h_city (@cities) { 18 foreach my $h_city (@cities) {
19 Carp::carp(sprintf("checking %s\n", $h_city->{'cityname'})); 19 # Carp::carp(sprintf("checking %s\n", $h_city->{'cityname'}));
20 $h_city->{island} = $island; 20 $h_city->{island} = $island;
21 $h_city->{'time'} = time; 21 $h_city->{'time'} = time;
22 my $c = Ikariam::Cities->retrieve($h_city->{cityId}); 22 my $c = Ikariam::Cities->retrieve($h_city->{cityId});
23 if(defined($c)) { 23 if(defined($c)) {
24 foreach (keys(%$h_city)) { 24 foreach (keys(%$h_city)) {
43 43
44 foreach my $x (qw/score army_score_main trader_score_secondary/) { 44 foreach my $x (qw/score army_score_main trader_score_secondary/) {
45 $users = $::i->viewScore($x, $userName, 0); 45 $users = $::i->viewScore($x, $userName, 0);
46 46
47 foreach my $h_user (values(%{$users})) { 47 foreach my $h_user (values(%{$users})) {
48 Carp::croak(sprintf("Saving user %s\n", $h_user->{'name'})); 48 # Carp::carp(sprintf("Saving user %s\n", $h_user->{'name'}));
49 $h_user->{'time'} = time; 49 $h_user->{'time'} = time;
50 50
51 my $user = Ikariam::User->retrieve($h_user->{'id'}); 51 my $user = Ikariam::User->retrieve($h_user->{'id'});
52 if(defined($user)) { 52 if(defined($user)) {
53 foreach (keys(%$h_user)) { $user->set($_ => $h_user->{$_}); } 53 foreach (keys(%$h_user)) { $user->set($_ => $h_user->{$_}); }
127 } elsif($#ARGV == -1) { 127 } elsif($#ARGV == -1) {
128 $i->login; 128 $i->login;
129 my $cities = $i->check; 129 my $cities = $i->check;
130 # random 130 # random
131 foreach my $cityId (keys(%$cities)) { 131 foreach my $cityId (keys(%$cities)) {
132 printf("%s %s\n", $cities->{$cityId}->{island}->{x}, $cities->{$cityId}->{island}->{y}); 132 # Carp::carp(sprintf("Checking island location [%s:%s]\n", $cities->{$cityId}->{island}->{x}, $cities->{$cityId}->{island}->{y}));
133 my @islands = $i->viewWorldMap( $cities->{$cityId}->{island}->{x}, $cities->{$cityId}->{island}->{y}); 133 my @islands = $i->viewWorldMap( $cities->{$cityId}->{island}->{x}, $cities->{$cityId}->{island}->{y});
134 saveIslands(@islands); 134 saveIslands(@islands);
135 } 135 }
136 $i->logout; 136 $i->logout;
137 } else { 137 } else {