steamutils 1.3.22 → 1.3.24
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
CHANGED
@@ -83,6 +83,7 @@ SteamUtils.getAppVersion(AppID).then(function (ver) {
|
|
83
83
|
})
|
84
84
|
|
85
85
|
const PersonasCache = []
|
86
|
+
let isSendingFriendMessages = false;
|
86
87
|
|
87
88
|
function SteamClient({
|
88
89
|
username,
|
@@ -1479,27 +1480,35 @@ function SteamClient({
|
|
1479
1480
|
}
|
1480
1481
|
|
1481
1482
|
async function sendFriendMessage(steamId, message) {
|
1482
|
-
while (sendMessageTimestamp && new Date().getTime() - sendMessageTimestamp <
|
1483
|
-
await sleep(
|
1483
|
+
while (sendMessageTimestamp && new Date().getTime() - sendMessageTimestamp < 2000) {
|
1484
|
+
await sleep(1000)
|
1484
1485
|
}
|
1485
1486
|
|
1487
|
+
while (isSendingFriendMessages) {
|
1488
|
+
await sleep(5000)
|
1489
|
+
}
|
1490
|
+
|
1491
|
+
isSendingFriendMessages = true
|
1486
1492
|
const now = new Date().getTime()
|
1487
|
-
while (new Date().getTime() - now <
|
1493
|
+
while (new Date().getTime() - now < 2 * 60000) {//2 minutes
|
1488
1494
|
const result = await new Promise(resolve => {
|
1489
1495
|
steamClient.chat.sendFriendMessage(steamId, message, undefined, function (...arg) {
|
1496
|
+
sendMessageTimestamp = new Date().getTime()
|
1490
1497
|
resolve(arg)
|
1491
1498
|
});
|
1492
1499
|
})
|
1493
1500
|
|
1494
1501
|
if (result?.[1]?.server_timestamp) {
|
1495
|
-
|
1502
|
+
isSendingFriendMessages = false
|
1496
1503
|
return result?.[1]
|
1497
1504
|
} else if (result?.[0]?.message?.includes?.("RateLimitExceeded")) {
|
1498
1505
|
await sleep(5000)
|
1499
1506
|
} else {
|
1507
|
+
isSendingFriendMessages = false
|
1500
1508
|
return result
|
1501
1509
|
}
|
1502
1510
|
}
|
1511
|
+
isSendingFriendMessages = false
|
1503
1512
|
}
|
1504
1513
|
|
1505
1514
|
async function autoRequestFreeLicense(shouldLog = false, max = 10) {
|
package/index.js
CHANGED
@@ -2619,7 +2619,7 @@ class SteamUser {
|
|
2619
2619
|
matchInfo.waitTime = text.substringAfter('Wait Time: ')
|
2620
2620
|
} else if (text.startsWith('Match Duration: ')) {
|
2621
2621
|
matchInfo.duration = text.substringAfter('Match Duration: ')
|
2622
|
-
} else if (text === 'Download GOTV Replay' || text === 'Download Replay') {
|
2622
|
+
} else if (text === 'Download GOTV Replay' || text === 'Download Replay' || text === 'Tải bản phát lại') {
|
2623
2623
|
matchInfo.GOTV_Replay = tdEl.find('a').attr('href')
|
2624
2624
|
} else if (text.startsWith('Viewers: ')) {
|
2625
2625
|
matchInfo.viewers = parseInt(text.substringAfter('Viewers: '))
|
package/package.json
CHANGED
@@ -70,6 +70,13 @@ message CMsgClientMMSLeaveLobbyResponse {
|
|
70
70
|
optional int32 eresult = 3 [default = 2];
|
71
71
|
}
|
72
72
|
|
73
|
+
message CMsgIPAddress {
|
74
|
+
oneof ip {
|
75
|
+
fixed32 v4 = 1;
|
76
|
+
bytes v6 = 2;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
73
80
|
message CMsgClientMMSGetLobbyList {
|
74
81
|
message Filter {
|
75
82
|
optional string key = 1;
|