diff --git a/server/chat-commands.js b/server/chat-commands.js index f2a67c99cf..9116cd468d 100644 --- a/server/chat-commands.js +++ b/server/chat-commands.js @@ -3609,7 +3609,7 @@ const commands = { if (cmd.charAt(cmd.length - 1) === ',') cmd = cmd.slice(0, -1); let targets = target.split(','); function getPlayer(input) { - let player = room.battle.players[toId(input)]; + let player = room.battle.playerTable[toId(input)]; if (player) return player.slot; if (input.includes('1')) return 'p1'; if (input.includes('2')) return 'p2'; @@ -3954,7 +3954,7 @@ const commands = { return this.sendReply(`The game timer is ON (requested by ${[...timer.timerRequesters].join(', ')})`); } const force = user.can('timer', null, room); - if (!force && !room.game.players[user]) { + if (!force && !room.game.playerTable[user]) { return this.errorReply(`Access denied.`); } if (this.meansNo(target) || target === 'stop') { diff --git a/server/chat-plugins/helptickets.js b/server/chat-plugins/helptickets.js index 1f5c371d46..9fa508e894 100644 --- a/server/chat-plugins/helptickets.js +++ b/server/chat-plugins/helptickets.js @@ -110,7 +110,7 @@ class HelpTicket extends Rooms.RoomGame { * @param {User} user */ onLeave(user) { - if (user.userid in this.players) { + if (user.userid in this.playerTable) { this.removePlayer(user); return; } @@ -158,7 +158,7 @@ class HelpTicket extends Rooms.RoomGame { * @param {User} user */ forfeit(user) { - if (!(user.userid in this.players)) return; + if (!(user.userid in this.playerTable)) return; this.removePlayer(user); if (!this.ticket.open) return; this.modnote(user, `${user.name} is no longer interested in this ticket.`); @@ -230,7 +230,7 @@ class HelpTicket extends Rooms.RoomGame { this.modnote(staff, `${staff.name} closed this ticket.`); notifyStaff(this.ticket.escalated); this.room.pokeExpireTimer(); - for (const ticketGameUser of Object.values(this.players)) { + for (const ticketGameUser of Object.values(this.playerTable)) { this.removePlayer(ticketGameUser); const user = Users(ticketGameUser.userid); if (user) user.updateSearch(); @@ -901,7 +901,7 @@ let commands = { const ticketGame = /** @type {HelpTicket} */ (helpRoom.game); ticketGame.modnote(user, `${user.name} opened a new ticket. Issue: ${ticket.type}`); this.parse(`/join help-${user.userid}`); - if (!(user.userid in ticketGame.players)) { + if (!(user.userid in ticketGame.playerTable)) { // User was already in the room, manually add them to the "game" so they get a popup if they try to leave ticketGame.addPlayer(user); } diff --git a/server/chat-plugins/info.js b/server/chat-plugins/info.js index a28f22c975..8531981b77 100644 --- a/server/chat-plugins/info.js +++ b/server/chat-plugins/info.js @@ -188,7 +188,7 @@ const commands = { let gameRooms = []; for (const room of Rooms.rooms.values()) { if (!room.game) continue; - if ((targetUser.userid in room.game.players && !targetUser.inRooms.has(room.id)) || + if ((targetUser.userid in room.game.playerTable && !targetUser.inRooms.has(room.id)) || room.auth[targetUser.userid] === Users.PLAYER_SYMBOL) { if (room.isPrivate && !canViewAlts) { continue; diff --git a/server/chat-plugins/jeopardy.js b/server/chat-plugins/jeopardy.js index e582715375..d7b8f967e2 100644 --- a/server/chat-plugins/jeopardy.js +++ b/server/chat-plugins/jeopardy.js @@ -87,16 +87,16 @@ class Jeopardy extends Rooms.RoomGame { } this.roundstarted = true; if (this.round === 1) { - for (let userID in this.players) { - let player = this.players[userID]; + for (let userID in this.playerTable) { + let player = this.playerTable[userID]; this.points.set(player, 0); } } this.state = 'selecting'; let lowest = []; let minpoints; - for (let userID in this.players) { - let points = this.players[userID].points; + for (let userID in this.playerTable) { + let points = this.playerTable[userID].points; if (!minpoints) { lowest.push(userID); minpoints = points; @@ -107,7 +107,7 @@ class Jeopardy extends Rooms.RoomGame { lowest.push(userID); } } - this.curPlayer = this.players[lowest[Math.floor(lowest.length * Math.random())]]; + this.curPlayer = this.playerTable[lowest[Math.floor(lowest.length * Math.random())]]; this.prevPlayer = this.curPlayer; this.update(); this.nextPlayer(); @@ -134,8 +134,8 @@ class Jeopardy extends Rooms.RoomGame { if (this.question && !this.finals) { buffer += `