steamutils 1.4.45 → 1.4.47

Sign up to get free protection for your applications and to get access to all the features.
package/SteamClient.js CHANGED
@@ -106,6 +106,9 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
106
106
  let lastTimePartySearch = 0;
107
107
  const ownedApps = [];
108
108
  let logOffEvent = null;
109
+ let _cleanNodeSteamUserTimeout = null;
110
+ let _cleanNodeSteamLicensesTimeout = null;
111
+ let _cleanNodeSteamFriendTimeout = null;
109
112
 
110
113
  let _clientWelcome = null;
111
114
  let _clientHello = null;
@@ -1295,10 +1298,7 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
1295
1298
  async user(steamId, data) {
1296
1299
  callEvent(events.user, { steamId: steamId.getSteamID64(), data });
1297
1300
 
1298
- steamClient.users = {};
1299
- setTimeout(function () {
1300
- steamClient.users = {};
1301
- }, 10000);
1301
+ _cleanNodeSteamUserData();
1302
1302
 
1303
1303
  const dataExample = {
1304
1304
  rich_presence: [
@@ -1436,7 +1436,12 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
1436
1436
  callEvent(events.friendsList, getFriendList());
1437
1437
 
1438
1438
  steamClient.myFriends = {};
1439
- setTimeout(function () {
1439
+
1440
+ if (_cleanNodeSteamFriendTimeout) {
1441
+ clearTimeout(_cleanNodeSteamFriendTimeout);
1442
+ }
1443
+
1444
+ _cleanNodeSteamFriendTimeout = setTimeout(function () {
1440
1445
  steamClient.myFriends = {};
1441
1446
  }, 10000);
1442
1447
  },
@@ -1484,7 +1489,12 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
1484
1489
  },
1485
1490
  async licenses() {
1486
1491
  steamClient.licenses = [];
1487
- setTimeout(function () {
1492
+
1493
+ if (_cleanNodeSteamLicensesTimeout) {
1494
+ clearTimeout(_cleanNodeSteamLicensesTimeout);
1495
+ }
1496
+
1497
+ _cleanNodeSteamLicensesTimeout = setTimeout(function () {
1488
1498
  steamClient.licenses = [];
1489
1499
  }, 10000);
1490
1500
  },
@@ -1789,6 +1799,19 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
1789
1799
  function logOff() {
1790
1800
  isLogOff = true;
1791
1801
  logOffEvent?.(true);
1802
+ if (_cleanNodeSteamUserTimeout) {
1803
+ clearTimeout(_cleanNodeSteamUserTimeout);
1804
+ }
1805
+ if (_cleanNodeSteamLicensesTimeout) {
1806
+ clearTimeout(_cleanNodeSteamLicensesTimeout);
1807
+ }
1808
+ if (_cleanNodeSteamFriendTimeout) {
1809
+ clearTimeout(_cleanNodeSteamFriendTimeout);
1810
+ }
1811
+ steamClient.users = {};
1812
+ steamClient.myFriends = {};
1813
+ steamClient.licenses = [];
1814
+
1792
1815
  steamClient.logOff();
1793
1816
  }
1794
1817
 
@@ -2278,6 +2301,18 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
2278
2301
  );
2279
2302
  }
2280
2303
 
2304
+ function _cleanNodeSteamUserData() {
2305
+ for (const friendSteamId in steamClient.users) {
2306
+ steamClient.users[friendSteamId] = {};
2307
+ }
2308
+ if (_cleanNodeSteamUserTimeout) {
2309
+ clearTimeout(_cleanNodeSteamUserTimeout);
2310
+ }
2311
+ setTimeout(function () {
2312
+ steamClient.users = {};
2313
+ }, 60000);
2314
+ }
2315
+
2281
2316
  return {
2282
2317
  init,
2283
2318
  partySearch,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.4.45",
3
+ "version": "1.4.47",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.6",
@@ -15,7 +15,6 @@
15
15
  "moment": "^2.30.1",
16
16
  "moment-timezone": "^0.5.45",
17
17
  "node-bignumber": "^1.2.2",
18
- "patch-package": "^8.0.0",
19
18
  "protobufjs": "^7.4.0",
20
19
  "qs": "^6.13.0",
21
20
  "steam-session": "^1.7.2",
@@ -32,8 +31,5 @@
32
31
  "devDependencies": {
33
32
  "eslint-config-prettier": "^9.1.0",
34
33
  "eslint-plugin-prettier": "^5.2.1"
35
- },
36
- "scripts": {
37
- "postinstall": "patch-package"
38
34
  }
39
35
  }
@@ -1,16 +0,0 @@
1
- diff --git a/node_modules/steam-user/components/friends.js b/node_modules/steam-user/components/friends.js
2
- index 384338a..6a0d60e 100644
3
- --- a/node_modules/steam-user/components/friends.js
4
- +++ b/node_modules/steam-user/components/friends.js
5
- @@ -1096,7 +1096,10 @@ SteamUserBase.prototype._handlerManager.add(EMsg.ClientPersonaState, function(bo
6
-
7
- for (let i in processedUser) {
8
- if (Object.hasOwnProperty.call(processedUser, i) && processedUser[i] !== null) {
9
- - this.users[sid64][i] = processedUser[i];
10
- + try {
11
- + this.users[sid64][i] = processedUser[i];
12
- + } catch (e) {
13
- + }
14
- }
15
- }
16
- });