steamutils 1.2.62 → 1.2.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SteamClient.js +2 -14
- package/free_packages.json +10048 -0
- package/package.json +3 -3
package/SteamClient.js
CHANGED
@@ -75,6 +75,7 @@ export const LOCS = {
|
|
75
75
|
|
76
76
|
const appid = 730
|
77
77
|
let CSGO_VER = 13952
|
78
|
+
const FreeAppList = JSON.parse(fs.readFileSync(path.join(__dirname, 'free_packages.json'))).packages
|
78
79
|
|
79
80
|
// SteamUtils.GetCurrentVersion(appid).then(function (ver) {
|
80
81
|
// CSGO_VER = ver
|
@@ -1421,20 +1422,7 @@ function SteamClient({
|
|
1421
1422
|
const mCookies = await getCookiesWait()
|
1422
1423
|
if (!mCookies) return
|
1423
1424
|
const steamUtils = new SteamUtils(mCookies)
|
1424
|
-
|
1425
|
-
const userData = await steamUtils.getDynamicStoreUserData()
|
1426
|
-
if (!userData) return
|
1427
|
-
const ownedApps = userData.rgOwnedApps || []
|
1428
|
-
const ownedAppsCount = shouldLog ? (ownedApps?.length || 0) : 0
|
1429
|
-
let recommendedApps = Math.random() > 0.5 ? _.shuffle(userData.rgRecommendedApps || []) : []
|
1430
|
-
if (!recommendedApps?.length) {
|
1431
|
-
try {
|
1432
|
-
recommendedApps = (await axios.request({url: 'https://raw.githubusercontent.com/5x/easy-steam-free-packages/master/src/script/packages_db.json'}))?.data?.packages || []
|
1433
|
-
} catch (e) {
|
1434
|
-
}
|
1435
|
-
}
|
1436
|
-
_.remove(recommendedApps, app => ownedApps.includes(app))
|
1437
|
-
recommendedApps = _.shuffle(recommendedApps)
|
1425
|
+
const recommendedApps = _.shuffle(FreeAppList)
|
1438
1426
|
if (max) {
|
1439
1427
|
recommendedApps.length = Math.min(recommendedApps.length, max)
|
1440
1428
|
}
|