From 0af15e8bb5df4f3d12cf982e4d38c0caa8412ac3 Mon Sep 17 00:00:00 2001 From: Mark Lemming Date: Tue, 13 Aug 2013 21:40:57 -0600 Subject: [PATCH] Drop requests for repairs over 121 buildings. --- lib/Lacuna.pm | 2 +- lib/Lacuna/RPC/Body.pm | 4 ++++ var/www/public/changes.txt | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Lacuna.pm b/lib/Lacuna.pm index b8b39e32..b56d531c 100644 --- a/lib/Lacuna.pm +++ b/lib/Lacuna.pm @@ -7,7 +7,7 @@ use Config::JSON; useall __PACKAGE__; -our $VERSION = 3.0893; +our $VERSION = 3.0894; my $config = Config::JSON->new('/data/Lacuna-Server/etc/lacuna.conf'); my $db = Lacuna::DB->connect($config->get('db/dsn'),$config->get('db/username'),$config->get('db/password'), { mysql_enable_utf8 => 1}); diff --git a/lib/Lacuna/RPC/Body.pm b/lib/Lacuna/RPC/Body.pm index 0322badd..2c05f414 100644 --- a/lib/Lacuna/RPC/Body.pm +++ b/lib/Lacuna/RPC/Body.pm @@ -135,6 +135,10 @@ sub repair_list { my $empire = $self->get_empire_by_session($session_id); my $body = $self->get_body($empire, $body_id); + + if (scalar @$building_ids > 121) { + confess [1002, 'Invalid number of buildings in argument.']; + } if ($body->needs_surface_refresh) { $body->needs_surface_refresh(0); diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 1d4f40af..d00ed03d 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,3 +1,6 @@ +3.0894: + - API: repair_list checks number of fed building ids, rejection is over max building count + 3.0893: - Fix: Closed starter zone loophole. - Mod: Citadel now repels planetary debris. -- 2.51.2