aatmjeets Posted July 29, 2020 Report Posted July 29, 2020 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); }); }) Quote
aatmjeets Posted July 29, 2020 Author Report Posted July 29, 2020 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. Quote
Dr. McKay Posted July 29, 2020 Report Posted July 29, 2020 (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 July 29, 2020 by Dr. McKay Quote
aatmjeets Posted August 14, 2020 Author Report Posted August 14, 2020 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. Quote
Recommended Posts
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.