Skip to content

Commit

Permalink
Merge pull request #45 from Step7750/fix/hello-gc
Browse files Browse the repository at this point in the history
Handles GC Connection Becoming `undefined` During `_sendClientHello`
  • Loading branch information
joshuaferrara authored Jan 29, 2017
2 parents 2f784fc + 46fad97 commit a9de9e9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ var CSGOClient = function CSGOClient(steamUser, steamGC, debug) {
if (!self._gc) {
util.log("GC went missing");
}
else if (!self._gc._connection) {
util.log("GC Connection went missing, exiting");

self._gcReady = false;

if (self._gcClientHelloIntervalId) {
clearInterval(self._gcClientHelloIntervalId);
self._gcClientHelloIntervalId = null;
}

self.emit("unready");
}
else {
self._gc.send({msg: CSGO.EGCBaseClientMsg.k_EMsgGCClientHello, proto: {}},
new protos.CMsgClientHello({}).toBuffer());
Expand Down

0 comments on commit a9de9e9

Please sign in to comment.