From 0e1f102eebaefdcdc9cded09b0b3cecb3bd01ce2 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 15 Mar 2011 21:27:58 -0500 Subject: [PATCH] Added get_stored_resources method to Distribution Center. --- docs/DistributionCenter.pod | 26 +++++++++++++++++++ lib/Lacuna/RPC/Building/DistributionCenter.pm | 3 ++- var/www/public/changes.txt | 2 ++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/DistributionCenter.pod b/docs/DistributionCenter.pod index 17cb808c..34ae2faa 100644 --- a/docs/DistributionCenter.pod +++ b/docs/DistributionCenter.pod @@ -71,4 +71,30 @@ A session id. The unique id of the distribution center. + +=head2 get_stored_resources ( session_id, building_id ) + +Returns a list of the resources you have stored to make it easier to identify what you want to store. + + { + "status" : { ... }, + "cargo_space_used_each" : 1, + "resources" : { + "water" : 14000, + "waste" : 393, + "bauxite" : 47, + "cheese" : 1193, + ... + } + } + +=head3 session_id + +A session id. + +=head3 building_id + +The unique id of this building. + + =cut diff --git a/lib/Lacuna/RPC/Building/DistributionCenter.pm b/lib/Lacuna/RPC/Building/DistributionCenter.pm index 2f917279..f1e6806c 100644 --- a/lib/Lacuna/RPC/Building/DistributionCenter.pm +++ b/lib/Lacuna/RPC/Building/DistributionCenter.pm @@ -4,6 +4,7 @@ use Moose; use utf8; no warnings qw(uninitialized); extends 'Lacuna::RPC::Building'; +with 'Lacuna::Role::TraderRpc'; sub app_url { return '/distributioncenter'; @@ -49,7 +50,7 @@ sub release_reserve { return $self->view($empire, $building); } -__PACKAGE__->register_rpc_method_names(qw(reserve release_reserve)); +__PACKAGE__->register_rpc_method_names(qw(reserve release_reserve get_stored_resources)); no Moose; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index d37bca4b..b0753e01 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,6 +1,8 @@ 3.0100 - Add: The space station lab is now capable of producing some module plans. - Rule: Deployed bleeders now require a captcha to be demolished. + - API: Added get_stored_resources method to Distribution Center. + - Fix: "can" result in distribution center returned 0 always. - Fix: All body resource attributes have been upgraded to support 9223372036854775807 instead of 2147483647. - Fix: Space stations now count against your next colony cost while in transit. - Fix: Added missing Malcud Field, Ravine, Lapis Forest, and Beeldeban Nest API docs. -- 2.51.2