steamutils 1.4.56 → 1.4.57
Sign up to get free protection for your applications and to get access to all the features.
- package/SteamClient.js +20 -11
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -30,6 +30,7 @@ export const RANKS = {
|
|
30
30
|
17: "Supreme Master First Class",
|
31
31
|
18: "The Global Elite",
|
32
32
|
};
|
33
|
+
|
33
34
|
export const LOCS = {
|
34
35
|
20054: "VN",
|
35
36
|
23115: "KZ",
|
@@ -390,15 +391,23 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
390
391
|
|
391
392
|
/**
|
392
393
|
* Get a list of lobbies (* = Unsure description could be wrong)
|
393
|
-
* @param {
|
394
|
-
* @param {
|
395
|
-
* @param {
|
396
|
-
* @param {
|
397
|
-
* @
|
398
|
-
* @param {Number} game_type Game type, 8 Competitive, 10 Wingman
|
399
|
-
* @returns {Promise.<Object>}
|
394
|
+
* @param {Boolean} prime
|
395
|
+
* @param {Number|String} rank
|
396
|
+
* @param {Competitive|Wingman|Premier} game_type
|
397
|
+
* @param {Number} timeout
|
398
|
+
* @returns {Promise.<Array>}
|
400
399
|
*/
|
401
|
-
async function partySearch({ prime = false, game_type = "
|
400
|
+
async function partySearch({ prime = false, game_type = "Premier", rank, timeout = 5000 } = {}) {
|
401
|
+
const gameTypeMap = {
|
402
|
+
Competitive: 8,
|
403
|
+
Wingman: 10,
|
404
|
+
Premier: 11,
|
405
|
+
};
|
406
|
+
|
407
|
+
if (typeof rank === "string") {
|
408
|
+
rank = parseInt(Object.keys(RANKS).find((k) => RANKS[k] === rank)) * 10;
|
409
|
+
}
|
410
|
+
|
402
411
|
const players = await new Promise((resolve) => {
|
403
412
|
steamClient.sendToGC(
|
404
413
|
AppID,
|
@@ -407,10 +416,10 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
|
|
407
416
|
new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_Party_Search).protoEncode({
|
408
417
|
ver: CSGO_VER,
|
409
418
|
apr: prime ? 1 : 0,
|
410
|
-
ark:
|
419
|
+
ark: rank,
|
411
420
|
grps: [],
|
412
|
-
launcher: 0,
|
413
|
-
game_type: game_type
|
421
|
+
launcher: 0, // If we are using the China CSGO launcher or not*
|
422
|
+
game_type: gameTypeMap[game_type],
|
414
423
|
}),
|
415
424
|
);
|
416
425
|
lastTimePartySearch = Date.now();
|