Mercurial > eagle-eye
changeset 142:9b8aa30a532c
counting members by ally
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Fri, 31 Oct 2008 10:53:14 +0800 |
parents | 0da6658697df |
children | bfa78302cf09 |
files | sheep.pl |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/sheep.pl Fri Oct 31 10:52:52 2008 +0800 +++ b/sheep.pl Fri Oct 31 10:53:14 2008 +0800 @@ -48,9 +48,10 @@ # 查聯盟數量 my $members = 1; unless ($sheep->allyId == '0') { - my $ally = $sheep->ally; - $members = $ally->members; - # Ikariam::User->search(allyId => $sheep->allyId)->count(); + unless (!defined($sheep->allyId) || $sheep->allyId == 0) { + my $ally = Ikariam::Ally->retrieve($sheep->allyId); + $members = $ally->members; + } } foreach my $c ($sheep->cities) { @@ -61,7 +62,7 @@ unless($c->status eq 'i') { # Ignore 聯盟人數大於五 # TODO 應該依照影響力來分 - next if($members > 5); + next if($members > 10); } my $island = Ikariam::Island->retrieve($c->island);