steamutils 1.0.52 → 1.0.53

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.
Files changed (2) hide show
  1. package/SteamClient.js +10 -14
  2. package/package.json +1 -1
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: [],
@@ -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) => {
@@ -820,9 +818,10 @@ function SteamClient({
820
818
  const steamUtils = new SteamUtils(getCookie())
821
819
 
822
820
  const userData = await steamUtils.getDynamicStoreUserData()
823
- const ownedApps = userData?.rgOwnedApps || []
821
+ if (!userData) return
822
+ const ownedApps = userData.rgOwnedApps || []
824
823
  const ownedAppsCount = shouldLog ? (ownedApps?.length || 0) : 0
825
- let recommendedApps = Math.random() > 0.5 ? _.shuffle(userData?.rgRecommendedApps || []) : []
824
+ let recommendedApps = Math.random() > 0.5 ? _.shuffle(userData.rgRecommendedApps || []) : []
826
825
  if (!recommendedApps?.length) {
827
826
  recommendedApps = (await axios.request({url: 'https://raw.githubusercontent.com/5x/easy-steam-free-packages/master/src/script/packages_db.json'}))?.data?.packages || []
828
827
  }
@@ -910,9 +909,6 @@ function SteamClient({
910
909
  setPersona(state, name) {
911
910
  steamClient.setPersona(state, name)
912
911
  },
913
- setGameName(name) {
914
- gamename = name
915
- },
916
912
  sendFriendMessage,
917
913
  sendFriendTyping,
918
914
  getSteamClient() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",