mirror of
https://github.com/AsgardEternal/SquadJS.git
synced 2024-09-28 11:54:23 -05:00
Update index.js
This commit is contained in:
parent
904e93df1d
commit
6146072886
@ -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);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user