steamutils 1.4.67 → 1.4.69
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 -23
- package/package.json +1 -1
package/SteamClient.js
CHANGED
|
@@ -2046,34 +2046,27 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
2048
2048
|
|
|
2049
|
-
async function reLogin(retry =
|
|
2050
|
-
|
|
2051
|
-
offAllEvent();
|
|
2052
|
-
doClearIntervals();
|
|
2049
|
+
async function reLogin(retry = 0) {
|
|
2050
|
+
const MAX_RETRY = 1000;
|
|
2053
2051
|
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2052
|
+
while (++retry < MAX_RETRY) {
|
|
2053
|
+
if (isLogOff || retry > MAX_RETRY) {
|
|
2054
|
+
offAllEvent();
|
|
2055
|
+
doClearIntervals();
|
|
2057
2056
|
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
return true;
|
|
2062
|
-
}
|
|
2057
|
+
error(`Cannot relogin (${isLogOff ? "logoff" : "retry limit reached"})`);
|
|
2058
|
+
return false;
|
|
2059
|
+
}
|
|
2063
2060
|
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
}
|
|
2061
|
+
const isSuccess = await login(true);
|
|
2062
|
+
if (isSuccess) {
|
|
2063
|
+
log("Relogin success");
|
|
2064
|
+
return true;
|
|
2065
|
+
}
|
|
2070
2066
|
|
|
2071
|
-
|
|
2072
|
-
await sleep(60000);
|
|
2073
|
-
return await reLogin(retry - 1);
|
|
2074
|
-
} else {
|
|
2075
|
-
return false;
|
|
2067
|
+
await sleep(15000);
|
|
2076
2068
|
}
|
|
2069
|
+
return false;
|
|
2077
2070
|
}
|
|
2078
2071
|
|
|
2079
2072
|
async function login(reconnect = false) {
|