steamutils 1.2.89 → 1.2.90

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/SteamClient.js +9 -2
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -340,9 +340,16 @@ function SteamClient({
340
340
 
341
341
  async function gamePlay() {
342
342
  let ownedApps = null
343
- while (!Array.isArray(ownedApps)) {
344
- ownedApps = (await (new SteamUtils(await getCookiesWait())).getDynamicStoreUserData())?.rgOwnedApps
343
+ for (let i = 0; i < 10; i++) {
344
+ if (!Array.isArray(ownedApps)) {
345
+ ownedApps = Array.isArray(steamClient.licenses) ? steamClient.licenses.map(({package_id}) => package_id) : (await (new SteamUtils(await getCookiesWait())).getDynamicStoreUserData())?.rgOwnedApps
346
+ await sleep(1000)
347
+ } else {
348
+ break
349
+ }
345
350
  }
351
+
352
+ ownedApps = _.shuffle(ownedApps || [])
346
353
  ownedApps.length = Math.min(ownedApps.length, 10)
347
354
  _.remove(ownedApps, 730)
348
355
  gamesPlayed([...ownedApps, 730])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.89",
3
+ "version": "1.2.90",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.5.1",