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.
- package/.idea/gbrowser_project.xml +11 -0
- package/.idea/git_toolbox_blame.xml +6 -0
- package/.idea/git_toolbox_prj.xml +15 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/jsLibraryMappings.xml +6 -0
- package/.idea/jsLinters/eslint.xml +6 -0
- package/.idea/prettier.xml +8 -0
- package/SteamClient.js +19 -12
- package/_steamproto.js +39 -39
- package/full_steamproto.js +41 -0
- package/index.js +8206 -8025
- package/package.json +1 -1
- package/race.js +2241 -0
- package/steamproto.js +41 -150
- package/utils.js +1282 -1264
@@ -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,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
|
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
|
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
|
+
}
|