steamutils 1.0.6 → 1.0.7

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 +47 -3
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -115,6 +115,7 @@ function SteamClient({
115
115
  return {}
116
116
  } else {
117
117
  for (let sid64 in personas) {
118
+ personas[sid64].id = sid64
118
119
  personas[sid64].avatar_hash = Buffer.from(personas[sid64].avatar_hash).toString("hex")
119
120
  personasCache.push(personas[sid64])
120
121
  cachedPersonas.push(personas[sid64])
@@ -339,26 +340,69 @@ function SteamClient({
339
340
  case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Party_Search: {
340
341
  const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_Party_SearchResults, payload)
341
342
  const entries = _.uniqBy(result.entries, 'id')
343
+ //{
344
+ // "id": 144900402,
345
+ // "grp": 0,
346
+ // "game_type": 8,
347
+ // "apr": 1,
348
+ // "ark": 17,
349
+ // "loc": 20041,
350
+ // "accountid": 0
351
+ // }
342
352
 
343
353
  const players = []
344
354
 
345
355
  const steamIDs = entries
346
356
  .map(p => SteamID.fromIndividualAccountID(p.id).getSteamID64())
347
357
  const personas = await getPersonas(steamIDs)
348
-
358
+ //{
359
+ // "id": "144900402",
360
+ // "rich_presence": [],
361
+ // "persona_state": null,
362
+ // "game_played_app_id": null,
363
+ // "game_server_ip": null,
364
+ // "game_server_port": null,
365
+ // "persona_state_flags": null,
366
+ // "online_session_instances": null,
367
+ // "persona_set_by_user": null,
368
+ // "player_name": "杀人不见血",
369
+ // "query_port": null,
370
+ // "steamid_source": null,
371
+ // "avatar_hash": "33994e26f1fe7e2093f8c7dee66c1ac91531050d",
372
+ // "last_logoff": null,
373
+ // "last_logon": null,
374
+ // "last_seen_online": null,
375
+ // "clan_rank": null,
376
+ // "game_name": null,
377
+ // "gameid": null,
378
+ // "game_data_blob": null,
379
+ // "clan_data": null,
380
+ // "clan_tag": null,
381
+ // "broadcast_id": null,
382
+ // "game_lobby_id": null,
383
+ // "watching_broadcast_accountid": null,
384
+ // "watching_broadcast_appid": null,
385
+ // "watching_broadcast_viewers": null,
386
+ // "watching_broadcast_title": null,
387
+ // "is_community_banned": null,
388
+ // "player_name_pending_review": null,
389
+ // "avatar_pending_review": null,
390
+ // "avatar_url_icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/33/33994e26f1fe7e2093f8c7dee66c1ac91531050d.jpg",
391
+ // "avatar_url_medium": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/33/33994e26f1fe7e2093f8c7dee66c1ac91531050d_medium.jpg",
392
+ // "avatar_url_full": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/33/33994e26f1fe7e2093f8c7dee66c1ac91531050d_full.jpg"
393
+ // }
349
394
  for (const player of entries) {
350
395
  try {
351
396
  const prime = player.apr === 1 ? 'PRIME' : 'NON-PRIME'
352
397
  const loc = LOCS[player.loc] || player.loc
353
398
  const steamID = SteamID.fromIndividualAccountID(player.id).getSteamID64()
354
399
  const persona = personas.find(p => p.id == player.id)
355
- const player_name = persona.player_name
356
400
  const friendCode = FriendCode.encode(steamID)
357
401
 
358
402
  if ((LOCS[player.loc] == 'VN' || !LOCS[player.loc])) {
359
403
  players.push({
360
404
  prime,
361
- player_name: player_name,
405
+ player_name: persona.player_name,
362
406
  rank: RANKS[player.ark],
363
407
  loc: loc,
364
408
  steamID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",