lib/client.js
/**
     * This sends an authentication request to the RCON server and upon approval this Promise
     * will resolve, otherwise it will reject with the same provided response packet.
     * @param {string} password
     * @returns {Promise<RCONPacket>}
     */
This sends an authentication request to the RCON server and upon approval this Promise
will resolve, otherwise it will reject with the same provided response packet.
@param {string} password
@returns {Promise}
This sends an authentication request to the RCON server and upon approval this Promise will resolve otherwise it will reject with the same provided response packet . @param { string } password @returns { Promise }
login(password) {
        return new Promise((resolve, reject) => {
            const encoded = Client.encode(PacketType.SERVERDATA_AUTH, 22, password);
            this.client.once('data', (chunk) => {
                const decoded = Client.decode(chunk);
                if (decoded.id === -1)
                    reject(decoded);
                else
                    resolve(decoded);
            });
            this.client.write(encoded);
        });
    }
login ( password ) { return new Promise ( ( resolve , reject ) => { const encoded = Client . encode ( PacketType . SERVERDATA_AUTH , 22 , password ) ; this . client . once ( 'data' , ( chunk ) => { const decoded = Client . decode ( chunk ) ; if ( decoded . id === - 1 ) reject ( decoded ) ; else resolve ( decoded ) ; } ) ; this . client . write ( encoded ) ; } ) ; }
This sends an authentication request to the RCON server and upon approval this Promise
 will resolve, otherwise it will reject with the same provided response packet.
This sends an authentication request to the RCON server and upon approval this Promise will resolve otherwise it will reject with the same provided response packet .