diff --git a/lib/playerPlugins/login.js b/lib/playerPlugins/login.js index 8e45ff5..d3adc40 100644 --- a/lib/playerPlugins/login.js +++ b/lib/playerPlugins/login.js @@ -181,7 +181,18 @@ function inject(serv,player) player._client.on('end', function () { serv.broadcast(player.username + ' quit the game.', "yellow"); + player._writeOthers('player_info',{ + action: 4, + data: [{ + UUID: transformUuid(player._client.uuid) + }] + }); + player._writeOthers('entity_destroy',{'entityIds':[player.entity.id]}); player.emit('disconnect'); + var index=serv.players.indexOf(player); + if(index>-1) + serv.players.slice(index,1); + delete serv.uuidToPlayer[player._client.uuid]; });