Sfoglia il codice sorgente

bug: trying to fix hanging login

tags/v0.10.6.2
Shaun 2 anni fa
parent
commit
0395594c9c
2 ha cambiato i file con 12 aggiunte e 4 eliminazioni
  1. +4
    -3
      src/server/security/connections.js
  2. +8
    -1
      src/server/world/instancer.js

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

@@ -164,11 +164,12 @@ module.exports = {
if ((!p) || (p === exclude) || (!p.auth)) if ((!p) || (p === exclude) || (!p.auth))
continue; 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', {}); p.socket.emit('dc', {});
}
} }
}, },




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

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


await player.auth.doSave(); await player.auth.doSave();




Caricamento…
Annulla
Salva