crash when there is an error during login

This commit is contained in:
Romain Beaumont 2015-10-24 21:44:30 +02:00
parent b89ab41231
commit 17b65f5021

View file

@ -8,7 +8,7 @@ module.exports = inject;
function inject(serv,options)
{
serv._server.on('login', function (client) {
serv._server.on('login', async function (client) {
if(!options["online-mode"])
client.uuid=UUID.v3({
namespace: UUID.namespace.dns,
@ -22,6 +22,11 @@ function inject(serv,options)
playerPlugins[pluginName](serv, player, options);
}
serv.emit("newPlayer",player);
player.login();
try {
await player.login();
}
catch(err){
setTimeout(function(){throw err;},0)
}
});
}