Jump to content


Photo

getUserInventoryContents takes too much time to get inventory

node.js node-steam-tradeoffer-manager

  • Please log in to reply
2 replies to this topic

#1 SunriseM

SunriseM

    Advanced Member

  • Member
  • PipPipPip
  • 46 posts
  • LocationVenezuela

Posted 19 April 2017 - 11:42 PM

Hello. I have been trying to load my bot inventory, but it have been too slow, first i though it was my internet because its very bad but then i tried to test using the request module and it got the inventory in 1 second. I have tried loading my tf2 inventory too and it worked fine.

 

These are the codes i used to test it:

 

Testing the manager.getUserInventoryContents:

 console.time("Load Inventory");

 setTimeout(function(){
	log.warn("Timeout")
 }, 60000);

 manager.getUserInventoryContents("76561198355595262", 753, 6, true, function(err, inventory){
	if(err) log.error(err);
	else {
          console.timeEnd("Load Inventory")
        }
   })


Output: Timeout. Inventory never loaded

 

 

and this is the code with request:

var url = "http://steamcommunity.com/inventory/76561198355595262/753/6?l=english";
console.time("Load Inventory")
request(url, function(err, response, body){
	if(!err && response.statusCode === 200){
		console.log(body)
		console.timeEnd("Load Inventory")
	}
});

Output: inventory and 1017ms 

 

Am i doing something wrong? 



#2 Dr. McKay

Dr. McKay

    Administrator

  • Administrator
  • 1,170 posts

Posted 20 April 2017 - 10:20 AM

It takes a long time because it has to load multiple pages, since that user has over 100,000 Steam items. Your request implementation works quickly, but is only retrieving around 75 items (or maybe 2000, I'm not sure what the default is).



#3 SunriseM

SunriseM

    Advanced Member

  • Member
  • PipPipPip
  • 46 posts
  • LocationVenezuela

Posted 20 April 2017 - 02:39 PM

It takes a long time because it has to load multiple pages, since that user has over 100,000 Steam items. Your request implementation works quickly, but is only retrieving around 75 items (or maybe 2000, I'm not sure what the default is).

Yes, just after posting this , i noticed it wasn't giving me the whole inventory and i was also using the wrong steamid. sorry and thanks for the help







Also tagged with one or more of these keywords: node.js, node-steam-tradeoffer-manager

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users