Permalink
Browse files

Segregate shipyard buildable from body buildable in cache. Fix sacrif…

…ice for new upgrade method.
  • Loading branch information...
1 parent 485cfc8 commit b639ffc23106ad982e95442ab67d1bee2d2fb051 T. Alexander Popiel committed Apr 5, 2013
Showing with 18 additions and 16 deletions.
  1. +3 −2 Client.pm
  2. +15 −14 build_queue.pl
View
@@ -870,7 +870,7 @@ sub yard_buildable {
my $self = shift;
my $yard_id = shift;
- my $result = $self->cache_read( type => 'buildable', id => $yard_id );
+ my $result = $self->cache_read( type => 'shipyard_buildable', id => $yard_id );
return $result if $result;
$result = $self->call(shipyard => get_buildable => $yard_id);
@@ -884,7 +884,7 @@ sub yard_buildable {
}
my $invalid = List::Util::max(time() + 30, List::Util::min(time() + 600, @completions));
- $self->cache_write( type => 'buildable', id => $yard_id, data => $result, invalid => $invalid );
+ $self->cache_write( type => 'shipyard_buildable', id => $yard_id, data => $result, invalid => $invalid );
return $result;
}
@@ -1160,6 +1160,7 @@ sub present_captcha {
spaceport_view_all_ships => 'body/%d/view_all_ships',
observatory_get_probed_stars => 'building/%d/get_probed_stars',
shipyard_view_build_queue => 'building/%d/view_build_queue',
+ shipyard_buildable => 'building/%d/buildable',
mission_list => 'building/%d/mission_list',
mail_inbox => 'mail/inbox',
mail_message => 'mail/message/%d',
View
@@ -362,21 +362,22 @@
}
next;
}
- if (!@halls) {
- if ($no_wait) {
- emit("Building Halls of Vrbansk");
- my $result = $client->body_build($body_id, "Halls of Vrbansk");
- push(@builds, $name);
- next;
- } else {
- emit("Building Halls of Vrbansk, waiting 16 seconds");
- my $result = $client->body_build($body_id, "Halls of Vrbansk");
- push(@halls, $result->{building});
- sleep(16);
- }
- }
+ # if (!@halls) {
+ # if ($no_wait) {
+ # emit("Building Halls of Vrbansk");
+ # my $result = $client->body_build($body_id, "Halls of Vrbansk");
+ # push(@builds, $name);
+ # next;
+ # } else {
+ # emit("Building Halls of Vrbansk, waiting 16 seconds");
+ # my $result = $client->body_build($body_id, "Halls of Vrbansk");
+ # push(@halls, $result->{building});
+ # sleep(16);
+ # }
+ # }
emit("Sacrificing ".($target->{level}+1)." halls to upgrade $name");
- $client->halls_sacrifice($halls[0]{id}, $target->{id});
+ my $upgrade = $client->building_upgrade($target->{url}, $target->{id});
+ # $client->halls_sacrifice($halls[0]{id}, $target->{id});
if ($retain) {
emit("Retaining sacrifice command for $upTo$level $name");
}

0 comments on commit b639ffc

Please sign in to comment.