This commit is contained in:
Kim Ravn Hansen
2025-09-08 10:39:45 +02:00
parent 8a4eb25507
commit c8c7259574
11 changed files with 76 additions and 34 deletions

View File

@@ -25,6 +25,21 @@ export class Player {
return this._passwordHash;
}
/** @type {Date} */
_createdAt = new Date();
/** @type {Date|null} Date of the player's last websocket message. */
lastActivityAt = null;
/** @type {Date|null} Date of the player's last login. */
lastSucessfulLoginAt = null;
/** @type {number} Number of successful logins on this character */
successfulLogins = 0;
/** @type {number} Number of failed login attempts since the last good login attempt */
failedPasswordsSinceLastLogin = 0;
/** @protected @type {Set<Character>} */
_characters = new Set();
get characters() {
@@ -39,7 +54,7 @@ export class Player {
this._username = username;
this._passwordHash = passwordHash;
this.createdAt = new Date();
this._createdAt = new Date();
}
setPasswordHash(hashedPassword) {