steamutils 1.0.53 → 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/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/steamutils.iml +1 -1
- package/.idea/vcs.xml +1 -1
- package/SteamClient.js +8 -12
- package/index.js +8 -2
- package/package.json +1 -1
package/.idea/steamutils.iml
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
<module type="WEB_MODULE" version="4">
|
3
3
|
<component name="NewModuleRootManager">
|
4
4
|
<content url="file://$MODULE_DIR$">
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
6
5
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
7
7
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
8
8
|
</content>
|
9
9
|
<orderEntry type="inheritedJdk" />
|
package/.idea/vcs.xml
CHANGED
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({
|
@@ -215,18 +209,18 @@ function SteamClient({
|
|
215
209
|
if (notCachesteamIDs.length) {
|
216
210
|
let personas = null
|
217
211
|
try {
|
218
|
-
personas = (await steamClient.getPersonas(
|
212
|
+
personas = (await steamClient.getPersonas(notCachesteamIDs))?.personas
|
219
213
|
} catch (e) {
|
220
214
|
}
|
221
215
|
if (!personas || !Object.keys(personas).length) {
|
222
216
|
try {
|
223
|
-
personas = (await steamClient.getPersonas(
|
217
|
+
personas = (await steamClient.getPersonas(notCachesteamIDs))?.personas
|
224
218
|
} catch (e) {
|
225
219
|
}
|
226
220
|
}
|
227
221
|
if (!personas || !Object.keys(personas).length) {
|
228
222
|
try {
|
229
|
-
personas = (await steamClient.getPersonas(
|
223
|
+
personas = (await steamClient.getPersonas(notCachesteamIDs))?.personas
|
230
224
|
} catch (e) {
|
231
225
|
}
|
232
226
|
}
|
@@ -815,7 +809,9 @@ function SteamClient({
|
|
815
809
|
}
|
816
810
|
|
817
811
|
async function autoRequestFreeLicense(shouldLog = false, max = 10) {
|
818
|
-
const
|
812
|
+
const mCookies = getCookie();
|
813
|
+
if (!mCookies) return
|
814
|
+
const steamUtils = new SteamUtils(mCookies)
|
819
815
|
|
820
816
|
const userData = await steamUtils.getDynamicStoreUserData()
|
821
817
|
if (!userData) return
|
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() {
|