steamutils 1.2.98 → 1.3.0
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 +9 -4
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -344,11 +344,11 @@ function SteamClient({
|
|
344
344
|
let ownedApps = []
|
345
345
|
for (let i = 0; i < 5; i++) {
|
346
346
|
ownedApps = await getUserOwnedApps()
|
347
|
-
if (ownedApps
|
347
|
+
if (ownedApps?.length) {
|
348
348
|
break
|
349
349
|
}
|
350
350
|
}
|
351
|
-
if (!ownedApps
|
351
|
+
if (!ownedApps?.length) {
|
352
352
|
gamesPlayed(730)
|
353
353
|
} else {
|
354
354
|
ownedApps = ownedApps.map(({appid}) => appid)
|
@@ -1668,8 +1668,13 @@ function SteamClient({
|
|
1668
1668
|
steamClient.sendToGC(730, 767, {}, Buffer.alloc(0))
|
1669
1669
|
}
|
1670
1670
|
|
1671
|
-
async function getUserOwnedApps(steamId) {
|
1672
|
-
|
1671
|
+
async function getUserOwnedApps(steamId = steamClient.steamID) {
|
1672
|
+
if (!steamId) {
|
1673
|
+
return []
|
1674
|
+
}
|
1675
|
+
if (typeof steamId?.getSteamID64 === "function") {
|
1676
|
+
steamId = steamId.getSteamID64()
|
1677
|
+
}
|
1673
1678
|
const isMe = steamId === steamClient.steamID.getSteamID64();
|
1674
1679
|
if (isMe && ownedApps.length) {
|
1675
1680
|
return ownedApps
|