steamutils 1.0.55 → 1.0.56
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 +16 -6
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -628,7 +628,6 @@ function SteamClient({
|
|
628
628
|
await sleep(1000)
|
629
629
|
}
|
630
630
|
|
631
|
-
log(`app ${appid} launched`)
|
632
631
|
await sendHello()
|
633
632
|
|
634
633
|
callEvent(events.loggedOn)
|
@@ -726,13 +725,24 @@ function SteamClient({
|
|
726
725
|
return cookie
|
727
726
|
}
|
728
727
|
|
729
|
-
|
730
728
|
async function loginWithCookie(cookie, tryNewCookie = false) {
|
731
|
-
|
732
|
-
|
733
|
-
|
729
|
+
let response;
|
730
|
+
for (let i = 0; i < 10; i++) {
|
731
|
+
try {
|
732
|
+
response = (await axios.request({
|
733
|
+
url: 'https://steamcommunity.com/chat/clientjstoken',
|
734
|
+
headers: {
|
735
|
+
cookie,
|
736
|
+
},
|
737
|
+
}));
|
738
|
+
} catch (e) {
|
739
|
+
await sleep(1000)
|
734
740
|
}
|
735
|
-
|
741
|
+
if (response) {
|
742
|
+
break;
|
743
|
+
}
|
744
|
+
}
|
745
|
+
|
736
746
|
const result = response?.data
|
737
747
|
if (result?.logged_in) {
|
738
748
|
Object.assign(result, {
|