steamutils 1.2.97 → 1.2.99
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 +17 -3
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -1668,13 +1668,27 @@ 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
|
1676
1681
|
}
|
1677
|
-
|
1682
|
+
let result = {}
|
1683
|
+
try {
|
1684
|
+
result = await steamClient.getUserOwnedApps(steamId)
|
1685
|
+
} catch (e) {
|
1686
|
+
try {
|
1687
|
+
result = await steamClient.getUserOwnedApps(steamId)
|
1688
|
+
} catch (e) {
|
1689
|
+
result = {}
|
1690
|
+
}
|
1691
|
+
}
|
1678
1692
|
if (isMe && Array.isArray(result.apps)) {
|
1679
1693
|
ownedApps.length = 0
|
1680
1694
|
ownedApps.push(...result.apps)
|