Skip to content

Commit

Permalink
Merge pull request #71 from rchh/fix-knocking
Browse files Browse the repository at this point in the history
Fix knocking
  • Loading branch information
joshuaferrara committed Jul 26, 2020
2 parents f98c101 + 499269b commit 3ace49e
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 42 deletions.
2 changes: 1 addition & 1 deletion example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var onSteamLogOn = function onSteamLogOn(response){
},
onSteamServers = function onSteamServers(servers) {
util.log("Received servers.");
fs.writeFile('servers.json', JSON.stringify(servers, null, 2));
fs.writeFileSync('servers.json', JSON.stringify(servers, null, 2));
}

var username = readlineSync.question('Username: ');
Expand Down
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ CSGOClient.prototype.launch = function() {

this._user.gamesPlayed([{game_id: '730'}]);

// Keep knocking on the GCs door until it accepts us.
this._gcClientHelloIntervalId = setInterval(this._sendClientHello, 2500);
// Only start knocking if we didn't already
if(!this._gcClientHelloIntervalId) {
// Keep knocking on the GCs door until it accepts us.
this._gcClientHelloIntervalId = setInterval(this._sendClientHello, 2500);
}
};

CSGOClient.prototype.exit = function() {
Expand Down
87 changes: 48 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ace49e

Please sign in to comment.