/** * Returns all Golden Wrenches * * @return array All Golden Wrenches * @throws \SteamCondenser\Exceptions\SteamCondenserException If an error * occurs querying the Web API or the Steam Community */ public static function getGoldenWrenches() { if (self::$goldenWrenches == null) { self::$goldenWrenches = []; $data = json_decode(WebApi::getJSON('ITFItems_440', 'GetGoldenWrenches', 2)); foreach ($data->results->wrenches as $wrenchData) { self::$goldenWrenches[] = new TF2GoldenWrench($wrenchData); } } return self::$goldenWrenches; }
/** * Resolves a vanity URL of a Steam Community profile to a 64bit numeric * SteamID * * @param string $vanityUrl The vanity URL of a Steam Community profile * @return string The 64bit SteamID for the given vanity URL * @throws WebApiException if the request to Steam's Web API fails */ public static function resolveVanityUrl($vanityUrl) { $params = ['vanityurl' => $vanityUrl]; $json = WebApi::getJSON('ISteamUser', 'ResolveVanityURL', 1, $params); $result = json_decode($json); $result = $result->response; if ($result->success != 1) { return null; } return $result->steamid; }
/** * Returns the overall number of players currently playing this game * * @return int The number of players playing this game */ public function getPlayerCount() { $params = ['appid' => $this->appId]; $result = WebApi::getJSON('ISteamUserStats', 'GetNumberOfCurrentPlayers', 1, $params); $result = json_decode($result); return $result->response->player_count; }