steamutils 1.4.43 → 1.4.45
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/SteamClient.js +21 -14
- package/package.json +5 -1
- package/patches/steam-user+5.0.10.patch +16 -0
package/SteamClient.js
CHANGED
@@ -813,6 +813,7 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
813
813
|
prime = false;
|
814
814
|
const CMsgClientWelcome = new SteamProto(SteamProtoType.CMsgClientWelcome).protoDecode(payload);
|
815
815
|
const obj = {};
|
816
|
+
const items = {};
|
816
817
|
for (const outofdate_cache of CMsgClientWelcome.outofdate_subscribed_caches) {
|
817
818
|
for (const cache_object of outofdate_cache.objects) {
|
818
819
|
for (const object_data of cache_object.object_data) {
|
@@ -821,15 +822,11 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
821
822
|
const result = new SteamProto(SteamProtoType.CSOEconItem).protoDecode(object_data);
|
822
823
|
result.id = result.id.toNumber();
|
823
824
|
result.original_id = result.original_id.toNumber();
|
824
|
-
|
825
|
-
obj.items = {};
|
826
|
-
}
|
827
|
-
obj.items[result.id] = result;
|
825
|
+
items[result.id] = result;
|
828
826
|
break;
|
829
827
|
}
|
830
828
|
case 2: {
|
831
|
-
|
832
|
-
obj.PersonaDataPublic = result;
|
829
|
+
obj.PersonaDataPublic = new SteamProto(SteamProtoType.CSOPersonaDataPublic).protoDecode(object_data);
|
833
830
|
const example = {
|
834
831
|
player_level: 4, //CSGO_Profile_Rank
|
835
832
|
commendation: {
|
@@ -939,9 +936,16 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
939
936
|
}
|
940
937
|
}
|
941
938
|
}
|
942
|
-
_clientWelcome =
|
943
|
-
_clientWelcome.items = {};
|
939
|
+
_clientWelcome = obj;
|
944
940
|
|
941
|
+
for (const itemId in items) {
|
942
|
+
try {
|
943
|
+
if (!obj.personalStore.items.includes(parseInt(itemId))) {
|
944
|
+
delete items[itemId];
|
945
|
+
}
|
946
|
+
} catch (e) {}
|
947
|
+
}
|
948
|
+
obj.items = items;
|
945
949
|
callEvent(events.csgoOnline, obj);
|
946
950
|
|
947
951
|
if (isPartyRegister) {
|
@@ -1290,6 +1294,12 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
1290
1294
|
},
|
1291
1295
|
async user(steamId, data) {
|
1292
1296
|
callEvent(events.user, { steamId: steamId.getSteamID64(), data });
|
1297
|
+
|
1298
|
+
steamClient.users = {};
|
1299
|
+
setTimeout(function () {
|
1300
|
+
steamClient.users = {};
|
1301
|
+
}, 10000);
|
1302
|
+
|
1293
1303
|
const dataExample = {
|
1294
1304
|
rich_presence: [
|
1295
1305
|
{
|
@@ -1478,12 +1488,6 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
1478
1488
|
steamClient.licenses = [];
|
1479
1489
|
}, 10000);
|
1480
1490
|
},
|
1481
|
-
async users() {
|
1482
|
-
steamClient.users = {};
|
1483
|
-
setTimeout(function () {
|
1484
|
-
steamClient.users = {};
|
1485
|
-
}, 10000);
|
1486
|
-
},
|
1487
1491
|
};
|
1488
1492
|
|
1489
1493
|
const _chatEvents = {
|
@@ -2474,6 +2478,9 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
2474
2478
|
return _clientHello;
|
2475
2479
|
},
|
2476
2480
|
getClientWelcome() {
|
2481
|
+
setTimeout(function () {
|
2482
|
+
_clientWelcome = null;
|
2483
|
+
}, 5000);
|
2477
2484
|
return _clientWelcome;
|
2478
2485
|
},
|
2479
2486
|
redeemFreeReward,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "steamutils",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.45",
|
4
4
|
"main": "index.js",
|
5
5
|
"dependencies": {
|
6
6
|
"alpha-common-utils": "^1.0.6",
|
@@ -15,6 +15,7 @@
|
|
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",
|
18
19
|
"protobufjs": "^7.4.0",
|
19
20
|
"qs": "^6.13.0",
|
20
21
|
"steam-session": "^1.7.2",
|
@@ -31,5 +32,8 @@
|
|
31
32
|
"devDependencies": {
|
32
33
|
"eslint-config-prettier": "^9.1.0",
|
33
34
|
"eslint-plugin-prettier": "^5.2.1"
|
35
|
+
},
|
36
|
+
"scripts": {
|
37
|
+
"postinstall": "patch-package"
|
34
38
|
}
|
35
39
|
}
|
@@ -0,0 +1,16 @@
|
|
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
|
+
});
|