# HG changeset patch # User "Rex Tsai " # Date 1223411432 -28800 # Node ID ae412d1f77615931c47acfea9e1bafc3b7b529be # Parent e4b3168d0319ab2f679d7ff08a44ebe64f1990ce added logout function. diff -r e4b3168d0319 -r ae412d1f7761 Ikariam.pm --- a/Ikariam.pm Wed Oct 08 04:23:01 2008 +0800 +++ b/Ikariam.pm Wed Oct 08 04:30:32 2008 +0800 @@ -209,11 +209,16 @@ return @cities; } +sub logout +{ + my $self = shift; + $self->{mech}->get(sprintf('http://%s/index.php?action=loginAvatar&function=logout', $self->{server})); +} + sub login { my $self = shift; - # $self->{mech}->get(sprintf('http://%s/', $self->{server})); my $res = $self->{mech}->post(sprintf("http://%s/index.php?action=loginAvatar&function=login", $self->{server}), [ name => $self->{user}, password => $self->{pass}, diff -r e4b3168d0319 -r ae412d1f7761 scores.pl --- a/scores.pl Wed Oct 08 04:23:01 2008 +0800 +++ b/scores.pl Wed Oct 08 04:30:32 2008 +0800 @@ -9,10 +9,8 @@ { my $users = shift; - my $u; foreach my $user (values(%{$users})) { - next if($u == $user->{'id'}); $u = $user->{'id'}; printf("Saving %s\n", $user->{'name'}); if(my $c = Ikariam::User->retrieve($user->{id})) @@ -64,12 +62,11 @@ } } - foreach my $o (keys(%owners)) { - foreach my $x (qw/score army_score_main trader_score_secondary/) + foreach my $type (qw/score army_score_main trader_score_secondary/) { - my $users = $i->viewScore($x, $o, 0); + my $users = $i->viewScore($type, $o, 0); saveUser($users); } }