steamutils 1.0.18 → 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 +16 -2
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -242,7 +242,7 @@ function SteamClient({
242
242
  // console.log(msg)
243
243
  const personas = await getPersonas([sid]);
244
244
  const sID64 = sid.getSteamID64();
245
- console.log(personas.find(p => p.id == sID64)?.player_name, `https://steamcommunity.com/profiles/${sID64}`);
245
+ console.log(getAccountInfoName(), personas.find(p => p.id == sID64)?.player_name, `https://steamcommunity.com/profiles/${sID64}`);
246
246
  // joinLobby(msg.lobbyid, msg.accountid)
247
247
  break
248
248
  }
@@ -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() {
@@ -653,7 +665,9 @@ function SteamClient({
653
665
  sendFriendTyping,
654
666
  getSteamClient() {
655
667
  return steamClient
656
- }
668
+ },
669
+ getAccountInfoName,
670
+ getPlayersProfile
657
671
  }
658
672
  }
659
673
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",