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.
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
4
+ </state>
5
+ </component>
@@ -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
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project version="4">
3
3
  <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
4
+ <mapping directory="" vcs="Git" />
5
5
  </component>
6
6
  </project>
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
- GetCurrentVersion(appid).then(function (ver) {
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(steamIDs))?.personas
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(steamIDs))?.personas
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(steamIDs))?.personas
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 steamUtils = new SteamUtils(getCookie())
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 result = await request(`https://api.steampowered.com/ISteamApps/UpToDateCheck/v1/?format=json&appid=${appID}&version=0`)
747
- return result?.data?.response?.required_version
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() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.53",
3
+ "version": "1.0.55",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",