node 0.10 doesn't have listenerCount, don't use it

This commit is contained in:
Romain Beaumont 2015-12-11 02:57:32 +01:00
parent 567b82c61c
commit 3bea548f82

View file

@ -12,7 +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
if(client.socket.listeners('end').length==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;