Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
serv._server.on('login', async (client) => {
if (client.socket.listeners('end').length === 0) return // TODO: should be fixed properly in nmp instead
try {
const player = serv.initEntity('player', null, serv.overworld, new Vec3(0, 0, 0))
player._client = client
player.profileProperties = player._client.profile ? player._client.profile.properties : []
player.commands = new Command({})
Object.keys(plugins)
.filter(pluginName => plugins[pluginName].player !== undefined)
.forEach(pluginName => plugins[pluginName].player(player, serv, options))
serv.emit('newPlayer', player)
player.emit('asap')
await player.login()
} catch (err) {
setTimeout(() => { throw err }, 0)
}
})
}