From 3c54e58e2cbaa0e428aac731230305a1bd392085 Mon Sep 17 00:00:00 2001 From: Mark Lemming Date: Sun, 11 Jan 2015 15:44:35 -0700 Subject: [PATCH] Fixed payload bug, cleaned up logging --- bin/clean_up_battle_log.pl | 3 ++- bin/run_daily.sh | 14 +++++++------- bin/run_weekly.sh | 4 ++-- lib/Lacuna/RPC/Building/SpacePort.pm | 3 +-- lib/Lacuna/Role/Ship/Arrive/DumpWaste.pm | 3 +-- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/bin/clean_up_battle_log.pl b/bin/clean_up_battle_log.pl index 9f3650a8..b510c8ba 100644 --- a/bin/clean_up_battle_log.pl +++ b/bin/clean_up_battle_log.pl @@ -20,10 +20,11 @@ my $date_ended = DateTime->now->subtract( days => 7 ); out('Loading DB'); our $db = Lacuna->db; +our $dtf = $db->storage->datetime_parser; out('Deleting Old Battle Logs'); my $log = $db->resultset('Lacuna::DB::Result::Log::Battles'); -$log->search({ date_stamp => { '<' => $date_ended }})->delete_all; +$log->search({ date_stamp => { '<' => $dtf->format_datetime($date_ended) }})->delete_all; my $finish = time; out('Finished'); diff --git a/bin/run_daily.sh b/bin/run_daily.sh index c2a4d3d0..923943ac 100755 --- a/bin/run_daily.sh +++ b/bin/run_daily.sh @@ -1,10 +1,10 @@ #!/bin/bash export PATH=/data/apps/bin:$PATH cd /data/Lacuna-Server/bin -perl trickle_essentia_veins.pl -perl determine_lottery_winner.pl -perl alert_inactive_users.pl -perl rotate_taxes_paid.pl -perl clean_up_mail.pl -perl record_rpc.pl -perl util/check_spy_count.pl --burn +perl trickle_essentia_veins.pl > /tmp/daily.log 2> /tmp/daily.log +perl determine_lottery_winner.pl > /tmp/daily.log 2> /tmp/daily.log +perl alert_inactive_users.pl > /tmp/daily.log 2> /tmp/daily.log +perl rotate_taxes_paid.pl > /tmp/daily.log 2> /tmp/daily.log +perl clean_up_mail.pl > /tmp/daily.log 2> /tmp/daily.log +perl record_rpc.pl > /tmp/daily.log 2> /tmp/daily.log +perl util/check_spy_count.pl --burn > /tmp/daily.log 2> /tmp/daily.log diff --git a/bin/run_weekly.sh b/bin/run_weekly.sh index 05d63e2f..e7270279 100755 --- a/bin/run_weekly.sh +++ b/bin/run_weekly.sh @@ -2,5 +2,5 @@ export PATH=/data/apps/bin:$PATH cd /data/Lacuna-Server/bin perl weekly_medals.pl >> /tmp/weekly_medals.log 2>> /tmp/weekly_medals.log -perl trelvestian/reset_essentia_veins.pl -perl clean_up_battle_log.pl +perl trelvestian/reset_essentia_veins.pl >> /tmp/weekly.log 2>> /tmp/weekly.log +perl clean_up_battle_log.pl >> /tmp/weekly.log 2>> /tmp/weekly.log diff --git a/lib/Lacuna/RPC/Building/SpacePort.pm b/lib/Lacuna/RPC/Building/SpacePort.pm index f248807f..0351591f 100644 --- a/lib/Lacuna/RPC/Building/SpacePort.pm +++ b/lib/Lacuna/RPC/Building/SpacePort.pm @@ -422,7 +422,6 @@ sub send_ship_types { speed => $attack_group->{speed}, combat => $attack_group->{combat}, stealth => $attack_group->{stealth}, - payload => $payload, hold_size => $attack_group->{hold_size}, fleet_speed => $fleet_speed, berth_level => 1, @@ -430,7 +429,7 @@ sub send_ship_types { task => 'Docked', number_of_docks => $attack_group->{number_of_docks}, })->insert; - $ag->send(target => $target, arrival => $arrival); + $ag->send(target => $target, arrival => $arrival, payload => $payload); $body->add_to_neutral_entry($attack_group->{combat}); } return $self->get_fleet_for($session_id, $body_id, $target_params); diff --git a/lib/Lacuna/Role/Ship/Arrive/DumpWaste.pm b/lib/Lacuna/Role/Ship/Arrive/DumpWaste.pm index abaa29d2..13f937b1 100644 --- a/lib/Lacuna/Role/Ship/Arrive/DumpWaste.pm +++ b/lib/Lacuna/Role/Ship/Arrive/DumpWaste.pm @@ -124,7 +124,6 @@ after send => sub { $waste_sent = $room; } $payload->{resources}->{waste} += $waste_sent; - $payload->{resources}->{spam} = "spam"; $self->payload($payload); } else { @@ -134,7 +133,7 @@ after send => sub { else { $waste_sent = $self->hold_size; } - $self->payload({ resources => { waste => $waste_sent }, test => { spam => 1 }}); + $self->payload({ resources => { waste => $waste_sent }}); } $self->body->spend_waste($waste_sent)->update; $self->update; -- 2.54.0