create migration to remove fleet_end from Fleets table

cleaned up register fleet in FleetsController
modified FleetHelper class
This commit is contained in:
2018-12-03 13:52:57 -06:00
parent af7b3a2376
commit 10f9be7746
5 changed files with 39 additions and 66 deletions
+5 -45
View File
@@ -17,9 +17,8 @@ use Seat\Eseye\Eseye;
class FleetHelper {
private $fleet;
private $fleetUri;
private $fcId;
private $endTime;
/**
* Constructor
@@ -41,50 +40,15 @@ class FleetHelper {
$uris = explode('https://esi.tech.ccp.is/v1/fleets/', $fleetUri);
//Trim the right side of the fleet number
$fleetUri = rtrim($uris[1], '/?datasource=tranquility');
$this->fleet = $fleetUri;
$this->fleetUri = $fleetUri;
}
public function GetFleetUri() {
return $this->fleet;
return $this->fleetUri;
}
/**
* Set the fleet's end time
*
* @param endTime
*/
public function SetFleetEndTime($endTime) {
$this->endTime = $endTime;
}
public function UpdateFleet($fleet, $isFreeMove, $motd) {
//Get the fcid from the datatable
$fc = DB::table('Fleets')->where('fleet', $fleetId)->get();
//Check if the fc has the right scope
if(!$this->HaveEsiScope($fc->character_id, 'esi-fleets.write_fleet.v1')) {
return 1;
}
//Get the FC's refresh token from the table
$token = DB::table('EsiTokens')->where('character_id', $fc->character_id)->first();
//Create the esi authentication container
$config = config('esi');
$authentication = new EsiAuthentication([
'client_id' => $config['client_id'],
'secret' => $config['secret'],
'refresh_token' => $token->refresh_token,
]);
//Create the esi class
$esi = new Eseye($authentication);
$error = $esi->invoke('put', '/fleets/{fleet_id}/', [
'fleet_id' => $fleet,
'new_settings' => [
'is_free_move' => $isFreeMove,
'motd' => $motd,
],
]);
return $error;
public function UpdateFleet() {
return null;
}
public function AddPilot($fc, $charId, $fleetId) {
@@ -119,10 +83,6 @@ class FleetHelper {
return null;
}
public function RenderFleetDisplay() {
//
}
}
?>