mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-04 10:24:07 +02:00
dont rely on the steam api for getting user names
This commit is contained in:
parent
3c3b23d1a3
commit
fd9a7e8527
13 changed files with 54 additions and 78 deletions
|
|
@ -13,19 +13,17 @@ class DemoPlayer implements JsonSerializable {
|
|||
private string $team;
|
||||
private string $class;
|
||||
private string $steamId;
|
||||
private string $avatar;
|
||||
private int $kills;
|
||||
private int $assists;
|
||||
private int $deaths;
|
||||
|
||||
public function __construct(int $id, int $userId, string $name, string $team, string $class, string $steamId, string $avatar, int $kills, int $assists, int $deaths) {
|
||||
public function __construct(int $id, int $userId, string $name, string $team, string $class, string $steamId, int $kills, int $assists, int $deaths) {
|
||||
$this->id = $id;
|
||||
$this->userId = $userId;
|
||||
$this->name = $name;
|
||||
$this->team = $team;
|
||||
$this->class = $class;
|
||||
$this->steamId = $steamId;
|
||||
$this->avatar = $avatar;
|
||||
$this->kills = $kills;
|
||||
$this->assists = $assists;
|
||||
$this->deaths = $deaths;
|
||||
|
|
@ -55,10 +53,6 @@ class DemoPlayer implements JsonSerializable {
|
|||
return $this->steamId;
|
||||
}
|
||||
|
||||
public function getAvatar(): string {
|
||||
return $this->avatar;
|
||||
}
|
||||
|
||||
public function getKills(): int {
|
||||
return $this->kills;
|
||||
}
|
||||
|
|
@ -84,7 +78,6 @@ class DemoPlayer implements JsonSerializable {
|
|||
$row['team'],
|
||||
$row['class'],
|
||||
$row['steamid'],
|
||||
$row['avatar'],
|
||||
$row['kills'],
|
||||
$row['assists'],
|
||||
$row['deaths']
|
||||
|
|
@ -99,7 +92,6 @@ class DemoPlayer implements JsonSerializable {
|
|||
'team' => $this->getTeam(),
|
||||
'class' => $this->getClass(),
|
||||
'steamid' => $this->getSteamId(),
|
||||
'avatar' => $this->getAvatar(),
|
||||
'kills' => $this->getKills(),
|
||||
'assists' => $this->getAssists(),
|
||||
'deaths' => $this->getDeaths(),
|
||||
|
|
|
|||
|
|
@ -10,14 +10,12 @@ class User implements JsonSerializable {
|
|||
private int $id;
|
||||
private string $steamId;
|
||||
private string $name;
|
||||
private string $avatar;
|
||||
private string $token;
|
||||
|
||||
public function __construct(int $id, string $steamId, string $name, string $avatar, string $token) {
|
||||
public function __construct(int $id, string $steamId, string $name, string $token) {
|
||||
$this->id = $id;
|
||||
$this->steamId = $steamId;
|
||||
$this->name = $name;
|
||||
$this->avatar = $avatar;
|
||||
$this->token = $token;
|
||||
}
|
||||
|
||||
|
|
@ -33,10 +31,6 @@ class User implements JsonSerializable {
|
|||
return $this->name;
|
||||
}
|
||||
|
||||
public function getAvatar(): string {
|
||||
return $this->avatar;
|
||||
}
|
||||
|
||||
public function getToken(): string {
|
||||
return $this->token;
|
||||
}
|
||||
|
|
@ -46,7 +40,6 @@ class User implements JsonSerializable {
|
|||
'id' => $this->getId(),
|
||||
'steamid' => $this->getSteamId(),
|
||||
'name' => $this->getName(),
|
||||
'avatar' => $this->getAvatar(),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +53,6 @@ class User implements JsonSerializable {
|
|||
(int) $row['id'],
|
||||
$row['steamid'],
|
||||
$row['name'],
|
||||
$row['avatar'],
|
||||
$row['token'] ?? ''
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue