Arcana / node-dota2

A node-steam plugin for Dota 2.
MIT License
546 stars 191 forks source link

Connection closed by server #465

Closed markrmessmore closed 7 years ago

markrmessmore commented 7 years ago

I'm certain that this is a problem between my keyboard and my chair however I'm honestly not certain what's going on. I've followed the instructions in terms of installing:

npm install dota2

I've moved config.js.example to config.js. I've entered in my steambot account's username and password (I've double and triple checked-it), and when running example.js I get:

30 Mar 14:45:30 - Connection closed by server: Error: Disconnected

Similarly when I run example2.js I get:

30 Mar 14:46:02 - Connection closed by server.

test.js tells me describe is not defined (not sure if there is a package dependency which for some reason is not installed).

I don't have an error number or anything else to go off of so what am I missing/overlooking?

Crazy-Duck commented 7 years ago

The tests should be executed with moccha while having the two environment variables set to the username and password. However, I doubt that that will work when the examples don't.. Does the account have 2fa activated or so?

Crazy-Duck commented 7 years ago

There was just a patch, try again in like half an hour, GC might be rebooting as well

markrmessmore commented 7 years ago

2fa is not active on the account. I was able to log in previously with the steam-user module however haven't been able to get this to work. And now that I've done a bit more digging I see the test.js isn't really meant to be run, the example.js & example2.js are the true tests.

Errors are still happening.

markrmessmore commented 7 years ago

FWIW I wanted to reorganize my project so I spent this evening doing that and did a fresh install of the dota2 module...same result.

However I did notice not all the files/folders would show up when I did the npm install dota2. I downloaded the zip to get the examples, could that be causing this?

Crazy-Duck commented 7 years ago

The exmples etc. are no longer included in the npm package, since you really don't need those to use the library. If you want to run the examples, you are indeed better off forking/downloading the repo

Crazy-Duck commented 7 years ago

Do you have the config.js file in the same directory as the example files? Did you comment out the lines in the config for 2FA? Can you add a few printlines right before L193 and L195 in example.js? Make it look like this:

util.log(logOnDetails);
steamClient.connect();
steamClient.on('connected', function() {
    util.log("Connected to steam, attempting logon");
    steamUser.logOn(logOnDetails);
});
markrmessmore commented 7 years ago

The config.js IS in the same directory as the example files. I did comment out the config for 2FA (I also tried it as being "" however no change.) I've changed lines 193 and following as you recommended. Here is the output:

31 Mar 08:50:58 - { account_name: '*****', password: '*********' }
31 Mar 08:50:59 - Connected to steam, attempting logon
31 Mar 08:50:59 - Connection closed by server: Error: Disconnected

For any wondering, yes the correct account name and password were showing up, I've commented them out here.

markrmessmore commented 7 years ago

Marking this as resolved.

What resolved it? Nothing really. Steam Guard was turned off. I turned it on. Verified. Turned it back off. Now it logs in. Volvo pls.

Thanks for your help.

rossengeorgiev commented 7 years ago

There are multiple things that can cause a disconnect, but without providing the LogonResponse.eresult, there is no way to debug. You could've been rate limited due to many failed logins, typically 15 minutes. Or maybe the CM you connected to was out of service