Mentalista Posted November 26, 2017 Report Share Posted November 26, 2017 Hello, Can we reload/recall LoadInventory on error? manager.loadInventory(AppID, ContextID, true, function(err, inv, curr) { if(err) { //Reload here console.log("error while loading inv"); return; } //code });Thanks Quote Link to comment Share on other sites More sharing options...
Reason Posted November 26, 2017 Report Share Posted November 26, 2017 function loadinventory(AppID, ContextID) { manager.loadInventory(AppID, ContextID, true, function(err, inv, curr) { if(err) { console.log("error while loading inv"); loadinventory(AppID, ContextID); return; } //code }); } loadinventory(AppID, ContextID); Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted November 27, 2017 Report Share Posted November 27, 2017 This is a bad idea without some kind of limits and delay, or else if something breaks you'll just start DDoSing Steam. Quote Link to comment Share on other sites More sharing options...
TomYoki Posted November 27, 2017 Report Share Posted November 27, 2017 (edited) function loadinventory(AppID, ContextID) { manager.getInventoryContents(AppID, ContextID, true, function(err, inv, curr) { //You were using deprecated method if(err) { console.log("Error while loading inventory."); //Gotta use proper grammar. setTimeout(function(){ loadInventory(AppID, ContextID); }, 1000*60); //Set timeout (as Führer McKay pointed out); return; } //code }); } loadinventory(AppID, ContextID); Edited November 27, 2017 by TomYoki Quote Link to comment Share on other sites More sharing options...
Axle Posted November 27, 2017 Report Share Posted November 27, 2017 function loadinventory(AppID, ContextID) { manager.getInventoryContents(AppID, ContextID, true, function(err, inv, curr) { //You were using deprecated method if(err) { console.log("Error while loading inventory."); //Gotta use proper grammar. setTimeout(function(){ loadInventory(AppID, ContextID); }, 1000*60); //Set timeout (as Führer McKay pointed out); return; } //code }); } loadinventory(AppID, ContextID); I would recommend giving up after X amount of tries, because at some point it is just the steam API and you need to reset/relog. In the case of escrow days this happens to me fairly regularly. Quote Link to comment Share on other sites More sharing options...
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.