Jump to content
McKay Development

nikoF

Member
  • Posts

    4
  • Joined

  • Last visited

Posts posted by nikoF

  1. so how am I able to not go into that method, if I get an error when steam is down? 

     

    SteamUser.prototype.webLogOn = function() {
        // Verify logged on
        if (!this.steamID) {
            throw new Error("Cannot log onto steamcommunity.com without first being connected to Steam network");
        }

        // Verify not anonymous user
        if (this.steamID.type != SteamID.Type.INDIVIDUAL) {
            throw new Error('Must not be anonymous user to use webLogOn (check to see you passed in valid credentials to logOn)')
        }

        this._send(SteamUser.EMsg.ClientRequestWebAPIAuthenticateUserNonce, {});
    };

     

     

    should I put something like emit on the first if condition?

    Or you got some different ideas how to solve the problem? 

  2. 18.05.2017 02:11:25  - HTTP error 503
    ## Session Expired. Relogging.
    C:\Users\Administrator\Desktop\SteamBot\node_modules\steam-user\components\web.j
    s:9
                    throw new Error("Cannot log onto steamcommunity.com without firs
    t being connected to Steam network");
                    ^
     
    Error: Cannot log onto steamcommunity.com without first being connected to Steam
     network
        at SteamUser.webLogOn (C:\Users\Administrator\Desktop\SteamBot\node_modules\
    steam-user\components\web.js:9:9)
        at SteamCommunity.community.on (C:\Users\Administrator\Desktop\SteamBot\Test
    asDynamic.js:300:12)
        at emitOne (events.js:96:13)
        at SteamCommunity.emit (events.js:191:7)
        at SteamCommunity._notifySessionExpired (C:\Users\Administrator\Desktop\Stea
    mBot\node_modules\steamcommunity\components\http.js:85:7)
        at C:\Users\Administrator\Desktop\SteamBot\node_modules\steamcommunity\compo
    nents\confirmations.js:21:10
        at C:\Users\Administrator\Desktop\SteamBot\node_modules\steamcommunity\compo
    nents\confirmations.js:268:4
        at SteamCommunity._checkHttpError (C:\Users\Administrator\Desktop\SteamBot\n
    ode_modules\steamcommunity\components\http.js:90:3)
        at Request._callback (C:\Users\Administrator\Desktop\SteamBot\node_modules\s
    teamcommunity\components\http.js:50:61)
        at self.callback (C:\Users\Administrator\Desktop\SteamBot\node_modules\reque
    st\request.js:188:22)
     

     

     

    So this is the error from console.

    When my session expires, I use this code to come back on track:

     

    community.on('sessionExpired', (ERR) => {
    console.log("## Session Expired. Relogging.");
    client.webLogOn();
    });

     

    Not sure if it synced with this code, but I will write it too

    client.on('webSession', function (sessionID, cookies) {
    manager.setCookies(cookies, function (err) {
    if (err) {
    console.log(dateFormat(Date(), "dd.mm.yyyy HH:MM:ss ") + " - " + err);
    //process.exit(1); I commented this cause I don't want to stop the node immediately
    client.webLogOn(); // I put this in order to do webLogon again, not sure if necessary
    return;
    }
    });

    community.setCookies(cookies);
    community.chatLogon();
    community.startConfirmationChecker(config.steam.refreshInterval, config.steam.secret);
    if (config.social.hasToUpdateProfile) {
    updateProfile();
    }
    });

     

     

    So yeah, any ideas how to solve this problem, and not get my node getting down after this Error("Cannot log onto steamcommunity.com without firs

    t being connected to Steam network"); ?
     
    Thank you in advance!
     
    One solution would be to use forever npm, but I would like to hear other opinions how I could rework the code, to not make the node go off, because I'm not up to use that npm due to some variables being saved while bot is being up.
×
×
  • Create New...