steamcommunity-mobile-confirmations
steamcommunity-mobile-confirmations copied to clipboard
[Error: Invalid protocol: steammobile:]
After 2-3 hours to make trades this stops and writing to the console error: [Error: Invalid protocol: steammobile:].
what to do?
having same problem.
I got it too, right from the start.
i got that when i was logged into the bot elsewhere.
I believe this happens with invalid cookies.
yes but why the cookies turn invalid? how can i get new cookies?
Adding my code:
function aceptMobile()
{
try {
var steamcommunityMobileConfirmations = new SteamcommunityMobileConfirmations(
{
steamid: 'steamID',
identity_secret: 'ISecret',
device_id: 'deviceID',
webCookie: COOKIE,
});
steamcommunityMobileConfirmations.FetchConfirmations((function (err, confirmations)
{
if (err)
{
weblogon();
console.log(err);
return;
}
console.log('steamcommunityMobileConfirmations.FetchConfirmations received ' + confirmations.length + ' confirmations');
if ( ! confirmations.length)
{
return;
}
steamcommunityMobileConfirmations.AcceptConfirmation(confirmations[0], (function (err, result)
{
if (err)
{
console.log(err);
return;
}
console.log('steamcommunityMobileConfirmations.AcceptConfirmation result: ' + result);
}).bind(this));
}).bind(this));
} catch (e) {}
}
function weblogon()
{
steamWebLogOn.webLogOn(function(sessionID, newCookie){
COOKIE=newCookie;
getSteamAPIKey({
sessionID: sessionID,
webCookie: newCookie
}, function(err, APIKey) {
offers.setup({
sessionID: sessionID,
webCookie: newCookie,
APIKey: APIKey
});
steamuserinfo.setup(APIKey);
aceptMobile();
});
});
}
You are not retrying after calling weblogon
.
its the same after that i cant get any new confirmations or load offers
Does somebody find solution for that problem?
use random device id.
How to cast that random id?
Edit:
mobileConfirmations = new SteamMobileAuth({
steamid: config.steamid,
identity_secret: config.identity_secret,
device_id: "android:" + require('crypto').randomBytes(16).toString('hex'),
webCookie: cookies
});
var hash = require('crypto').createHash('sha1');
hash.update(Math.random().toString());
hash = hash.digest('hex');
device_id = 'android:' + hash;
Please help too have this problem
I personally don't have this problem but it would be good to have a fix for it. Try doing a weblogon everytime it logs an error, so between every console.log(error) and return put a weblogon();
...
[SERVER] Starting the countdown for Game #12 [SERVER] Ending current game & choosing winner. [SERVER] Trade Offer for Game #12 has been successfully sent and is awaiting mobile confirmation. [SERVER] Received 1 confirmations [SERVER] Confirmation handling result: true [Error: Invalid protocol: steammobile:] [Error: 503] [Error: 503] [Error: 503] [Error: 503] [Error: 503] [Error: 503] [Error: 503] [Error: 503] [Error: 503] [Error: 503] [Error: 503] events.js:85 throw er; // Unhandled 'error' event ^ Error: Connection lost: The server closed the connection. at Protocol.end (/home/bot_csgon_1/node_modules/mysql/lib/protocol/Protocol.js:103:13) at Socket. (/home/bot_csgon_1/node_modules/mysql/lib/Connection.js:102:28) at Socket.emit (events.js:129:20) at _stream_readable.js:908:16 at process._tickCallback (node.js:355:11)