Mercurial > eagle-eye
comparison scores.pl @ 9:ae412d1f7761
added logout function.
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Wed, 08 Oct 2008 04:30:32 +0800 |
parents | e4b3168d0319 |
children | f590b5ea5e55 |
comparison
equal
deleted
inserted
replaced
8:e4b3168d0319 | 9:ae412d1f7761 |
---|---|
7 | 7 |
8 sub saveUser | 8 sub saveUser |
9 { | 9 { |
10 my $users = shift; | 10 my $users = shift; |
11 | 11 |
12 my $u; | |
13 foreach my $user (values(%{$users})) | 12 foreach my $user (values(%{$users})) |
14 { | 13 { |
15 next if($u == $user->{'id'}); $u = $user->{'id'}; | |
16 | 14 |
17 printf("Saving %s\n", $user->{'name'}); | 15 printf("Saving %s\n", $user->{'name'}); |
18 if(my $c = Ikariam::User->retrieve($user->{id})) | 16 if(my $c = Ikariam::User->retrieve($user->{id})) |
19 { | 17 { |
20 foreach my $i (keys(%$user)) { | 18 foreach my $i (keys(%$user)) { |
62 { | 60 { |
63 $owners{$city->owner} += 1; | 61 $owners{$city->owner} += 1; |
64 } | 62 } |
65 } | 63 } |
66 | 64 |
67 | |
68 foreach my $o (keys(%owners)) | 65 foreach my $o (keys(%owners)) |
69 { | 66 { |
70 foreach my $x (qw/score army_score_main trader_score_secondary/) | 67 foreach my $type (qw/score army_score_main trader_score_secondary/) |
71 { | 68 { |
72 my $users = $i->viewScore($x, $o, 0); | 69 my $users = $i->viewScore($type, $o, 0); |
73 saveUser($users); | 70 saveUser($users); |
74 } | 71 } |
75 } | 72 } |
76 } else { | 73 } else { |
77 # my $users = $i->viewScore('army_score_main'); | 74 # my $users = $i->viewScore('army_score_main'); |