steamutils 1.0.52 → 1.0.54

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
@@ -88,10 +88,10 @@ function SteamClient({
88
88
  username,
89
89
  password,
90
90
  cookie,
91
+ isAutoRequestFreeLicense = true
91
92
  }) {
92
93
  const steamClient = new SteamUser()
93
94
  let prime = null
94
- let gamename = null;
95
95
 
96
96
  const events = {
97
97
  loggedOn: [],
@@ -215,18 +215,18 @@ function SteamClient({
215
215
  if (notCachesteamIDs.length) {
216
216
  let personas = null
217
217
  try {
218
- personas = (await steamClient.getPersonas(steamIDs))?.personas
218
+ personas = (await steamClient.getPersonas(notCachesteamIDs))?.personas
219
219
  } catch (e) {
220
220
  }
221
221
  if (!personas || !Object.keys(personas).length) {
222
222
  try {
223
- personas = (await steamClient.getPersonas(steamIDs))?.personas
223
+ personas = (await steamClient.getPersonas(notCachesteamIDs))?.personas
224
224
  } catch (e) {
225
225
  }
226
226
  }
227
227
  if (!personas || !Object.keys(personas).length) {
228
228
  try {
229
- personas = (await steamClient.getPersonas(steamIDs))?.personas
229
+ personas = (await steamClient.getPersonas(notCachesteamIDs))?.personas
230
230
  } catch (e) {
231
231
  }
232
232
  }
@@ -628,14 +628,6 @@ function SteamClient({
628
628
  } catch (e) {
629
629
  }
630
630
 
631
- if (gamename) {
632
- steamClient.gamesPlayed([{
633
- game_id: appid, game_extra_info: gamename
634
- }], true);
635
- } else {
636
- // steamClient.gamesPlayed(appid, true)
637
- }
638
-
639
631
  steamClient.setPersona(SteamUser.EPersonaState.LookingToPlay)
640
632
 
641
633
  while (!steamClient.accountInfo) {
@@ -646,6 +638,12 @@ function SteamClient({
646
638
  await sendHello()
647
639
 
648
640
  callEvent(events.loggedOn)
641
+
642
+ if (isAutoRequestFreeLicense) {
643
+ doSetInterval(function () {
644
+ autoRequestFreeLicense(false, 50)
645
+ }, 60000, 'autoRequestFreeLicense')
646
+ }
649
647
  })
650
648
 
651
649
  steamClient.on('friendMessage', async (user, message) => {
@@ -817,12 +815,15 @@ function SteamClient({
817
815
  }
818
816
 
819
817
  async function autoRequestFreeLicense(shouldLog = false, max = 10) {
820
- const steamUtils = new SteamUtils(getCookie())
818
+ const mCookies = getCookie();
819
+ if (!mCookies) return
820
+ const steamUtils = new SteamUtils(mCookies)
821
821
 
822
822
  const userData = await steamUtils.getDynamicStoreUserData()
823
- const ownedApps = userData?.rgOwnedApps || []
823
+ if (!userData) return
824
+ const ownedApps = userData.rgOwnedApps || []
824
825
  const ownedAppsCount = shouldLog ? (ownedApps?.length || 0) : 0
825
- let recommendedApps = Math.random() > 0.5 ? _.shuffle(userData?.rgRecommendedApps || []) : []
826
+ let recommendedApps = Math.random() > 0.5 ? _.shuffle(userData.rgRecommendedApps || []) : []
826
827
  if (!recommendedApps?.length) {
827
828
  recommendedApps = (await axios.request({url: 'https://raw.githubusercontent.com/5x/easy-steam-free-packages/master/src/script/packages_db.json'}))?.data?.packages || []
828
829
  }
@@ -910,9 +911,6 @@ function SteamClient({
910
911
  setPersona(state, name) {
911
912
  steamClient.setPersona(state, name)
912
913
  },
913
- setGameName(name) {
914
- gamename = name
915
- },
916
914
  sendFriendMessage,
917
915
  sendFriendTyping,
918
916
  getSteamClient() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.52",
3
+ "version": "1.0.54",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",