steamutils 1.3.58 → 1.3.59
Sign up to get free protection for your applications and to get access to all the features.
- package/SteamClient.js +6 -2
- package/create_remote_file.js +57 -55
- package/index.js +6426 -6433
- package/package.json +1 -1
- package/remote.js +1782 -1434
- package/test_steamclient.js +2 -3
package/SteamClient.js
CHANGED
@@ -2392,11 +2392,15 @@ SteamClient.isAccountPlayable = async function isAccountPlayable({ cookie, clien
|
|
2392
2392
|
|
2393
2393
|
if (data?.playable === true) {
|
2394
2394
|
if (typeof onPlayable === "function") {
|
2395
|
-
|
2395
|
+
try {
|
2396
|
+
await onPlayable(steamClient);
|
2397
|
+
} catch (e) {}
|
2396
2398
|
}
|
2397
2399
|
} else {
|
2398
2400
|
if (typeof onNotPlayable === "function") {
|
2399
|
-
|
2401
|
+
try {
|
2402
|
+
await onNotPlayable(steamClient);
|
2403
|
+
} catch (e) {}
|
2400
2404
|
}
|
2401
2405
|
}
|
2402
2406
|
|
package/create_remote_file.js
CHANGED
@@ -1,55 +1,57 @@
|
|
1
|
-
import SteamUser from "./index.js";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
if(
|
21
|
-
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
|
50
|
-
}
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
1
|
+
import SteamUser from "./index.js";
|
2
|
+
import _ from "lodash";
|
3
|
+
|
4
|
+
(async function () {
|
5
|
+
const xx = SteamUser;
|
6
|
+
|
7
|
+
let json = "";
|
8
|
+
|
9
|
+
function doWrite(user, is_static) {
|
10
|
+
for (const methodName of Object.getOwnPropertyNames(user)) {
|
11
|
+
if (methodName === "constructor" || methodName === "length" || methodName === "name" || methodName === "prototype" || methodName === "RequestXML_TooManyRequests" || methodName === "MAX_RETRY") {
|
12
|
+
continue;
|
13
|
+
}
|
14
|
+
const fnString = user[methodName].toString().trim();
|
15
|
+
const async = "async";
|
16
|
+
// const async = fnString.startsWith("async") ? "async" : "";
|
17
|
+
let params = fnString.split("(")[1].split(")")[0];
|
18
|
+
const paramsList = params.split(",");
|
19
|
+
for (let i = 0; i < paramsList.length; i++) {
|
20
|
+
if (paramsList[i].includes("=")) {
|
21
|
+
paramsList[i] = paramsList[i].split("=")[0].trim();
|
22
|
+
}
|
23
|
+
}
|
24
|
+
params = paramsList.join(", ").trim();
|
25
|
+
if (params.startsWith("{") && !params.endsWith("}")) {
|
26
|
+
params = `${params}}`;
|
27
|
+
}
|
28
|
+
|
29
|
+
json += `${`
|
30
|
+
${is_static ? "static " : ""} ${async} ${methodName}(${params}){
|
31
|
+
const __params = [${params}];
|
32
|
+
if(__params.length === 1 && __params[0] === undefined){
|
33
|
+
__params.length = 0
|
34
|
+
}
|
35
|
+
|
36
|
+
try {
|
37
|
+
const result = (
|
38
|
+
await axios.post(getAppURL(), {
|
39
|
+
method: "${methodName}",
|
40
|
+
params: __params,
|
41
|
+
cookies: this._cookies,
|
42
|
+
is_static: ${!!is_static}
|
43
|
+
})
|
44
|
+
).data?.result;
|
45
|
+
return result
|
46
|
+
} catch (e) {
|
47
|
+
/* empty */
|
48
|
+
}
|
49
|
+
}`.trim()}\n`;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
doWrite(SteamUser.prototype, false);
|
54
|
+
doWrite(SteamUser, true);
|
55
|
+
|
56
|
+
console.log("");
|
57
|
+
})();
|