Jump to content
McKay Development

sendToGC callback never gets called


cheslohopr

Recommended Posts

Hey,

 

I have been trying to fiddle around with the GC for CSGO a bit but noticed that the callback in "sendToGC" never runs. The event works fine but the callback never happens.

const SteamUser = require("steam-user");
const user = new SteamUser();

user.logOn({
	accountName: "Account",
	password: "Password"
});

user.on("loggedOn", () => {
	console.log("Logged in");

	user.gamesPlayed(730);
});

user.on("appLaunched", (appID) => {
	setInterval(() => {
		console.log("Attempting hello for " + appID);

		user.sendToGC(appID, 4006, {}, Buffer.alloc(0), (appID, msgType, payload) => {
			console.log("Got " + msgType + " from callback");
		});
	}, 3000);
});

user.on("receivedFromGC", (appID, msgType, payload) => {
	console.log("Got " + msgType + " from event");
});

Above is example code which I am trying to run, everything I get is "Got 4004 from event" but never from the callback. I noticed that the "++this._currentGCJobID" in "components/gamecoordinator.js" always returns NaN, maybe that helps somehow.

 

 

 

I am unsure but I might also just be doing something wrong.

Link to comment
Share on other sites

In general, Valve's GCs don't actually respond to messages using job IDs (which is the mechanism used when you pass a callback to sendToGC. Only if the GC supports using a message as a job will the callback be invoked. ClientHello is not a job-based message.

 

Are you sure that ++this._currentGCJobID is returning NaN? I can't reproduce that on my end, and I see no way in the code that this would happen.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...