Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mc = require('minecraft-protocol')
const replayPackets = require('./Proxy/packetReplayer')
const addListeners = require('./Proxy/addListeners')
class Proxy extends mc.Server {
/**
* Create a minecraft proxy
* @param {Object} serverSettings Settings for the minecraft-protocol server
* @param {Object} serverList An object that maps a 'serverName' to the server info
* @param {Object} proxyOptions Proxy settings
*/
constructor (serverSettings = {}, serverList = {}, proxyOptions = {}) {
super(serverSettings.version, serverSettings.customPackets)
this.serverList = serverList
this.autoConnect = (typeof proxyOptions.autoConnect === 'undefined') ? true : !!proxyOptions.autoConnect
this.autoFallback = (typeof proxyOptions.autoFallback === 'undefined') ? true : !!proxyOptions.autoFallback
let self = this
self.on('login', (remoteClient) => {
let id = remoteClient.id