Jump to content
McKay Development

Recommended Posts

Posted

Hello, i cant get requestPlayersProfile to work.

var Steam = require('steam-client');
var SteamID = require("steamid");
var GlobalOffensive = require('globaloffensive');
var SteamUser = require('steam-user');

var crypto = require('crypto');


var account_name = "name";   
var password = "password";


var client = new SteamUser();
var csgo = new GlobalOffensive(client);

var sentryfile = fs.readFileSync(account_name + '.sentry');
var sha = crypto.createHash('sha1').update(sentryfile).digest();

client.setSentry(sha);

client.logOn({
    "accountName": account_name,
    "password": password
});

client.on('loggedOn', function(details) {
    console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID());
    client.setPersona(SteamUser.EPersonaState.Offline);
    client.gamesPlayed(730);
});


csgo.on("connectedToGC", function() {
    console.log("connectedToGC");
    
    //setInterval(function(){
    if ( csgo.haveGCSession ) {

        console.log(csgo.inventory);

        var account_id = new SteamID("76561198340987241");  
        csgo.requestPlayersProfile(account_id, function(data) {
            console.log(data);
        });
    }
    //}, 3000);
});

csgo.on("playersProfile", function(data) {
    console.log("Profile gotten");
})



I placed some console.log() into your code, to see whats coming back.

 

 

handlers[Language.PlayersProfile] = function (body) {
  var proto = Protos.CMsgGCCStrike15_v2_PlayersProfile.decode(body);
 
  console.log("here");
 
  console.log(proto); // { requestId: null, accountProfiles: [] }
 
  console.log(body);  // <Buffer >
... }

 

always empty.

 

Can you see what i'm doing wrong? 

 

 

Thanks!

 

 

 

 

 

 

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...