From 4646f86635c66bd5ed1490609f65c343b41b9d71 Mon Sep 17 00:00:00 2001 From: Shaun Date: Sat, 30 Apr 2022 17:58:12 +0200 Subject: [PATCH] bug #1915: Fixed noit being able to log yourself out if you are in an instanced zone --- src/server/security/connections.js | 4 ++-- src/server/world/atlas.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/security/connections.js b/src/server/security/connections.js index 8ab275d3..4304dd66 100644 --- a/src/server/security/connections.js +++ b/src/server/security/connections.js @@ -129,8 +129,8 @@ module.exports = { continue; if (p.auth.username === exclude.auth.username) { - if (p.name && p.zoneName) - await atlas.forceSavePlayer(p.name, p.zoneName); + if (p.name && p.zoneId) + await atlas.forceSavePlayer(p.name, p.zoneId); p.socket.emit('dc', {}); } diff --git a/src/server/world/atlas.js b/src/server/world/atlas.js index b0909588..85c07451 100644 --- a/src/server/world/atlas.js +++ b/src/server/world/atlas.js @@ -314,8 +314,8 @@ module.exports = { }); }, - forceSavePlayer: async function (playerName, zoneName) { - const thread = this.getThreadFromName(zoneName); + forceSavePlayer: async function (playerName, zoneId) { + const thread = this.threads.find(t => t.id === zoneId); if (!thread) return;