steamutils 1.2.88 → 1.2.89
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.
- package/SteamClient.js +8 -7
- package/package.json +1 -1
package/SteamClient.js
CHANGED
|
@@ -946,8 +946,8 @@ function SteamClient({
|
|
|
946
946
|
if (player) {
|
|
947
947
|
player.prime = !!(player.ranking?.account_id || player.player_level || player.player_cur_xp)
|
|
948
948
|
player.steamId = SteamID.fromIndividualAccountID(player.account_id).getSteamID64()
|
|
949
|
+
callGCCallback('PlayersProfile_' + player.account_id, player)
|
|
949
950
|
}
|
|
950
|
-
callGCCallback('PlayersProfile' + player?.account_id, player)
|
|
951
951
|
callEvent(events.playersProfile, player)
|
|
952
952
|
break
|
|
953
953
|
}
|
|
@@ -1258,18 +1258,19 @@ function SteamClient({
|
|
|
1258
1258
|
/*
|
|
1259
1259
|
* usually take 400 -> 800 miliseconds
|
|
1260
1260
|
* */
|
|
1261
|
-
function getPlayersProfile(
|
|
1261
|
+
function getPlayersProfile(steamId) {
|
|
1262
|
+
const accountid = new SteamID(steamId).accountid
|
|
1262
1263
|
steamClient.sendToGC(730, Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientRequestPlayersProfile, {}, protoEncode(Protos.csgo.CMsgGCCStrike15_v2_ClientRequestPlayersProfile, {
|
|
1263
1264
|
account_id: accountid, // account_id: new SteamID('76561199184696945').accountid,
|
|
1264
1265
|
request_level: 32
|
|
1265
1266
|
}))
|
|
1266
1267
|
return new Promise(resolve => {
|
|
1267
|
-
pushGCCallback('
|
|
1268
|
+
pushGCCallback('PlayersProfile_' + accountid, resolve, 2000)
|
|
1268
1269
|
})
|
|
1269
1270
|
}
|
|
1270
1271
|
|
|
1271
|
-
async function checkPlayerPrimeStatus(
|
|
1272
|
-
const profile = await getPlayersProfile(
|
|
1272
|
+
async function checkPlayerPrimeStatus(steamId) {
|
|
1273
|
+
const profile = await getPlayersProfile(steamId)
|
|
1273
1274
|
if (!profile) return false
|
|
1274
1275
|
|
|
1275
1276
|
if (profile.ranking?.account_id) {
|
|
@@ -1680,9 +1681,9 @@ function SteamClient({
|
|
|
1680
1681
|
return steamClient
|
|
1681
1682
|
},
|
|
1682
1683
|
getAccountInfoName,
|
|
1683
|
-
async getPlayersProfile(
|
|
1684
|
+
async getPlayersProfile(steamId, retry = 3){
|
|
1684
1685
|
for (let i = 0; i < retry; i++) {
|
|
1685
|
-
const profile = await getPlayersProfile(
|
|
1686
|
+
const profile = await getPlayersProfile(steamId)
|
|
1686
1687
|
if(profile){
|
|
1687
1688
|
return profile
|
|
1688
1689
|
}
|