Jump to content
McKay Development

Recommended Posts

Posted

I trying to make a csgo application on electron, since I am using node-steam user it is showing WebSocketBase.disconnect,  WebSocketConnection.end and SteamUser._disconnected issues. I think this some issue with electron, but is this important to define websockets before using steam-user. P.s. my other applications worked with socketing. the code goes here:

const form = document.getElementById("details");
form.addEventListener('submit',function(event){
    event.preventDefault();
    const name = document.getElementById("user").value;
    //console.log(name);
    const pass = document.getElementById("pass").value;
    //console.log(pass);
    const logOnOptions = {
          accountName: name,
         password: pass,
          twoFactorCode: SteamTotp.generateAuthCode('auth')
    };

    client.logOn(logOnOptions);

    client.on('loggedOn', () => {
          console.log('Logged into Steam');
          client.setPersona(SteamUser.EPersonaState.Online)
        client.setPersona(SteamUser.EPersonaState.Online, 'desired_name');
        client.gamesPlayed(730);
    });

})

 

Posted

Uncaught TypeError: setTimeout(...).unref is not a function
    at WebSocketBase.disconnect (./node_modules/websocket13/lib/base.js:68)
    at WebSocketConnection.end (./node_modules/steam-user/components/connection_protocols/websocket.js:153)
    at SteamUser._disconnect (./node_modules/steam-user/components/logon.js:312)
    at ./node_modules/steam-user/components/logon.js:259

this is the error that I encountered. do i have to define a socket,  to use steam user here?

 

also this, error is only encountered inside electron, the script runs fine without electron.

Posted (edited)

steam-user does not support running in a node-enabled electron renderer. You should run steam-user in the main process and expose a communication channel between the renderer and the backend.

I've not done any serious work in electron, so I can't tell you how exactly to achieve this.

Edited by Dr. McKay
  • 3 weeks later...
Posted

Sorry, i didn't update. the issues is fixed. actually in using script other than main, electron doesn't allow us to use network. Either use the code to connect in main, or we have to do separate socketing there.

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