Browse Source

bug: trying to fix hanging login

tags/v0.10.6.2
Shaun 2 years ago
parent
commit
0395594c9c
2 changed files with 12 additions and 4 deletions
  1. +4
    -3
      src/server/security/connections.js
  2. +8
    -1
      src/server/world/instancer.js

+ 4
- 3
src/server/security/connections.js View File

@@ -164,11 +164,12 @@ module.exports = {
if ((!p) || (p === exclude) || (!p.auth))
continue;

if (p.name && p.zoneName)
await atlas.forceSavePlayer(p.name, p.zoneName);
if (p.auth.username === exclude.auth.username) {
if (p.name && p.zoneName)
await atlas.forceSavePlayer(p.name, p.zoneName);

if (p.auth.username === exclude.auth.username)
p.socket.emit('dc', {});
}
}
},



+ 8
- 1
src/server/world/instancer.js View File

@@ -355,8 +355,15 @@ module.exports = {
forceSavePlayer: async function ({ playerName, callbackId }) {
const player = objects.objects.find(o => o.player && o.name === playerName);

if (!player?.auth)
if (!player?.auth) {
await io.setAsync({
key: new Date(),
table: 'error',
value: 'no auth found for forcesave ' + playerName
});

return;
}

await player.auth.doSave();



Loading…
Cancel
Save