1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00

allow more steamid formats in user api

This commit is contained in:
Robin Appelman 2018-03-10 16:56:47 +01:00
commit ecb9e41999
4 changed files with 11 additions and 11 deletions

View file

@ -117,7 +117,7 @@ class Parser {
$players[] = new ParsedPlayer(
$player['name'],
$player['userId'],
$this->convertSteamIdToCommunityId($player['steamId']),
self::convertSteamIdToCommunityId($player['steamId']),
$player['team'] ?? '',
$this->getClassName((int) $class)
);
@ -151,7 +151,7 @@ class Parser {
*
* @return string The converted 64bit numeric SteamID
*/
public function convertSteamIdToCommunityId(string $steamId): string {
public static function convertSteamIdToCommunityId(string $steamId): string {
if ($steamId === 'STEAM_ID_LAN' || $steamId === 'BOT') {
throw new \InvalidArgumentException("Cannot convert SteamID \"$steamId\" to a community ID.");
}