steamutils 1.3.43 → 1.3.45

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
4
+ <serverData>
5
+ <paths name="botnatridiscord">
6
+ <serverdata>
7
+ <mappings>
8
+ <mapping local="$PROJECT_DIR$" web="/" />
9
+ </mappings>
10
+ </serverdata>
11
+ </paths>
12
+ </serverData>
13
+ </component>
14
+ </project>
package/SteamClient.js CHANGED
@@ -2279,20 +2279,30 @@ export function increaseCSGO_VER() {
2279
2279
  return ++CSGO_VER
2280
2280
  }
2281
2281
 
2282
- SteamClient.isAccountPlayable = function isAccountPlayable(cookie, timeoutMs) {
2283
- return new Promise((resolve) => {
2282
+ SteamClient.isAccountPlayable = async function isAccountPlayable(params, timeoutMs) {
2283
+ let clientJsToken = params.clientJsToken
2284
+ delete params.clientJsToken
2285
+ if(!clientJsToken && params.cookie){
2286
+ clientJsToken = await new SteamUser(typeof params.cookie === "function" ? await params.cookie() : params.cookie).getClientJsToken()
2287
+ }
2288
+ if (clientJsToken?.logged_in !== true) {
2289
+ return false
2290
+ }
2291
+ params.clientJsToken = clientJsToken
2292
+
2293
+ return await new Promise((resolve) => {
2284
2294
  const timeout = setTimeout(() => {
2285
2295
  doResolve();
2286
2296
  }, timeoutMs || 30000);
2287
2297
 
2288
2298
  const steamClient = new SteamClient({
2289
- cookie,
2290
2299
  isFakeGameScore: false,
2291
2300
  isAutoPlay: true,
2292
2301
  isPartyRegister: false,
2293
2302
  isInvisible: false,
2294
2303
  MAX_GAME_PLAY: 10,
2295
2304
  games: 730,
2305
+ ...params,
2296
2306
  });
2297
2307
 
2298
2308
  steamClient.onEvent("error", ({eresult, msg, error}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.3.43",
3
+ "version": "1.3.45",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.5",