rektbot Posted February 24, 2017 Report Posted February 24, 2017 Hi There, I've created a script to get some info about a users account. getOwnedApps() and ownsApp() is really nice but I would like to understand more about licenses and getProductInfo. licenses: How do we know what this package is? Is there anyway to look it up? client.on('licenses', (licenses) => { //console.log(licenses.length); console.log(licenses[0]); }); Returns the below. { package_id: 15740, time_created: 1487406101, time_next_process: 0, minute_limit: 0, minutes_used: 0, payment_method: 1, flags: 0, purchase_country_code: 'AU', license_type: 1, territory_code: 55, change_number: 1796623, owner_id: 633543528, initial_period: 0, initial_time_unit: 0, renewal_period: 0, renewal_time_unit: 0 } getProductInfo What are all the object responses in appinfo? function getProd(){ client.getProductInfo([730],[],function(res){ console.log(res); }); Returns: { '730': { changenumber: 2713931, missingToken: false, appinfo: { appid: '730', common: [Object], extended: [Object], config: [Object], install: [Object], depots: [Object], ufs: [Object] } } } Quote
Dr. McKay Posted February 24, 2017 Report Posted February 24, 2017 That license grants you access to package 15740. You can get info about a package using getProductInfo's second argument. A package contains one or more apps, so if you want to translate a license into an app name then you need to lookup the package and then lookup the apps contained in that package. Use JSON.stringify to get full details for an object, or alternatively call console.log on a lower level (e.g. console.log(res[730].appinfo)). Quote
rektbot Posted February 24, 2017 Author Report Posted February 24, 2017 Thank you!!! more donations for you. Your support is amazing dude. 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.