comparison scan.pl @ 295:15c288dd7dc5

checking spy risks
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 07 Dec 2008 15:10:14 +0800
parents aaffc50e3318
children 6ca0677a361e
comparison
equal deleted inserted replaced
290:2cdf6c6bfd0e 295:15c288dd7dc5
15 use Error; 15 use Error;
16 use Parallel::ForkManager; 16 use Parallel::ForkManager;
17 17
18 sub new { 18 sub new {
19 my($class, $i) = @_; 19 my($class, $i) = @_;
20 warn("new scanner");
21 my $self = { 20 my $self = {
22 ikariam => $i, 21 ikariam => $i,
23 }; 22 };
24 23
25 return bless $self, $class; 24 return bless $self, $class;
45 $c->set($_ => $h_city->{$_}); 44 $c->set($_ => $h_city->{$_});
46 } 45 }
47 } else { 46 } else {
48 $c = Ikariam::Cities->insert($h_city); 47 $c = Ikariam::Cities->insert($h_city);
49 } 48 }
49
50 $c->set(risk => $self->{ikariam}->viewSendSpy($h_city->{cityId}));
50 $c->update(); 51 $c->update();
51 52
52 my $user = Ikariam::User->retrieve($h_city->{'user'}); 53 my $user = Ikariam::User->retrieve($h_city->{'user'});
53 next if (defined($user) && defined($user->time) && $user->time gt (time - 30*60)); 54 next if (defined($user) && defined($user->time) && $user->time gt (time - 30*60));
54 55