steamutils 1.3.46 → 1.3.47

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/SteamClient.js +13 -4
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -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 timeout = setTimeout(() => {
2311
- doResolve();
2312
- }, timeoutMs || 30000);
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.3.46",
3
+ "version": "1.3.47",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.5",