steamutils 1.4.18 → 1.4.20
Sign up to get free protection for your applications and to get access to all the features.
- package/.idea/git_toolbox_blame.xml +6 -0
- package/SteamClient.js +25 -1
- package/package.json +1 -1
- package/test_steamclient.js +49 -49
package/SteamClient.js
CHANGED
@@ -129,6 +129,7 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
129
129
|
playingState: [],
|
130
130
|
emailInfo: [],
|
131
131
|
accountLimitations: [],
|
132
|
+
wallet: [],
|
132
133
|
};
|
133
134
|
|
134
135
|
const gcCallback = {};
|
@@ -1382,7 +1383,7 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
1382
1383
|
}
|
1383
1384
|
if (playing_blocked) {
|
1384
1385
|
//true, false
|
1385
|
-
|
1386
|
+
log("Playing else where");
|
1386
1387
|
}
|
1387
1388
|
log("playingState", playing_blocked, playing_app);
|
1388
1389
|
callEvent(events.playingState, { playing_blocked, playing_app });
|
@@ -1460,6 +1461,13 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
1460
1461
|
canInviteFriends: bis_limited_account_allowed_to_invite_friends,
|
1461
1462
|
});
|
1462
1463
|
},
|
1464
|
+
async wallet(hasWallet, currency, balance) {
|
1465
|
+
callEvent(events.wallet, {
|
1466
|
+
hasWallet: hasWallet,
|
1467
|
+
currency: currency,
|
1468
|
+
balance: balance,
|
1469
|
+
});
|
1470
|
+
},
|
1463
1471
|
};
|
1464
1472
|
|
1465
1473
|
const _chatEvents = {
|
@@ -2237,6 +2245,21 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
2237
2245
|
});
|
2238
2246
|
}
|
2239
2247
|
|
2248
|
+
function acknowledgePenalty() {
|
2249
|
+
steamClient._send(
|
2250
|
+
{
|
2251
|
+
msg: Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_AcknowledgePenalty,
|
2252
|
+
proto: {
|
2253
|
+
steamid: steamClient.steamID.getSteamID64(),
|
2254
|
+
routing_appid: 730,
|
2255
|
+
},
|
2256
|
+
},
|
2257
|
+
protoEncode(Protos.csgo.CMsgGCCStrike15_v2_AcknowledgePenalty, {
|
2258
|
+
acknowledged: 1,
|
2259
|
+
}),
|
2260
|
+
);
|
2261
|
+
}
|
2262
|
+
|
2240
2263
|
return {
|
2241
2264
|
init,
|
2242
2265
|
partySearch,
|
@@ -2441,6 +2464,7 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
2441
2464
|
},
|
2442
2465
|
redeemFreeReward,
|
2443
2466
|
requestJoinFriendData,
|
2467
|
+
acknowledgePenalty,
|
2444
2468
|
};
|
2445
2469
|
}
|
2446
2470
|
|
package/package.json
CHANGED
package/test_steamclient.js
CHANGED
@@ -1,49 +1,49 @@
|
|
1
|
-
import SteamUser from "./index.js";
|
2
|
-
import axios from "axios";
|
3
|
-
import * as cherrio from "cheerio";
|
4
|
-
import SteamClient from "./SteamClient.js";
|
5
|
-
import { sleep } from "./utils.js";
|
6
|
-
import SteamID from "steamid";
|
7
|
-
|
8
|
-
(async function () {
|
9
|
-
// const loginResult = await SteamUser.communityLogin({
|
10
|
-
// username: "abc",
|
11
|
-
// password: "xyz",
|
12
|
-
// })
|
13
|
-
// console.log(loginResult.cookie);
|
14
|
-
// const user = new SteamUser(loginResult.cookie)
|
15
|
-
|
16
|
-
const cookie = "";
|
17
|
-
const steamClient = new SteamClient({
|
18
|
-
cookie,
|
19
|
-
isAutoPlay: true,
|
20
|
-
isPartyRegister: false,
|
21
|
-
});
|
22
|
-
let redeemFreeReward = false;
|
23
|
-
steamClient.onEvent("csgoOnline", async function (data) {
|
24
|
-
const personalStore = data.personalStore;
|
25
|
-
if (!personalStore) return;
|
26
|
-
const example = {
|
27
|
-
items: [38468732624, 38468732625, 38468732626, 38468732627],
|
28
|
-
generation_time: 1719374753000,
|
29
|
-
redeemable_balance: 2,
|
30
|
-
};
|
31
|
-
|
32
|
-
console.log(personalStore.items);
|
33
|
-
console.log(personalStore.redeemable_balance);
|
34
|
-
if (!redeemFreeReward) {
|
35
|
-
redeemFreeReward = true;
|
36
|
-
|
37
|
-
let itemid = 38468732624;
|
38
|
-
// itemid = SteamID.fromIndividualAccountID(itemid).getSteamID64();
|
39
|
-
await steamClient.redeemFreeReward([itemid]);
|
40
|
-
await sleep(5000);
|
41
|
-
steamClient.offAutoGamePlay();
|
42
|
-
await sleep(1000);
|
43
|
-
steamClient.autoGamePlay();
|
44
|
-
} else {
|
45
|
-
process.exit(1);
|
46
|
-
}
|
47
|
-
});
|
48
|
-
steamClient.init();
|
49
|
-
})();
|
1
|
+
import SteamUser from "./index.js";
|
2
|
+
import axios from "axios";
|
3
|
+
import * as cherrio from "cheerio";
|
4
|
+
import SteamClient from "./SteamClient.js";
|
5
|
+
import { sleep } from "./utils.js";
|
6
|
+
import SteamID from "steamid";
|
7
|
+
|
8
|
+
(async function () {
|
9
|
+
// const loginResult = await SteamUser.communityLogin({
|
10
|
+
// username: "abc",
|
11
|
+
// password: "xyz",
|
12
|
+
// })
|
13
|
+
// console.log(loginResult.cookie);
|
14
|
+
// const user = new SteamUser(loginResult.cookie)
|
15
|
+
|
16
|
+
const cookie = "";
|
17
|
+
const steamClient = new SteamClient({
|
18
|
+
cookie,
|
19
|
+
isAutoPlay: true,
|
20
|
+
isPartyRegister: false,
|
21
|
+
});
|
22
|
+
let redeemFreeReward = false;
|
23
|
+
steamClient.onEvent("csgoOnline", async function (data) {
|
24
|
+
const personalStore = data.personalStore;
|
25
|
+
if (!personalStore) return;
|
26
|
+
const example = {
|
27
|
+
items: [38468732624, 38468732625, 38468732626, 38468732627],
|
28
|
+
generation_time: 1719374753000,
|
29
|
+
redeemable_balance: 2,
|
30
|
+
};
|
31
|
+
|
32
|
+
console.log(personalStore.items);
|
33
|
+
console.log(personalStore.redeemable_balance);
|
34
|
+
if (!redeemFreeReward) {
|
35
|
+
redeemFreeReward = true;
|
36
|
+
|
37
|
+
let itemid = 38468732624;
|
38
|
+
// itemid = SteamID.fromIndividualAccountID(itemid).getSteamID64();
|
39
|
+
await steamClient.redeemFreeReward([itemid]);
|
40
|
+
await sleep(5000);
|
41
|
+
steamClient.offAutoGamePlay();
|
42
|
+
await sleep(1000);
|
43
|
+
steamClient.autoGamePlay();
|
44
|
+
} else {
|
45
|
+
process.exit(1);
|
46
|
+
}
|
47
|
+
});
|
48
|
+
steamClient.init();
|
49
|
+
})();
|