steamutils 1.4.42 → 1.4.44
Sign up to get free protection for your applications and to get access to all the features.
- package/SteamClient.js +21 -14
- package/package.json +1 -1
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,
|