Jump to content
McKay Development

sentOfferChanged doesnt emit when steam user and community are passed to the ctor


sNIP

Recommended Posts

const manager = new TradeOfferManager({
    steam: client,
    community: community,
    language: "en"
});
 
manager.on("sentOfferChanged "function (offer,oldState) {
   console.log(`Sent offer changed:` + offer.state);
});

 

sentOfferChanged doesnt emit, the only time it emits something is when I send an offer that needs to be confirmed (ETradeOfferState = 9). Do I have to call doPoll() manually or Iam missing something?

Edited by sNIP
Link to comment
Share on other sites

const client = new SteamUser();
const community = new SteamCommunity();
const manager = new TradeOfferManager({
    steam: client,
    community: community,
    language: "en",
});

const logInOptions = {
    accountName: logInConfig.accountName,
    password: logInConfig.password,
    twoFactorCode: SteamTotp.generateAuthCode(logInConfig.sharedSecret)
};


client.logOn(logInOptions);

client.on("loggedOn", () => {
    console.log("logged on");

    client.setPersona(SteamUser.EPersonaState.Online);
    client.gamesPlayed(730);
    client.webLogOn();
});

client.on("webSession", (sidcookies=> {
    manager.setCookies(cookies);
    community.setCookies(cookies);

});

Really looking forward for help

edit: Also this

community.on('sessionExpired'function(err) {
    if (err) {
        console.log('Session Expired: ' + err);
    }
    
    if (client.steamID) {
        client.webLogOn();
        console.log('called weblogon: ' + thisId);
    } else {
        client.logOn(logOnOptions);
        console.log('called logon');
    }
});

Edit:2 I do not receive ANY emits now from sentOfferChanged, can confirm that client.on("webSession", (sidcookies=> { is called

Edited by sNIP
Link to comment
Share on other sites

There's no need to call webLogOn inside of a loggedOn event callback. A web logon happens automatically when you first connect.

 

If you add manager.on('debug', console.log) you might get some helpful output.

Yep I removed it, but still doesnt work, will try to 'debug' and see what happens

Link to comment
Share on other sites

It seems that everything is ok from the manager debug, it prints "doing trade offer poll since *somenumber*" and  1/5 of the times or something "trade offer poll since 1(full update)", but no emits.

 

EDIT:

I just love javascript and my stupidity

manager.on("sentOfferChanged "

 I had this space floating around, thanks anyways!

Edited by sNIP
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...