Update index.js

This commit is contained in:
Skillet 2023-02-20 05:25:25 -05:00 committed by GitHub
parent 904e93df1d
commit 6146072886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,6 +213,11 @@ export default class SquadServer extends EventEmitter {
console.log(data);
data.player = await this.getPlayerBySteamID(data.steamID);
if (data.player) data.player.suffix = data.playerSuffix;
else{
data.player = {
steamID: data.steamID
}
}
this.emit('PLAYER_CONNECTED', data);
});
@ -221,6 +226,11 @@ export default class SquadServer extends EventEmitter {
console.log('player disconnected');
console.log(data);
data.player = await this.getPlayerBySteamID(data.steamID);
if(!data.player){
data.player = {
steamID: data.steamID
}
}
this.emit('PLAYER_DISCONNECTED', data);
});