removed several things including wormholes which weren't being utilized at all
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Eve;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
//Library
|
||||
use Commands\Library\CommandHelper;
|
||||
|
||||
//Job
|
||||
use App\Jobs\Commands\Eve\GetEveRegionsJob;
|
||||
|
||||
class GetEveRegionsCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'eve:getRegions';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Gets all of the information for regions from the eve esi';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
GetEveRegionsJob::dispatch();
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Console\Command;
|
||||
use Log;
|
||||
|
||||
//Library
|
||||
use Commands\Library\CommandHelper;
|
||||
|
||||
//Jobs
|
||||
use App\Jobs\Commands\Market\GetMarketRegionOrderJob;
|
||||
|
||||
class GetMarketDataCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'services:MarketData';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Get the market data for regions';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$task = new CommandHelper('GetMarketData');
|
||||
$task->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();
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Console\Command;
|
||||
use Log;
|
||||
|
||||
//Library
|
||||
use Commands\Library\CommandHelper;
|
||||
|
||||
//Jobs
|
||||
use App\Jobs\Commands\Market\PurgeMarketRegionOrderJob;
|
||||
|
||||
class PurgeMarketDataCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'services:PurgeMarketData';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Purges old market data from the database';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
PurgeMarketDataJob::dispatch();
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Wormholes;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Console\Command;
|
||||
use Carbon\Carbon;
|
||||
|
||||
//Models
|
||||
use App\Models\Wormholes\AllianceWormhole;
|
||||
|
||||
class PurgeWormholes extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'services:PurgeWormholeData';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Purge stale wormhole data automatically';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//Time of now
|
||||
$currentTime = Carbon::now();
|
||||
|
||||
AllianceWormhole::where('created_at', '<', $currentTime->subHours(48))->delete();
|
||||
}
|
||||
}
|
||||
@@ -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')
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Wormholes;
|
||||
|
||||
//Laravel Libraries
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
|
||||
//User Libraries
|
||||
|
||||
//Models
|
||||
use App\Models\Wormholes\AllianceWormhole;
|
||||
use App\Models\Wormholes\WormholeType;
|
||||
|
||||
class WormholeController extends Controller
|
||||
{
|
||||
public function __construct() {
|
||||
$this->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);
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Commands\Eve;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Log;
|
||||
|
||||
//Library
|
||||
use Seat\Eseye\Exceptions\RequestFailedException;
|
||||
use App\Library\Esi\Esi;
|
||||
|
||||
//Models
|
||||
use App\Models\Eve\EveRegion;
|
||||
|
||||
class GetEveRegionsJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$esi = new Esi();
|
||||
|
||||
$regions = $esi->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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Commands\Market;
|
||||
|
||||
//Internal Library
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Carbon\Carbon;
|
||||
use Log;
|
||||
|
||||
//App Library
|
||||
use Seat\Eseye\Exceptions\RequestFailedException;
|
||||
use App\Library\Esi\Esi;
|
||||
use App\Library\Lookups\LookupHelper;
|
||||
|
||||
class GetMarketRegionOrderJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Private variables
|
||||
*/
|
||||
private $esi;
|
||||
private $region;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($region, $esi = null)
|
||||
{
|
||||
//Setup the region variable
|
||||
$this->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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
|
||||
class PurgeMarketRegionOrderJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -30,17 +30,5 @@
|
||||
<p>Buyback Program</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/wormholes/display" class="nav-link">
|
||||
<i class="far fa-circle nav-icon"></i>
|
||||
<p>Wormholes</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/wormholes/form" class="nav-link">
|
||||
<i class="far fa-circle nav-icon"></i>
|
||||
<p>Wormhole Form</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -1,41 +0,0 @@
|
||||
@extends('layouts.user.dashb4')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>System</th>
|
||||
<th>Sig ID</th>
|
||||
<th>Duration Left</th>
|
||||
<th>Scan Time</th>
|
||||
<th>WH Class</th>
|
||||
<th>Hole Size</th>
|
||||
<th>Stability</th>
|
||||
<th>Mass Allowed</th>
|
||||
<th>Individual Mass</th>
|
||||
<th>Regeneration</th>
|
||||
<th>Max Stable Time</th>
|
||||
<th>Details</th>
|
||||
<th>Link</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($wormholes as $wormhole)
|
||||
<tr>
|
||||
<td>{{ $wormhole->system }}</td>
|
||||
<td>{{ $wormhole->sig_id }}</td>
|
||||
<td>{{ $wormhole->duration_left }}</td>
|
||||
<td>{{ $wormhole->dateTime }}</td>
|
||||
<td>{{ $wormhole->class }}</td>
|
||||
<td>{{ $wormhole->hole_size }}</td>
|
||||
<td>{{ $wormhole->stability }}</td>
|
||||
<td>{{ $wormhole->mass_allowed }}</td>
|
||||
<td>{{ $wormhole->individual_mass }}</td>
|
||||
<td>{{ $wormhole->regeneration }}</td>
|
||||
<td>{{ $wormhole->max_stable_time }}</td>
|
||||
<td>{{ $wormhole->details }}</td>
|
||||
<td>{{ $wormhole->link }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -1,53 +0,0 @@
|
||||
@extends('layouts.user.dashb4')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Enter Wormhole Info</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{!! Form::open(['action' => 'Wormholes\WormholeController@storeWormhole', 'method' => 'POST']) !!}
|
||||
<div class="form-group">
|
||||
{{ Form::label('system', 'System') }}
|
||||
{{ Form::text('system', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('sig', 'Sig ID') }}
|
||||
{{ Form::text('sig', '', ['class' => 'form-control', 'placeholder' => 'XXX-XXX']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('duration', 'Duration Left') }}
|
||||
{{ Form::select('duration', $duration, null, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('dateTime', 'Date Scanned') }}
|
||||
{{ Form::date('dateTime', \Carbon\Carbon::now(), ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('class', 'WH Class') }}
|
||||
{{ Form::select('class', $class, null, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('size', 'WH Size') }}
|
||||
{{ Form::select('size', $size, null, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('stability', 'Stability') }}
|
||||
{{ Form::select('stability', $stability, null, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('points', 'Points of Interest') }}
|
||||
{{ Form::textarea('points', null, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('link', 'WH Link') }}
|
||||
{{ Form::text('link', null, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user