comparison scan.pl @ 211:541bc1fba446

update very 30 minutes.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 03 Nov 2008 23:02:36 +0800
parents b7af307a222d
children 978a949602e5
comparison
equal deleted inserted replaced
210:a5862d3f1c84 211:541bc1fba446
26 $c = Ikariam::Cities->insert($h_city); 26 $c = Ikariam::Cities->insert($h_city);
27 } 27 }
28 $c->update(); 28 $c->update();
29 29
30 my $user = Ikariam::User->retrieve($h_city->{'user'}); 30 my $user = Ikariam::User->retrieve($h_city->{'user'});
31 next if (defined($user) && defined($user->time) && $user->time le (time - 60*60*1)); 31 next if (defined($user) && defined($user->time) && $user->time le (time - 30*60*1));
32 32
33 saveUser($h_city->{owner}); 33 saveUser($h_city->{owner});
34 } 34 }
35 } 35 }
36 36
63 my $allyId = shift; 63 my $allyId = shift;
64 return unless (defined($allyId) && $allyId ne '0'); 64 return unless (defined($allyId) && $allyId ne '0');
65 65
66 # Save for member of ally 66 # Save for member of ally
67 my $ally = Ikariam::Ally->retrieve($allyId); 67 my $ally = Ikariam::Ally->retrieve($allyId);
68 if(!defined($ally) || $ally->time le (time - 60*60*1)) { 68 if(!defined($ally) || $ally->time le (time - 30*60*1)) {
69 my $h_ally = $::i->viewAlly($allyId); 69 my $h_ally = $::i->viewAlly($allyId);
70 $h_ally->{'time'} = time; 70 $h_ally->{'time'} = time;
71 if(defined($ally)) { 71 if(defined($ally)) {
72 foreach (keys(%$h_ally)) { $ally->set($_ => $h_ally->{$_}); } 72 foreach (keys(%$h_ally)) { $ally->set($_ => $h_ally->{$_}); }
73 } else { 73 } else {
117 } else { 117 } else {
118 $island = Ikariam::Island->insert($h_island); 118 $island = Ikariam::Island->insert($h_island);
119 } 119 }
120 120
121 # scanning the island 121 # scanning the island
122 if($island->time le (time - 60*60*6)) 122 if($island->time le (time - 30*60*6))
123 { 123 {
124 my @cities = $i->viewIsland($h_island->{id}); 124 my @cities = $i->viewIsland($h_island->{id});
125 saveCities($h_island->{id}, @cities); 125 saveCities($h_island->{id}, @cities);
126 126
127 $island->set('time', time); 127 $island->set('time', time);