steamutils 1.2.83 → 1.2.85

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/SteamClient.js +15 -2
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -126,6 +126,7 @@ function SteamClient({
126
126
  offlineMessages: [],
127
127
  friendsList: [],
128
128
  gifts: [],
129
+ playingState: [],
129
130
  }
130
131
 
131
132
  const gcCallback = {}
@@ -1091,6 +1092,7 @@ function SteamClient({
1091
1092
  console.log("Playing else where")
1092
1093
  }
1093
1094
  log('playingState', playing_blocked, playing_app);
1095
+ callEvent(events.playingState, {playing_blocked, playing_app})
1094
1096
  },
1095
1097
  async friendRelationship(sid, relationship, previousRelationship) {
1096
1098
  callEvent(events.friendRelationship, {steamId: sid.getSteamID64(), relationship, previousRelationship})
@@ -1247,13 +1249,16 @@ function SteamClient({
1247
1249
  }
1248
1250
 
1249
1251
 
1252
+ /*
1253
+ * usually take 400 -> 800 miliseconds
1254
+ * */
1250
1255
  function getPlayersProfile(accountid) {
1251
1256
  steamClient.sendToGC(730, Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientRequestPlayersProfile, {}, protoEncode(Protos.csgo.CMsgGCCStrike15_v2_ClientRequestPlayersProfile, {
1252
1257
  account_id: accountid, // account_id: new SteamID('76561199184696945').accountid,
1253
1258
  request_level: 32
1254
1259
  }))
1255
1260
  return new Promise(resolve => {
1256
- pushGCCallback('PlayersProfile' + accountid, resolve, 60000)
1261
+ pushGCCallback('PlayersProfile' + accountid, resolve, 2000)
1257
1262
  })
1258
1263
  }
1259
1264
 
@@ -1666,7 +1671,15 @@ function SteamClient({
1666
1671
  return steamClient
1667
1672
  },
1668
1673
  getAccountInfoName,
1669
- getPlayersProfile,
1674
+ async getPlayersProfile(accountid, retry = 3){
1675
+ for (let i = 0; i < retry; i++) {
1676
+ const profile = await getPlayersProfile(accountid)
1677
+ if(profile){
1678
+ return profile
1679
+ }
1680
+ }
1681
+ return null
1682
+ },
1670
1683
  autoRequestFreeLicense,
1671
1684
  playCSGO,
1672
1685
  doSetInterval,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.83",
3
+ "version": "1.2.85",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.5.1",