@@ -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', {}); | ||||
} | |||||
} | } | ||||
}, | }, | ||||
@@ -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(); | ||||