From c888741aef1de04309e34517a5e8fea0af03cd1f Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Fri, 7 Aug 2020 10:38:47 -0500 Subject: [PATCH] removed several things including wormholes which weren't being utilized at all --- .../Commands/Eve/GetEveRegionsCommand.php | 49 ------ .../Commands/Market/GetMarketDataCommand.php | 70 --------- .../Market/PurgeMarketDataCommand.php | 50 ------ .../Commands/Wormholes/PurgeWormholes.php | 50 ------ app/Console/Kernel.php | 3 - .../Wormholes/WormholeController.php | 148 ------------------ app/Jobs/Commands/Eve/GetEveRegionsJob.php | 56 ------- .../Market/GetMarketRegionOrderJob.php | 104 ------------ .../Market/PurgeMarketRegionOrderJob.php | 34 ---- .../user/sidebarmenu/general.blade.php | 12 -- resources/views/wormholes/display.blade.php | 41 ----- resources/views/wormholes/form.blade.php | 53 ------- 12 files changed, 670 deletions(-) delete mode 100644 app/Console/Commands/Eve/GetEveRegionsCommand.php delete mode 100644 app/Console/Commands/Market/GetMarketDataCommand.php delete mode 100644 app/Console/Commands/Market/PurgeMarketDataCommand.php delete mode 100644 app/Console/Commands/Wormholes/PurgeWormholes.php delete mode 100644 app/Http/Controllers/Wormholes/WormholeController.php delete mode 100644 app/Jobs/Commands/Eve/GetEveRegionsJob.php delete mode 100644 app/Jobs/Commands/Market/GetMarketRegionOrderJob.php delete mode 100644 app/Jobs/Commands/Market/PurgeMarketRegionOrderJob.php delete mode 100644 resources/views/wormholes/display.blade.php delete mode 100644 resources/views/wormholes/form.blade.php diff --git a/app/Console/Commands/Eve/GetEveRegionsCommand.php b/app/Console/Commands/Eve/GetEveRegionsCommand.php deleted file mode 100644 index dd6c50cfb..000000000 --- a/app/Console/Commands/Eve/GetEveRegionsCommand.php +++ /dev/null @@ -1,49 +0,0 @@ -SetStartStatus(); - - $regions = [ - 'Immensea' => 10000025, - 'Catch' => 10000014, - 'Tenerifis' => 10000061, - 'The Forge' => 10000002, - 'Impass' => 10000031, - 'Esoteria' => 10000039, - 'Detorid' => 10000005, - 'Omist' => 10000062, - 'Feythabolis' => 10000056, - 'Insmother' => 10000009, - ]; - - foreach($regions as $key => $value) { - GetMarketRegionOrderJob::dispatch($value); - } - - $task->SetStopStatus(); - } -} diff --git a/app/Console/Commands/Market/PurgeMarketDataCommand.php b/app/Console/Commands/Market/PurgeMarketDataCommand.php deleted file mode 100644 index 45628f655..000000000 --- a/app/Console/Commands/Market/PurgeMarketDataCommand.php +++ /dev/null @@ -1,50 +0,0 @@ -subHours(48))->delete(); - } -} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 7dd5c9aa3..a7efabc3a 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -24,7 +24,6 @@ class Kernel extends ConsoleKernel Commands\Users\PurgeUsers::class, Commands\Flex\FlexStructureCommand::class, Commands\Data\EmptyJumpBridges::class, - Commands\Wormholes\PurgeWormholes::class, Commands\Finances\SovBillsCommand::class, Commands\Data\CleanStaleDataCommand::class, Commands\Moons\MoonsUpdateCommand::class, @@ -79,8 +78,6 @@ class Kernel extends ConsoleKernel /** * Purge Data Schedule */ - $schedule->command('services:PurgeWormholeData') - ->hourlyAt(20); $schedule->command('services:CleanData') ->weekly(7, '11:00'); $schedule->command('data:PurgeCorpLedgers') diff --git a/app/Http/Controllers/Wormholes/WormholeController.php b/app/Http/Controllers/Wormholes/WormholeController.php deleted file mode 100644 index a2d938a93..000000000 --- a/app/Http/Controllers/Wormholes/WormholeController.php +++ /dev/null @@ -1,148 +0,0 @@ -middleware('auth'); - $this->middleware('role:User'); - } - - public function displayWormholeForm() { - //Declare a few array variables - $duration = array(); - $class = array(); - $stability = array(); - $size = array(); - - //Get the duration from the table - $duration = [ - 'This wormhole has not yet begun its natural cycle of decay and should last at least another day.', - 'This wormhole is beginning to decay, but will not last another day.', - 'This wormhole is reaching the end of its natural lifetime', - ]; - - //Get the wh classes from the table - $class = [ - 'C1', - 'C2', - 'C3', - 'C4', - 'C5', - 'C6', - 'C7', - 'C8', - 'C9', - 'C13', - 'Drifter', - 'Thera', - 'Exit WH', - ]; - - //Get the wh types from the table - $type = WormholeType::groupBy('type')->pluck('type'); - - //Get the wh sizes from the table - $size = [ - 'XS', - 'S', - 'M', - 'L', - 'XL', - ]; - - //Get the wh stabilities from the table - $stability = [ - 'Stable', - 'Non-Critical', - 'Critical', - ]; - - //Return all the variables to the view - return view('wormholes.form')->with('class', $class) - ->with('type', $type) - ->with('size', $size) - ->with('stability', $stability) - ->with('duration', $duration); - } - - public function storeWormhole() { - $this->validate($request, [ - 'sig' => 'required', - 'duration' => 'required', - 'dateTiume' => 'required', - 'class' => 'required', - 'size' => 'required', - 'stability' => 'required', - 'system' => 'required', - ]); - - //Declare some variables - $duration = null; - - //Create the stable time for the database - if($request->duration == 'This wormhole has not yet begun its natural cycle of decay and should last at least another day.') { - $duration = '>24 hours'; - } else if ($request->duration == 'This wormhole is beginning to decay, but will not last another day.') { - $duration = '>4 hours <24 hours'; - } else if($request->duration == 'This wormhole is reaching the end of its natural lifetime') { - '<4 hours'; - } - - //Get the wormhole type from the database so we can enter other details - $wormholeType = WormholeType::where([ - 'type' => $request->type, - ])->first(); - - $found = AllianceWormhole::where([ - 'system' => $request->system, - 'sig_ig' => $request->sig, - ])->count(); - - if($found == 0) { - AllianceWormhole::insert([ - 'system' => $request->system, - 'sig_id' => $request->sig_id, - 'duration_left' => $duration, - 'dateTime' => $request->dateTime, - 'class' => $request->class, - 'type' => $request->class, - 'hole_size' => $request->size, - 'stability' => $request->stability, - 'details' => $request->details, - 'link' => $request->link, - 'mass_allowed' => $wormholeType->mass_allowed, - 'individual_mass' => $wormholeType->individual_mass, - 'regeneration' => $wormholeType->regeneration, - 'max_stable_time' => $wormholeType->max_stable_time, - ]); - - return redirect('/wormholes/display')->with('success', 'Wormhole Info Added.'); - } else { - return redirect('/wormholes/display')->with('error', 'Wormhole already in database.'); - } - } - - public function displayWormholes() { - //Create the date and time - $dateTime = Carbon::now()->subDays(2); - - //Get all of the wormholes from the last 48 hours from the database to display - $wormholes = AllianceWormhole::where('created_at', '>=', $dateTime)->get(); - - return view('wormholes.display')->with('wormholes', $wormholes); - } -} diff --git a/app/Jobs/Commands/Eve/GetEveRegionsJob.php b/app/Jobs/Commands/Eve/GetEveRegionsJob.php deleted file mode 100644 index 417d6b736..000000000 --- a/app/Jobs/Commands/Eve/GetEveRegionsJob.php +++ /dev/null @@ -1,56 +0,0 @@ -invoke('get', '/universe/regions/'); - $responses = $esi->setBody($regions)->invoke('post', '/universe/names/'); - - foreach($responses as $resp) { - if($resp->category == 'region') { - EveRegion::insertOrIgnore([ - 'region_id' => $resp->id, - 'region_name' => $resp->name, - ]); - } - } - - } -} diff --git a/app/Jobs/Commands/Market/GetMarketRegionOrderJob.php b/app/Jobs/Commands/Market/GetMarketRegionOrderJob.php deleted file mode 100644 index b10c2f195..000000000 --- a/app/Jobs/Commands/Market/GetMarketRegionOrderJob.php +++ /dev/null @@ -1,104 +0,0 @@ -region = $region; - //Setup the esi variable - if($esi == null) { - $this->esi = new Esi(); - } else { - $this->esi = $esi; - } - } - - /** - * Execute the job. - * - * @return void - */ - public function handle() - { - //Get the market orders for a region - $orders = $this->esi->invoke('get', '/markets/{region_id}/orders/', [ - 'region_id' => $this->region, - ]); - - foreach($orders as $order) { - $count = MarketRegionOrder::where([ - 'order_id', - ])->count(); - - if($count == 0) { - $newOrder = new MarketRegionOrder; - $newOrder->region_id = $this->region; - $newOrder->duration = $order->duration; - $newOrder->is_buy_order = $order->is_buy_order; - $newOrder->issued = $order->issued; - $newOrder->location_id = $order->location_id; - $newOrder->min_volume = $order->min_volume; - $newOrder->order_id = $order->order_id; - $newOrder->price = $order->price; - $newOrder->range = $order->range; - $newOrder->system_id = $order->system_id; - $newOrder->type_id = $order->type_id; - $newOrder->volume_remain = $order->volume_remain; - $newOrder->volume_total = $order->volume_total; - $newOrder->save(); - } else if ($order->volume_remain == 0) { - MarketRegionOrder::where([ - 'order_id' => $order->order_id, - ])->delete(); - } else { - MarketRegionOrder::where([ - 'order_id' => $order->order_id, - ])->update([ - 'region_id' => $this->region, - 'duration' => $order->duration, - 'is_buy_order' => $order->is_buy_order, - 'issued' => $order->issued, - 'location_id' => $order->location_id, - 'min_volume' => $order->min_volume, - 'order_id' => $order->order_id, - 'price' => $order->price, - 'range' => $order->range, - 'system_id' => $order->system_id, - 'type_id' => $order->type_id, - 'volume_remain' => $order->volume_remain, - 'volume_total' => $order->volume_total, - ]); - } - } - } -} diff --git a/app/Jobs/Commands/Market/PurgeMarketRegionOrderJob.php b/app/Jobs/Commands/Market/PurgeMarketRegionOrderJob.php deleted file mode 100644 index f039dda13..000000000 --- a/app/Jobs/Commands/Market/PurgeMarketRegionOrderJob.php +++ /dev/null @@ -1,34 +0,0 @@ -Buyback Program

- - \ No newline at end of file diff --git a/resources/views/wormholes/display.blade.php b/resources/views/wormholes/display.blade.php deleted file mode 100644 index 8fc012493..000000000 --- a/resources/views/wormholes/display.blade.php +++ /dev/null @@ -1,41 +0,0 @@ -@extends('layouts.user.dashb4') -@section('content') -
- - - - - - - - - - - - - - - - - - @foreach($wormholes as $wormhole) - - - - - - - - - - - - - - - - @endforeach - -
SystemSig IDDuration LeftScan TimeWH ClassHole SizeStabilityMass AllowedIndividual MassRegenerationMax Stable TimeDetailsLink
{{ $wormhole->system }}{{ $wormhole->sig_id }}{{ $wormhole->duration_left }}{{ $wormhole->dateTime }}{{ $wormhole->class }}{{ $wormhole->hole_size }}{{ $wormhole->stability }}{{ $wormhole->mass_allowed }}{{ $wormhole->individual_mass }}{{ $wormhole->regeneration }}{{ $wormhole->max_stable_time }}{{ $wormhole->details }}{{ $wormhole->link }}
-
-@endsection \ No newline at end of file diff --git a/resources/views/wormholes/form.blade.php b/resources/views/wormholes/form.blade.php deleted file mode 100644 index 58a963f46..000000000 --- a/resources/views/wormholes/form.blade.php +++ /dev/null @@ -1,53 +0,0 @@ -@extends('layouts.user.dashb4') -@section('content') -
-
-
-
-

Enter Wormhole Info

-
-
- {!! Form::open(['action' => 'Wormholes\WormholeController@storeWormhole', 'method' => 'POST']) !!} -
- {{ Form::label('system', 'System') }} - {{ Form::text('system', '', ['class' => 'form-control']) }} -
-
- {{ Form::label('sig', 'Sig ID') }} - {{ Form::text('sig', '', ['class' => 'form-control', 'placeholder' => 'XXX-XXX']) }} -
-
- {{ Form::label('duration', 'Duration Left') }} - {{ Form::select('duration', $duration, null, ['class' => 'form-control']) }} -
-
- {{ Form::label('dateTime', 'Date Scanned') }} - {{ Form::date('dateTime', \Carbon\Carbon::now(), ['class' => 'form-control']) }} -
-
- {{ Form::label('class', 'WH Class') }} - {{ Form::select('class', $class, null, ['class' => 'form-control']) }} -
-
- {{ Form::label('size', 'WH Size') }} - {{ Form::select('size', $size, null, ['class' => 'form-control']) }} -
-
- {{ Form::label('stability', 'Stability') }} - {{ Form::select('stability', $stability, null, ['class' => 'form-control']) }} -
-
- {{ Form::label('points', 'Points of Interest') }} - {{ Form::textarea('points', null, ['class' => 'form-control']) }} -
-
- {{ Form::label('link', 'WH Link') }} - {{ Form::text('link', null, ['class' => 'form-control']) }} -
-
- {{ Form::submit('Submit', ['class' => 'btn btn-primary']) }} - {!! Form::close() !!} -
-
-
-@endsection \ No newline at end of file