steamutils 1.0.54 → 1.0.55
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 -8
- package/index.js +8 -2
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -71,17 +71,11 @@ export const LOCS = {
|
|
71
71
|
|
72
72
|
const appid = 730
|
73
73
|
let CSGO_VER = null
|
74
|
-
|
74
|
+
|
75
|
+
SteamUtils.GetCurrentVersion(appid).then(function (ver) {
|
75
76
|
CSGO_VER = ver
|
76
77
|
})
|
77
78
|
|
78
|
-
async function GetCurrentVersion(appid) {
|
79
|
-
const result = await axios.request({
|
80
|
-
url: 'https://api.steampowered.com/ISteamApps/UpToDateCheck/v1/?format=json&appid=' + appid + '&version=0'
|
81
|
-
})
|
82
|
-
return result.data.response.required_version
|
83
|
-
}
|
84
|
-
|
85
79
|
const PersonasCache = []
|
86
80
|
|
87
81
|
function SteamClient({
|
package/index.js
CHANGED
@@ -743,8 +743,14 @@ class SteamUser {
|
|
743
743
|
}
|
744
744
|
|
745
745
|
static async GetCurrentVersion(appID) {
|
746
|
-
let
|
747
|
-
|
746
|
+
for (let i = 0; i < 10; i++) {
|
747
|
+
try {
|
748
|
+
return (await request(
|
749
|
+
`https://api.steampowered.com/ISteamApps/UpToDateCheck/v1/?format=json&appid=${appID}&version=0`)).data.response.required_version;
|
750
|
+
} catch (e) {
|
751
|
+
await sleep(1000)
|
752
|
+
}
|
753
|
+
}
|
748
754
|
}
|
749
755
|
|
750
756
|
static generateSessionID() {
|