steamutils 1.5.34 → 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/_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/_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
|
+
}
|