Update connection.js

Added port parameter to WebRcon
This commit is contained in:
Morgan Massens 2019-03-31 17:11:20 -05:00 committed by GitHub
commit 3352401b2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,9 +7,10 @@ export default class Connection {
receivedBuffer = '';
errorCount = 0;
constructor (host, password) {
constructor (host, password, port = 27021) {
this.host = host;
this.password = password;
this.port = port;
this.errorListeners = [];
this.init();
@ -23,7 +24,7 @@ export default class Connection {
if (this.rcon) {
return;
}
this.rcon = new WebRcon(this.host, this.password);
this.rcon = new WebRcon(this.host, this.password, this.port);
}
init () {