- fixed "online" status for characters, closed #507

- reduced "afk" wait time until cronjob location check for a character from 5min to 3min
This commit is contained in:
Exodus4D
2017-07-16 15:39:20 +02:00
parent 24e006230d
commit 5d57f30782
3 changed files with 21 additions and 6 deletions

View File

@@ -632,6 +632,14 @@ class CharacterModel extends BasicModel {
return $rolesData;
}
/**
* check whether this char has accepted all "basic" api scopes
* @return bool
*/
public function hasBasicScopes(){
return empty( array_diff(Sso::getScopesByAuthType(), $this->esiScopes) );
}
/**
* check whether this char has accepted all admin api scopes
* @return bool
@@ -650,8 +658,12 @@ class CharacterModel extends BasicModel {
$deleteLog = false;
$invalidResponse = false;
//check if log update is enabled for this user
if( $this->logLocation ){
//check if log update is enabled for this character
// check if character has accepted all scopes. (This fkt is called by cron as well)
if(
$this->logLocation &&
$this->hasBasicScopes()
){
// Try to pull data from API
if( $accessToken = $this->getAccessToken() ){
$onlineData = self::getF3()->ccpClient->getCharacterOnlineData($this->_id, $accessToken, $additionalOptions);