don't login if the client is already ended, fix #113

This commit is contained in:
Romain Beaumont 2015-12-11 02:37:11 +01:00
parent c3bef15214
commit 567b82c61c

View file

@ -12,6 +12,7 @@ module.exports.server=function(serv,options)
client.on('error',error => serv.emit('clientError',client,error)));
serv._server.on('login', async (client) => {
if(client.socket.listenerCount('end')==0) return; // TODO: should be fixed properly in nmp instead
try {
var player = serv.initEntity('player', null, serv.overworld, new Vec3(0,0,0));
player._client=client;