Jump to content
McKay Development

Recommended Posts

Posted

Is that happening consistently? If so, can you show what code you're using?

it happened once on 2 of 4 my bots during recent problems with steam

const SteamCommunity = require('steamcommunity');
const SteamUser = require('steam-user');
const TradeOfferManager = require('steam-tradeoffer-manager');
const steamTotp = require('steam-totp');

const client = new SteamUser();
const community = new SteamCommunity();
const manager = new TradeOfferManager({ community });

let isAlive = false;
const DEFAULT_TIMER = 60 * 1000;

client.logOn(logInOptions);

client.on('loggedOn', () => {
  log('Steam client loggedOn okay');
  client.setPersona(1);
});

client.on('webSession', (sessionid, cookies) => {
  manager.setCookies(cookies, err => {
    if (err) return log(`Steam coockies: ${err}`);
    isAlive = true;
    log('Steam webSession okay');
  });
});

community.on('sessionExpired', err => {
  setTimeout(steamCommunityLogin, DEFAULT_TIMER);
  isAlive = false;
  log(`Steam community session: ${err}`);
});

client.on('error', err => log(`Steam client: ${err}`));

function steamCommunityLogin() {
  if (!isAlive) {
    community.login({ ...logInOptions, twoFactorCode: steamTotp.getAuthCode(sharedSecret) }, err => {
      if (err) {
        setTimeout(steamCommunityLogin, DEFAULT_TIMER);
        log(`Steam community login: ${err}`);
      } else {
        isAlive = true;
        log('Steam community login okay');
      }
    });
  }
}
Posted (edited)

 

  1. Do you think you could possibly add: client.on('debug', log); This will help to narrow down what's going on if it happens again.
  2. You don't need to login through SteamCommunity if your session expires. Just call client.webLogOn() in that case.

 

1. ok, i add this and if this will repeat, i'll report here

2. yeah, actually, thanks

Edited by furi
Posted

another error

/root/bot/node_modules/steam-user/components/connection.js:21
        this._connection.stream.setTimeout(0);
                                ^
 
TypeError: Cannot read property 'setTimeout' of undefined
    at SteamUser.<anonymous> (/root/bot/node_modules/steam-user/components/connection.js:21:26)
    at handlers.forEach (/root/bot/node_modules/steam-user/components/classes/HandlerManager.js:37:12)
    at Array.forEach (<anonymous>)
    at HandlerManager.emit (/root/bot/node_modules/steam-user/components/classes/HandlerManager.js:36:12)
    at SteamUser._handleMessage (/root/bot/node_modules/steam-user/components/messages.js:538:24)
    at SteamUser._handleNetMessage (/root/bot/node_modules/steam-user/components/messages.js:464:7)
    at TCPConnection._readMessage (/root/bot/node_modules/steam-user/components/connection_protocols/tcp.js:193:12)
    at Socket.emit (events.js:182:13)
    at emitReadable_ (_stream_readable.js:534:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

last 2 minute debug, in 23:40:45 was crash


[Tue, 05 Feb 2019 23:38:21 GMT] Steam debug: Unhandled message: 850
[Tue, 05 Feb 2019 23:39:45 GMT] Steam debug: Handled message: 5599
[Tue, 05 Feb 2019 23:40:15 GMT] Steam debug: Handled message: 5599
[Tue, 05 Feb 2019 23:40:39 GMT] Steam debug: Handled message: 757
[Tue, 05 Feb 2019 23:40:39 GMT] Steam debug: Logged off: ServiceUnavailable
[Tue, 05 Feb 2019 23:40:40 GMT] Steam debug: Using WebSocket; we rolled 47 and percent to use WS is 50
[Tue, 05 Feb 2019 23:40:41 GMT] Steam debug: WebSocket disconnected with error: read ECONNRESET
[Tue, 05 Feb 2019 23:40:41 GMT] Steam debug: Using WebSocket; we rolled 47 and percent to use WS is 50
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: WS connection timed out
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Using TCP; we rolled 93 and percent to use WS is 50
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Connecting to TCP CM: *some IP*
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: WebSocket disconnected with error: read ECONNRESET
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Using TCP; we rolled 64 and percent to use WS is 50
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Connecting to TCP CM: *another IP*
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: TCP connection established
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Handled message: 1303
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Channel encrypt request: protocol 1, universe 1, nonce *some ID*, 0 remaining bytes
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Sending message: 1304
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Handled message: 1305
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Sending message: 5514
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Handled message: 751
[Tue, 05 Feb 2019 23:40:42 GMT] Steam debug: Log on response: TryAnotherCM
[Tue, 05 Feb 2019 23:40:43 GMT] Steam debug: TCP connection established
[Tue, 05 Feb 2019 23:40:43 GMT] Steam debug: Using WebSocket; we rolled 11 and percent to use WS is 50
[Tue, 05 Feb 2019 23:40:44 GMT] Steam debug: Handled message: 1303

Posted (edited)

The next update will hopefully fix this.

Hello, i found a new bug. When set offline or invisible state through steam chat or method setPersona - event user emitted with persona_state 3 (Away) instead of persona_state 0 (offline)

Edited by Ino
Posted

Hello, i found a new bug. When set offline or invisible state through steam chat or method setPersona - event user emitted with persona_state 3 (Away) instead of persona_state 0 (offline)

 

Assuming this is happening like you describe, that would be a problem with Steam, not with this module.

 

But what I suspect is happening is that you're logged into that same account with another bot (or with the Steam client) and its persona state is away. If any logged-on session is in an online state (anything but invisible/offline), the account will show up as that state.

  • 2 weeks later...
Posted

What is the recommendation for listening to chat events? Should we switch to watching the events from the new chat component, or are the older events sufficient?

 

The older events are deprecated, but they will keep working until at least v5. Though I recommend switching to the new events.

Posted (edited)

Something weird is happening. I updated my bot to work with your latest steam packages. However, sometimes it seems like something inside steam-user gets stuck. Sometimes it works just fine, but other time it will only emit loggedOn and websession events. All other events are not emitted. And that's not all. I expect loggedOn to be only emitted once, since in my code I only login once, however when these other events are not emitted, loggedOn gets emitted every 2 minutes. Any idea what's going on?

Edited by Royalgamer06
Posted (edited)

I've made it log all debug events and this is the log: https://pastebin.com/EZRG8xm3

It repeats every 2 minutes, until it finally works. Sometimes it works at first try, but often it takes several tries. 

loggedOnSteam only gets logged on loggedOn event. And signedIntoBarter only gets logged ONCE websession.

This is my login config (un and pass omitted)

{ accountName: 'xxx',
  password: 'xxx',
  twoFactorCode: 'XXX',
  logonID: 1551653434369,
  rememberPassword: true,
  dontRememberMachine: false,
  autoRelogin: true,

  machineName: 'BOT@CLIENT' }: 

 

WebSocket disconnected with error: Ping timeout

This seems to cause it, or at least be related with it.

Edited by Royalgamer06
Posted

This issue isn't specific to v4. I can't get it to work on the latest version of v3 either. Debugging this currently...

Nevermind, seems it just took a bit longer than usual. V3 is all good.

  • 1 month later...
  • Dr. McKay featured, unpinned, unfeatured and featured this topic

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