Jump to content


Photo

sendToGC callback never gets called

node.js node-steam-user

Best Answer Dr. McKay , 01 June 2019 - 02:41 PM

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.

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 cheslohopr

cheslohopr

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 01 June 2019 - 07:08 AM

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.



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,212 posts

Posted 01 June 2019 - 02:41 PM   Best Answer

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.



#3 cheslohopr

cheslohopr

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 01 June 2019 - 03:20 PM

When I set a breakpoint at line 22 in the "components/gamecoordinator.js" and look at the value of "this._currentGCJobID" I get "undefined" back, if I step one over and check "sourceJobId" I get "NaN". As seen here: https://i.imgur.com/Py5Ccd7.gif



#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,212 posts

Posted 01 June 2019 - 03:59 PM

I still can't reproduce that. That shouldn't be possible, since the property gets initialized to 0 right before the loggedOn callback fires.







Also tagged with one or more of these keywords: node.js, node-steam-user

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users