steamutils 1.3.46 → 1.3.48
Sign up to get free protection for your applications and to get access to all the features.
- package/SteamClient.js +15 -6
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -1977,11 +1977,11 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
1977
1977
|
|
1978
1978
|
steamClient.gamesPlayed(apps);
|
1979
1979
|
const shouldHello = apps.some((app) => parseInt(app) === 730);
|
1980
|
-
await sleep(
|
1980
|
+
await sleep(2000);
|
1981
1981
|
if (shouldHello) {
|
1982
1982
|
await sendHello();
|
1983
1983
|
}
|
1984
|
-
await sleep(
|
1984
|
+
await sleep(2000);
|
1985
1985
|
if (shouldHello) {
|
1986
1986
|
await sendHello();
|
1987
1987
|
}
|
@@ -2307,9 +2307,11 @@ SteamClient.isAccountPlayable = async function isAccountPlayable(params, timeout
|
|
2307
2307
|
params.clientJsToken = clientJsToken;
|
2308
2308
|
|
2309
2309
|
return await new Promise((resolve) => {
|
2310
|
-
const
|
2311
|
-
|
2312
|
-
|
2310
|
+
const timeouts = [
|
2311
|
+
setTimeout(() => {
|
2312
|
+
doResolve();
|
2313
|
+
}, timeoutMs || 30000),
|
2314
|
+
];
|
2313
2315
|
|
2314
2316
|
const steamClient = new SteamClient({
|
2315
2317
|
isFakeGameScore: false,
|
@@ -2336,6 +2338,13 @@ SteamClient.isAccountPlayable = async function isAccountPlayable(params, timeout
|
|
2336
2338
|
steamClient.onEvent("playingState", ({ playing_blocked, playing_app }) => {
|
2337
2339
|
if (playing_blocked) {
|
2338
2340
|
doResolve();
|
2341
|
+
} else {
|
2342
|
+
timeouts.push(
|
2343
|
+
setTimeout(function () {
|
2344
|
+
const isBlocked = steamClient.isPlayingBlocked();
|
2345
|
+
doResolve(!isBlocked);
|
2346
|
+
}, 5000),
|
2347
|
+
);
|
2339
2348
|
}
|
2340
2349
|
});
|
2341
2350
|
|
@@ -2346,7 +2355,7 @@ SteamClient.isAccountPlayable = async function isAccountPlayable(params, timeout
|
|
2346
2355
|
steamClient.init();
|
2347
2356
|
|
2348
2357
|
function doResolve(data) {
|
2349
|
-
clearTimeout(timeout);
|
2358
|
+
timeouts.forEach((timeout) => clearTimeout(timeout));
|
2350
2359
|
steamClient.doClearIntervals();
|
2351
2360
|
steamClient.offAllEvent();
|
2352
2361
|
steamClient.logOff();
|