mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-01-31 21:40:38 +00:00
Pull steam id from ensl api
This commit is contained in:
parent
c61681997a
commit
8e8eeef844
1 changed files with 2 additions and 3 deletions
|
@ -24,7 +24,7 @@ function User (user) {
|
|||
this.team = user['team'];
|
||||
this.bans = user['bans'];
|
||||
this.steam = {
|
||||
id: null,
|
||||
id: user['steam']['id'] || null,
|
||||
url: user['steam']['url'] || null,
|
||||
nickname: user['steam']['nickname'] || null
|
||||
};
|
||||
|
@ -34,7 +34,6 @@ function User (user) {
|
|||
};
|
||||
|
||||
if (this.steam.url) {
|
||||
this.steam.id = this.getSteamId();
|
||||
this.hive.id = this.getHiveId();
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +46,7 @@ User.prototype.getSteamId = () => {
|
|||
};
|
||||
|
||||
User.prototype.getHiveId = () => {
|
||||
var steamId = this.getSteamId();
|
||||
var steamId = this.steam.id;
|
||||
if (!steamId) return null;
|
||||
var index = steamId.match(/:0:/) ? 0 : 1;
|
||||
var tailId = parseInt(steamId.match(/\d*$/), 10);
|
||||
|
|
Loading…
Reference in a new issue