Skip to content

Commit

Permalink
Ensures GC Connection Exists Before Saying Hello
Browse files Browse the repository at this point in the history
If, during the launch sequence, the GC connection becomes undefined,
clears `_gcClientHelloIntervalId` and emits an `unready` event.
  • Loading branch information
Step7750 committed Jan 29, 2017
1 parent c09e578 commit 0d9c139
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
@@ -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");

this._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());

0 comments on commit 0d9c139

Please sign in to comment.