diff --git a/bin/summarize_server.pl b/bin/summarize_server.pl index 0406dfc3..764cbd01 100644 --- a/bin/summarize_server.pl +++ b/bin/summarize_server.pl @@ -7,7 +7,7 @@ use Lacuna::Util qw(format_date); use Getopt::Long; use JSON; use SOAP::Amazon::S3; -use Lacuna::Constants qw(SHIP_TYPES); +use Lacuna::Constants qw(SHIP_TYPES ORE_TYPES); use utf8; @@ -53,6 +53,7 @@ sub generate_overview { my $bodies = $db->resultset('Lacuna::DB::Result::Map::Body'); my @off_limits = $bodies->search({empire_id => {'<' => 2}})->get_column('id')->all; my $ships = $db->resultset('Lacuna::DB::Result::Ships')->search({body_id => { 'not in' => \@off_limits}}); + my $glyphs = $db->resultset('Glyphs')->search({body_id => { 'not in' => \@off_limits}}); my $spies = $db->resultset('Lacuna::DB::Result::Spies')->search({empire_id => { '>' => 1}}); my $buildings = $db->resultset('Lacuna::DB::Result::Building')->search({body_id => { 'not in' => \@off_limits}}); my $empires = $db->resultset('Lacuna::DB::Result::Empire')->search({id => { '>' => 1}}); @@ -166,6 +167,14 @@ sub generate_overview { }; } + # flesh out glyphs + out('Flesh Out Glyphs Stats'); + foreach my $type (ORE_TYPES) { + my $type_rs = $glyphs->search({type => $type}); + my $count = $type_rs->count; + $out{glyphs}{types}{$type} = $count; + } + out('Write To S3'); my $config = Lacuna->config; my $s3 = SOAP::Amazon::S3->new($config->get('access_key'), $config->get('secret_key'), { RaiseError => 1 }); diff --git a/lib/Lacuna/RPC/Stats.pm b/lib/Lacuna/RPC/Stats.pm index 132c6146..70bc8a31 100644 --- a/lib/Lacuna/RPC/Stats.pm +++ b/lib/Lacuna/RPC/Stats.pm @@ -65,10 +65,10 @@ sub alliance_rank { }; } return { - status => $self->format_status($empire), - alliances => \@alliances, - total_alliances => $ranks->pager->total_entries, - page_number => $page_number, + status => $self->format_status($empire), + alliances => \@alliances, + total_alliances => $ranks->pager->total_entries, + page_number => $page_number, }; } @@ -139,10 +139,10 @@ sub empire_rank { }; } return { - status => $self->format_status($empire), - empires => \@empires, - total_empires => $ranks->pager->total_entries, - page_number => $page_number, + status => $self->format_status($empire), + empires => \@empires, + total_empires => $ranks->pager->total_entries, + page_number => $page_number, }; } @@ -196,8 +196,8 @@ sub colony_rank { } } return { - status => $self->format_status($empire), - colonies => \@colonies, + status => $self->format_status($empire), + colonies => \@colonies, }; } @@ -225,8 +225,8 @@ sub spy_rank { } } return { - status => $self->format_status($empire), - spies => \@spies, + status => $self->format_status($empire), + spies => \@spies, }; } @@ -245,8 +245,8 @@ sub weekly_medal_winners { } } return { - status => $self->format_status($empire), - winners => \@winners, + status => $self->format_status($empire), + winners => \@winners, }; }