mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-12-02 00:52:54 +00:00
38 lines
No EOL
778 B
JavaScript
38 lines
No EOL
778 B
JavaScript
"use strict";
|
|
|
|
/*
|
|
* Implements User Model
|
|
*
|
|
*/
|
|
|
|
var client = require("../ensl/client")();
|
|
|
|
function User (user) {
|
|
this.id = user['id'];
|
|
this.online = true;
|
|
this.username = user['username'];
|
|
this.country = user['country'];
|
|
this.time_zone = user['time_zone'];
|
|
this.avatar = client.baseUrl + user['avatar'];
|
|
this.admin = user['admin'];
|
|
this.team = user['team'];
|
|
this.bans = user['bans'];
|
|
if (user['steam']) {
|
|
this.steam = {
|
|
url: user['steam']['url'],
|
|
nickname: user['steam']['nickname']
|
|
};
|
|
} else {
|
|
this.steam = {
|
|
url: null,
|
|
nickname: null
|
|
};
|
|
}
|
|
this.ability = {
|
|
division: "Div " + (Math.floor(Math.random() * 4) + 1),
|
|
lifeforms: [["Lerk", "Onos", "Fade"][Math.floor(Math.random() * 3)]],
|
|
commander: true
|
|
}
|
|
}
|
|
|
|
module.exports = User; |