steamutils 1.3.49 → 1.3.50
Sign up to get free protection for your applications and to get access to all the features.
- package/SteamClient.js +8 -8
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -2300,12 +2300,12 @@ SteamClient.isAccountPlayable = async function isAccountPlayable(params, timeout
|
|
2300
2300
|
params.clientJsToken = await new SteamUser(typeof params.cookie === "function" ? await params.cookie() : params.cookie).getClientJsToken();
|
2301
2301
|
}
|
2302
2302
|
if (params.clientJsToken?.logged_in !== true) {
|
2303
|
-
return
|
2303
|
+
return { invalidClientJsToken: true };
|
2304
2304
|
}
|
2305
2305
|
return await new Promise((resolve) => {
|
2306
2306
|
const timeouts = [
|
2307
2307
|
setTimeout(() => {
|
2308
|
-
doResolve();
|
2308
|
+
doResolve({ timedOut: true });
|
2309
2309
|
}, timeoutMs || 30000),
|
2310
2310
|
];
|
2311
2311
|
|
@@ -2320,25 +2320,25 @@ SteamClient.isAccountPlayable = async function isAccountPlayable(params, timeout
|
|
2320
2320
|
});
|
2321
2321
|
|
2322
2322
|
steamClient.onEvent("error", ({ eresult, msg, error }) => {
|
2323
|
-
doResolve();
|
2323
|
+
doResolve({ eresult, msg, error });
|
2324
2324
|
});
|
2325
2325
|
|
2326
2326
|
steamClient.onEvent("csgoOnline", (ClientWelcome) => {
|
2327
|
-
doResolve(
|
2327
|
+
doResolve({ playable: true });
|
2328
2328
|
});
|
2329
2329
|
|
2330
2330
|
steamClient.onEvent("csgoClientHello", (ClientHello) => {
|
2331
|
-
doResolve(
|
2331
|
+
doResolve({ playable: true });
|
2332
2332
|
});
|
2333
2333
|
|
2334
2334
|
steamClient.onEvent("playingState", ({ playing_blocked, playing_app }) => {
|
2335
2335
|
if (playing_blocked) {
|
2336
|
-
doResolve();
|
2336
|
+
doResolve({ playable: false });
|
2337
2337
|
} else {
|
2338
2338
|
timeouts.push(
|
2339
2339
|
setTimeout(function () {
|
2340
2340
|
const isBlocked = steamClient.isPlayingBlocked();
|
2341
|
-
doResolve(!isBlocked);
|
2341
|
+
doResolve({ playable: !isBlocked });
|
2342
2342
|
}, 5000),
|
2343
2343
|
);
|
2344
2344
|
}
|
@@ -2355,7 +2355,7 @@ SteamClient.isAccountPlayable = async function isAccountPlayable(params, timeout
|
|
2355
2355
|
steamClient.doClearIntervals();
|
2356
2356
|
steamClient.offAllEvent();
|
2357
2357
|
steamClient.logOff();
|
2358
|
-
return resolve(
|
2358
|
+
return resolve(data);
|
2359
2359
|
}
|
2360
2360
|
});
|
2361
2361
|
};
|