Retrieve Game Mode Stats

@access public
@return object JSON
14069
public function retrieveGameModeStats ()
    {
        $data = file_get_contents("http://battlefield.play4free.com/en/profile/stats/" .$this->_profileID. "/" .$this->_soldierID. "?g=[%22GameModeStats%22]");
        $gameModeStats = json_decode($data);
        return $gameModeStats;
    }
489707
public function retrieveVehicleStats ()
    {
        $data = file_get_contents("http://battlefield.play4free.com/en/profile/stats/" .$this->_profileID. "/" .$this->_soldierID. "?g=[%22VehicleStats%22]");
        $vehicleStats = json_decode($data);
        return $vehicleStats;
    }
240631
public function toJson()
    {
        $json = array();

        $json['name'] = $this->getName();
        $json['privacy'] = $this->getPrivacy();
        //Parameters for PUT call (Room already exists)
        if ($this->getId()) {
            $json['is_archived'] = $this->isArchived();
            $json['is_guest_accessible'] = $this->isGuestAccessible();
            $json['topic'] = $this->getTopic();
            $json['owner'] = array('id' => $this->getOwner()->getId());
        } else { //Paramters for POST call
            $json['guest_access'] = $this->isGuestAccessible();
            if ($this->getOwner()) {
                $json['owner_user_id'] = $this->getOwner()->getId();
            }
        }
        return $json;
    }
481459
public function trophyInfo() : ?object
    {
        if ($this->game === null) {
            // Kind of a hack here.
            // This endpoint doesn't give exactly the same information as the proper Game endpoint would,
            // But I wasn't able to find a way to get info from the Game endpoint with just a titleId.
            // It works, but I'd rather it be more consistent with the other endpoint.
            $game = $this->get(Trophy::TROPHY_ENDPOINT . 'apps/trophyTitles', [
                'npTitleIds' => $this->titleId,
                'fields' => '@default',
                'npLanguage' => 'en'
            ]);
            
            if (!count($game->apps) || !count($game->apps[0]->trophyTitles)) return null;

            $this->npCommunicationId = $game->apps[0]->trophyTitles[0]->npCommunicationId;

            $data = [
                'npLanguage' => 'en'
            ];

            if ($this->comparing()) {
                $data['comparedUser'] = $this->user()->onlineId();
            }

            $game = $this->get(sprintf(Trophy::TROPHY_ENDPOINT . 'trophyTitles/%s', $this->npCommunicationId), $data);

            if ($game->totalResults !== 1 || !count($game->trophyTitles)) return null;

            $this->game = $game->trophyTitles[0];
        }

        return $this->game;
    }
393625
public function getVarForDisplay()
    {

        if( is_object( $this->var ) ) {
            $output = "object ". get_class( $this->var );
        } elseif( is_string( $this->var ) or is_array( $this->var ) ) {
            $type = is_string( $this->var ) ? 'string' : 'array';
            $working = json_encode($this->var);
            $length = strlen( $working );
            if( $length > 50 ) {
                $output = sprintf(
                    "%s %s ... %s chars ommited",
                    $type,
                    substr( $working, 0, 40 ),
                    $length - 40
                );
            } else {
                $output = "{$type} {$working}";
            }
        } elseif( is_null( $this->var ) ) {
            $output = "NULL";
        } elseif( is_bool( $this->var ) ) {
            $output = $this->var ? "TRUE" : "FALSE";
        } elseif( is_int( $this->var ) ) {
            $output = "int {$this->var}";
        } elseif( is_float( $this->var ) ) {
            $output = "float {$this->var}";
        } elseif( is_resource( $this->var ) ) {
            $output = "resource `" .get_resource_type( $this->var ) . "`";
        } else {
            $output = print_r( $this->var, true );
        }

        return $output;

    }
81055
public function getEntries()
    {
        $url = UrlHelper::buildUrl(Urls::URL_QUERY_CACHE, ['entries']);
        $result = $this->getConnection()->get($url);

        return $result->getJson();
    }
254029
public function getJSON()
    {
        global $CFG;
        $PDOX = $this->launch->pdox;

        $stmt = $PDOX->queryDie(
            "SELECT json FROM {$CFG->dbprefix}lti_result
                WHERE result_id = :RID",
            array(':RID' => $this->id)
        );
        $row = $stmt->fetch(\PDO::FETCH_ASSOC);
        return $row['json'];
    }
660760
protected function getJson()
    {
        if ($this->str_request_body_json === null) {
            $this->str_request_body_json = json_decode($this->getBody());
        }
        return $this->str_request_body_json;
    }
480814
protected function toJson()
    {
        $serializedActionResults = [];

        foreach ($this->results as $action => $result) {
            $serializedActionResults[$action] = serialize($result);
        }

        $responseData = [
            'requestId' => $this->requestId,
            'actionResults' => $serializedActionResults
        ];

        return json_encode($responseData);
    }
1050344
protected function GetTotalStatistics()
    {
        $sTotalStatistics = "#########################################################\r\n";
        $sTotalStatistics .= TGlobal::Translate('chameleon_system_shop.cron_send_basket_stats.headline')."\r\n";
        $sTotalStatistics .= "------------------------------------\r\n";
        foreach ($this->aCancelStep as $sStempName => $sValue) {
            $sPercent = round((100 / $this->sTotalBaskets) * $sValue);
            if ($sStempName != TGlobal::Translate('chameleon_system_shop.cron_send_basket_stats.completed')) {
                $sTotalStatistics .= TGlobal::Translate(
                        'chameleon_system_shop.cron_send_basket_stats.text_aborted',
                        array(
                            '%step%' => $sStempName,
                            '%value%' => $sValue,
                            '%totalBaskets%' => $this->sTotalBaskets,
                            '%percent%' => $sPercent,
                        )
                    )."\r\n";
            } else {
                $sTotalStatistics .= TGlobal::Translate(
                        'chameleon_system_shop.cron_send_basket_stats.text_completed',
                        array(
                            '%value%' => $sValue,
                            '%totalBaskets%' => $this->sTotalBaskets,
                            '%percent%' => $sPercent,
                        )
                    )."\r\n";
            }
        }
        $sTotalStatistics .= TGlobal::Translate('chameleon_system_shop.cron_send_basket_stats.text_total_aborted_orders').': '.$this->sTotalMoneyCanceled;

        return $sTotalStatistics."\r\n";
    }
879323
public function getJsonResource()
    {

        $result = $this->getGuzzle()->request('GET',
            'https://raw.githubusercontent.com/eveseat/resources/master/sde.json', [
                'headers' => ['Accept' => 'application/json'],
            ]);

        if ($result->getStatusCode() != 200)
            return json_encode([]);

        return json_decode($result->getBody());
    }
489695
public function getStatisticsRequest()
    {
        $operation = array(
            'API' => 'GetBucketStatistics',
            'Method' => 'GET',
            'Uri' => '/<bucket-name>?stats',
            'Headers' => array(
                'Host' => $this->properties['zone'] . '.' . $this->config->host,
            ),
            'Params' => array(
            ),
            'Elements' => array(
            ),
            'Properties' => $this->properties,
            'Body' => null
        );
        $this->getStatisticsValidate($operation);
        $req = new Request($this->config, $operation);
        return $req;
    }
137470
protected function getStatsAttribute()
    {
        if (empty($this->response->output)) {
            return;
        }
        $o = $this->response->output;

        return array_filter([
            'Bitrate' => number_format($o->video_bitrate_in_kbps
                + $o->audio_bitrate_in_kbps).' kbps',
            'Filesize' => number_format($o->file_size_in_bytes/1024/1024, 1).' mb',
            'Duration' => number_format($o->duration_in_ms/1000, 1).' s',
            'Dimensions' => number_format($o->width).' x '.number_format($o->height),
            'Download' => '<a href="'.$this->outputs->mp4.'" target="_blank">MP4</a>'
        ]);
    }
1218050
public function retrieveWeaponStats ()
    {
        $data = file_get_contents("http://battlefield.play4free.com/en/profile/stats/" .$this->_profileID. "/" .$this->_soldierID. "?g=[%22WeaponStats%22]");
        $weapons = json_decode($data);
        return $weapons;
    }
693952
public function stats() {
		$res = [];

		$query = $this->find();
		$list = $query
			->select(['count' => $query->count(), 'country_id'])
			->group('country_id')
			->hydrate(false)
			->all();

		foreach ($list as $x) {
			$res[$x['country_id']] = (int)$x['count'];
		}

		return $res;
	}
802417
public function getStats()
    {
        $result = [
            self::STATS_QUEUES_LIST   => [],
            self::STATS_JOBS_TOTAL    => 0,
            self::STATS_JOBS_READY    => 0,
            self::STATS_JOBS_RESERVED => 0,
            self::STATS_JOBS_DELAYED  => 0,
            self::STATS_JOBS_BURIED   => 0,
        ];

        $queueList = $this->getQueueNames();
        if (count($queueList) == 0) {
            return $result;
        }

        $result[self::STATS_QUEUES_LIST] = $queueList;

        foreach ($queueList as $queueName) {
            $itemStats = $this->getQueueInfo($queueName);
            $result[self::STATS_JOBS_READY] += $itemStats[self::STATS_JOBS_READY];
            $result[self::STATS_JOBS_RESERVED] += $itemStats[self::STATS_JOBS_RESERVED];
            $result[self::STATS_JOBS_DELAYED] += $itemStats[self::STATS_JOBS_DELAYED];
            $result[self::STATS_JOBS_BURIED] += $itemStats[self::STATS_JOBS_BURIED];
            $result[self::STATS_JOBS_TOTAL] += $itemStats[self::STATS_JOBS_TOTAL];
            $result[self::STATS_QUEUES][$queueName] = $itemStats;
        }

        return $result;
    }
487388
def stats(self):
        
        stats_online = CRef.cint()
        stats_ingame = CRef.cint()
        stats_chatting = CRef.cint()

        self._iface.get_clan_stats(
            self.group_id,
            stats_online,
            stats_ingame,
            stats_chatting,
        )

        return {
            'online': int(stats_online),
            'ingame': int(stats_ingame),
            'chatting': int(stats_chatting),
        }