updated some mining ledger functions, and removed duplicate functionality
This commit is contained in:
@@ -78,73 +78,6 @@ class Esi {
|
||||
return $corporation;
|
||||
}
|
||||
|
||||
public function GetCharacterName($charId) {
|
||||
$esi = $this->SetupEsiAuthentication;
|
||||
|
||||
try {
|
||||
$character = $esi->invoke('get', '/characters/{character_id}/', [
|
||||
'character_id' => $charId,
|
||||
]);
|
||||
} catch(RequestFailedException $e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $character->name;
|
||||
}
|
||||
|
||||
public function FindCharacterId($name) {
|
||||
$config = config('esi');
|
||||
|
||||
$esi = $this->SetupEsiAuthentication();
|
||||
|
||||
try {
|
||||
$character = $esi->setBody(array(
|
||||
$name,
|
||||
))->invoke('post', '/universe/ids/');
|
||||
} catch(RequestFailedException $e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(isset($character->characters[0]->id)) {
|
||||
return $character->characters[0]->id;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function FindCorporationId($charId) {
|
||||
$esi = $this->SetupEsiAuthentication();
|
||||
|
||||
try {
|
||||
$character = $esi->invoke('get', '/characters/{character_id}/', [
|
||||
'character_id' => $charId,
|
||||
]);
|
||||
} catch(RequestFailedException $e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $character->corporation_id;
|
||||
}
|
||||
|
||||
public function FindCorporationName($charId) {
|
||||
$esi = $this->SetupEsiAuthentication();
|
||||
|
||||
try {
|
||||
$character = $esi->invoke('get', '/characters/{character_id}/', [
|
||||
'character_id' => $charId,
|
||||
]);
|
||||
|
||||
$corporation = $esi->invoke('get', '/corporations/{corporation_id}/', [
|
||||
'corporation_id' => $character->corporation_id,
|
||||
]);
|
||||
} catch(RequestFailedException $e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return $corporation->name;
|
||||
}
|
||||
|
||||
public function DecodeDate($date) {
|
||||
//Find the end of the date
|
||||
$dateEnd = strpos($date, "T");
|
||||
|
||||
Reference in New Issue
Block a user