diff options
author | gumi <git@gumi.ca> | 2020-03-04 21:22:46 -0500 |
---|---|---|
committer | gumi <git@gumi.ca> | 2020-03-04 21:22:46 -0500 |
commit | ecb8bd66d17592346c8855bb021dae802552dabf (patch) | |
tree | 47463d662934a09da88daf4dbd55008627f2a1c1 /src/routers/vault/types/GameAccount.js | |
parent | 349053954d45e4625ab35e6b2383608e5132eba3 (diff) | |
download | apiv1-ecb8bd66d17592346c8855bb021dae802552dabf.tar.gz apiv1-ecb8bd66d17592346c8855bb021dae802552dabf.tar.bz2 apiv1-ecb8bd66d17592346c8855bb021dae802552dabf.tar.xz apiv1-ecb8bd66d17592346c8855bb021dae802552dabf.zip |
pre-cache the game accounts on login
Diffstat (limited to 'src/routers/vault/types/GameAccount.js')
-rw-r--r-- | src/routers/vault/types/GameAccount.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/routers/vault/types/GameAccount.js b/src/routers/vault/types/GameAccount.js new file mode 100644 index 0000000..fa94808 --- /dev/null +++ b/src/routers/vault/types/GameAccount.js @@ -0,0 +1,38 @@ +/** + * 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; + /** 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, + }; + } +} |