steamutils 1.5.33 → 1.5.35

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.
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GBrowserProjectService"><![CDATA[{
4
+ "tabs": [
5
+ {
6
+ "url": "http://google.com.vn",
7
+ "createdAt": "2024-08-14T16:14:35Z"
8
+ }
9
+ ]
10
+ }]]></component>
11
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GitToolBoxBlameSettings">
4
+ <option name="version" value="2" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GitToolBoxProjectSettings">
4
+ <option name="commitMessageIssueKeyValidationOverride">
5
+ <BoolValueOverride>
6
+ <option name="enabled" value="true" />
7
+ </BoolValueOverride>
8
+ </option>
9
+ <option name="commitMessageValidationEnabledOverride">
10
+ <BoolValueOverride>
11
+ <option name="enabled" value="true" />
12
+ </BoolValueOverride>
13
+ </option>
14
+ </component>
15
+ </project>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </component>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="JavaScriptLibraryMappings">
4
+ <includedPredefinedLibrary name="Node.js Core" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="EslintConfiguration">
4
+ <option name="fix-on-save" value="true" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PrettierConfiguration">
4
+ <option name="myConfigurationMode" value="MANUAL" />
5
+ <option name="myRunOnSave" value="true" />
6
+ <option name="myRunOnReformat" value="true" />
7
+ </component>
8
+ </project>
package/SteamClient.js CHANGED
@@ -2386,7 +2386,7 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
2386
2386
 
2387
2387
  const online = await Promise.race([
2388
2388
  new Promise((resolve) => {
2389
- setTimeout(function () {
2389
+ setTimeout(function() {
2390
2390
  resolve();
2391
2391
  }, 60000);
2392
2392
  }),
@@ -2394,41 +2394,48 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
2394
2394
  eventIds.push(
2395
2395
  onEvent({
2396
2396
  name: SteamClientEvents.logOff,
2397
- callback: function () {
2397
+ callback: function() {
2398
2398
  resolve(false);
2399
2399
  },
2400
- once: true,
2400
+ once: true
2401
2401
  }),
2402
2402
  onEvent({
2403
2403
  name: SteamClientEvents.csgoOnline,
2404
- callback: function () {
2404
+ callback: function() {
2405
2405
  resolve(true);
2406
2406
  },
2407
- once: true,
2407
+ once: true
2408
+ }),
2409
+ onEvent({
2410
+ name: SteamClientEvents.csgoClientHello,
2411
+ callback: function() {
2412
+ resolve(true);
2413
+ },
2414
+ once: true
2408
2415
  }),
2409
2416
  onEvent({
2410
2417
  name: SteamClientEvents.error,
2411
- callback: function () {
2418
+ callback: function() {
2412
2419
  resolve(false);
2413
2420
  },
2414
- once: true,
2421
+ once: true
2415
2422
  }),
2416
2423
  onEvent({
2417
2424
  name: SteamClientEvents.playingState,
2418
- callback: function ({ playing_blocked }) {
2425
+ callback: function({ playing_blocked }) {
2419
2426
  if (playing_blocked) {
2420
2427
  resolve(false);
2421
2428
  }
2422
- },
2423
- }),
2429
+ }
2430
+ })
2424
2431
  );
2425
2432
 
2426
- init().then(function (logged) {
2433
+ init().then(function(logged) {
2427
2434
  if (!logged) {
2428
2435
  resolve(false);
2429
2436
  }
2430
2437
  });
2431
- }),
2438
+ })
2432
2439
  ]);
2433
2440
 
2434
2441
  clearTimeout(timeout);
package/_steamproto.js CHANGED
@@ -1,39 +1,39 @@
1
- import path from "path";
2
- import { fileURLToPath } from "url";
3
- import Protobuf from "protobufjs";
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = path.dirname(__filename);
7
-
8
- export class SteamProto {
9
- constructor(proto) {
10
- this._proto = proto;
11
- }
12
-
13
- toProto() {
14
- const root = new Protobuf.Root().loadSync(path.join(`${__dirname}/protos/`, this._proto.filename), {
15
- keepCase: true,
16
- });
17
- return root[this._proto.name];
18
- }
19
-
20
- protoEncode(obj) {
21
- const protobuf = this.toProto();
22
- return protobuf.encode(protobuf.create(obj)).finish();
23
- }
24
-
25
- protoEncodeBase64(obj) {
26
- return this.protoEncode(obj).toString("base64");
27
- }
28
-
29
- protoDecode(obj) {
30
- const protobuf = this.toProto();
31
- try {
32
- return protobuf.toObject(protobuf.decode(obj), { defaults: true });
33
- } catch (e) {
34
- console.error(`[${this._proto.name}] protoDecode 1`, typeof obj, obj);
35
- console.error(`[${this._proto.name}] protoDecode 2`, e);
36
- return null;
37
- }
38
- }
39
- }
1
+ import path from "path";
2
+ import { fileURLToPath } from "url";
3
+ import Protobuf from "protobufjs";
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+
8
+ export class SteamProto {
9
+ constructor(proto) {
10
+ this._proto = proto;
11
+ }
12
+
13
+ toProto() {
14
+ const root = new Protobuf.Root().loadSync(path.join(`${__dirname}/protos/`, this._proto.filename), {
15
+ keepCase: true,
16
+ });
17
+ return root[this._proto.name];
18
+ }
19
+
20
+ protoEncode(obj) {
21
+ const protobuf = this.toProto();
22
+ return protobuf.encode(protobuf.create(obj)).finish();
23
+ }
24
+
25
+ protoEncodeBase64(obj) {
26
+ return this.protoEncode(obj).toString("base64");
27
+ }
28
+
29
+ protoDecode(obj) {
30
+ const protobuf = this.toProto();
31
+ try {
32
+ return protobuf.toObject(protobuf.decode(obj), { defaults: true });
33
+ } catch (e) {
34
+ console.error(`[${this._proto.name}] protoDecode 1`, typeof obj, obj);
35
+ console.error(`[${this._proto.name}] protoDecode 2`, e);
36
+ return null;
37
+ }
38
+ }
39
+ }