player disconnect bug logging

This commit is contained in:
Skillet 2023-11-28 08:33:51 -05:00
parent 3fce6e4a8b
commit e2c5b851f0

View File

@ -243,11 +243,14 @@ export default class SquadServer extends EventEmitter {
}); });
this.logParser.on('PLAYER_DISCONNECTED', async (data) => { this.logParser.on('PLAYER_DISCONNECTED', async (data) => {
Logger.verbose('PlayerBugFix', 1, `player ${data.steamID} disconnect with playerinfo: ${JSON.stringify(this.playerinfo)}`);
data.player = await this.getPlayerBySteamID(data.steamID); data.player = await this.getPlayerBySteamID(data.steamID);
if (!data.player) { if (!data.player) {
Logger.verbose('PlayerBugFix', 1, `Bug detected, using playerinfo data for ${data.steamID}`);
data.player = this.playerinfo.get(data.steamID); data.player = this.playerinfo.get(data.steamID);
} }
if (!data.player) { if (!data.player) {
Logger.verbose('PlayerBugFix', 1, `Bug detected, FAILED, falling back for ${data.steamID}`);
data.player = { data.player = {
steamID: data.steamID steamID: data.steamID
}; };