blob: 87f533631140376fe097e627e5a6ce3b8723a3c0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
const Char = require("./Char.js");
/**
* represents a generic game account
*/
module.exports = class GameAccount {
/** the GID of the account */
accountId = 0;
/** the login username */
userid = "";
/** the email address associated with the account */
email = null;
/** game characters
* @type {Char[]}
*/
chars = [];
/** the last time the account logged in */
lastLogin = null;
/** the last IP that was used to log in */
lastIP = null;
/** the total number of times the account logged in */
loginCount = 0;
/** whether the account is banned */
banned = false;
constructor (id, name) {
this.accountId = id;
this.userid = name;
}
/**
* serialize for sending over the network
* @param {*} key
*/
toJSON (key) {
return {
accountId: this.accountId,
name: this.userid,
chars: this.chars,
};
}
}
|