0x737368 Posted July 3, 2017 Report Posted July 3, 2017 So sometimes my bot is disconnected from steam, it reconnects and is shown as online and everything and then when a trade offer is sent to it, it outputs an error something along the lines "Error: Not Logged In". Unfortunately, I didn't save the error output. Hopefully, someone will know what I'm talking about, but I'll update this post when it happens again. My guess is that it has something to do with either steamcommunity or tradeoffermanager, probably the former.How can I prevent it? Quote
Vanilla Posted July 3, 2017 Report Posted July 3, 2017 (edited) So sometimes my bot is disconnected from steam, it reconnects and is shown as online and everything and then when a trade offer is sent to it, it outputs an error something along the lines "Error: Not Logged In". Unfortunately, I didn't save the error output. Hopefully, someone will know what I'm talking about, but I'll update this post when it happens again. My guess is that it has something to do with either steamcommunity or tradeoffermanager, probably the former. How can I prevent it? That means, tradeoffer-manager have invalid cookies, and you need to refresh cookies if that happened. Use steamcommunity "sessionExpired" event to refresh tradeoffer-manager cookiesWhen you get "Error: Not Logged In", steamcommunity "sessionExpired" event will fired. community.on("sessionExpired", function(err) { client.webLogOn(); //relogin to Steam or refresh tradeoffer-manager cookies //add your handling code here, for example: if (sendofferError == true){ //do stuff } } Edit: If you want to kill cookies for testing purposes, you can add this in your code: setTimeout(function(){ //for debugging purposes, kill cookies after 10 second console.log("rip cookies :("); community.setCookies(["steamLogin=1||invalid", "steamLoginSecure=1||invalid"]); manager.setCookies(["steamLogin=1||invalid", "steamLoginSecure=1||invalid"]); }, 10000); Edited July 3, 2017 by Vanilla 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.