annotate spy.pl @ 291:73c9bf517155

fixed for check checking
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 05 Dec 2008 22:49:36 +0800
parents 10f14db31151
children b3b845d30d4b
rev   line source
284
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
1 #!/usr/bin/perl
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
2
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
3 use strict;
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
4 use Ikariam;
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
5 use Data::Dumper;
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
6 use Decision::ParseTree q{ParseTree};
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
7 use YAML qw/LoadFile Dump DumpFile/;
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
8
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
9 our $i = new Ikariam($::server, $::user, $::pass);
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
10 $i->login;
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
11 # $i->check();
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
12 foreach (glob("city-*-dump.yaml")) {
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
13 my $city = LoadFile($_);
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
14 $i->{'cities'}->{$city->{id}} = $city;
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
15
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
16 my $spydata = $i->checkSafeHouse($city->{id});
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
17 foreach (keys(%{$spydata})) {
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
18 DumpFile("spy-$_-dump.yaml", $spydata->{$_});
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
19 }
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
20 }
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
21 $i->logout;
10f14db31151 added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff changeset
22