steamutils 1.0.19 → 1.0.20

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 +14 -1
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -466,6 +466,11 @@ function SteamClient({
466
466
  player_xp_bonus_flags: 0
467
467
  }]
468
468
  console.log(data);
469
+
470
+ const accountid = data?.[0]?.account_id
471
+ const cb = getPlayersProfileCallback[accountid]
472
+ delete getPlayersProfileCallback[accountid]
473
+ cb?.(data?.[0])
469
474
  break
470
475
  }
471
476
  default:
@@ -565,11 +570,18 @@ function SteamClient({
565
570
  steamClient.chat.sendFriendTyping(steamId, callback)
566
571
  }
567
572
 
573
+
574
+ const getPlayersProfileCallback = {};
575
+
568
576
  function getPlayersProfile(accountid) {
569
577
  steamClient.sendToGC(730, Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientRequestPlayersProfile, {}, protoEncode(Protos.csgo.CMsgGCCStrike15_v2_ClientRequestPlayersProfile, {
570
578
  account_id: accountid, // account_id: new SteamID('76561199184696945').accountid,
571
579
  request_level: 32
572
580
  }))
581
+ return new Promise(resolve => {
582
+ getPlayersProfileCallback[accountid] = resolve
583
+ setTimeout(resolve, 30000)
584
+ })
573
585
  }
574
586
 
575
587
  async function login() {
@@ -654,7 +666,8 @@ function SteamClient({
654
666
  getSteamClient() {
655
667
  return steamClient
656
668
  },
657
- getAccountInfoName
669
+ getAccountInfoName,
670
+ getPlayersProfile
658
671
  }
659
672
  }
660
673
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",