Jump to content


Photo
Question

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

node.js node-steam-tradeoffer-manager

  • Please log in to reply
6 replies to this topic

#1 sNIP

sNIP

    Member

  • Member
  • PipPip
  • 18 posts

Posted 09 October 2019 - 06:04 AM

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, 09 October 2019 - 06:05 AM.


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,212 posts

Posted 09 October 2019 - 05:57 PM

There's no reason why it shouldn't emit, provided you've set your cookies properly. You're probably doing something wrong.



#3 sNIP

sNIP

    Member

  • Member
  • PipPip
  • 18 posts

Posted 10 October 2019 - 07:28 AM

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, 10 October 2019 - 07:52 AM.


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,212 posts

Posted 10 October 2019 - 08:31 AM

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.



#5 sNIP

sNIP

    Member

  • Member
  • PipPip
  • 18 posts

Posted 10 October 2019 - 08:45 AM

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



#6 sNIP

sNIP

    Member

  • Member
  • PipPip
  • 18 posts

Posted 10 October 2019 - 08:54 AM

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, 10 October 2019 - 12:47 PM.


#7 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,212 posts

Posted 10 October 2019 - 02:47 PM

Oops! Totally missed that too.







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

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users