steamutils 1.0.35 → 1.0.37
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/steamutils.iml +1 -1
- package/.idea/vcs.xml +1 -1
- package/SteamClient.js +10 -6
- package/package.json +1 -1
- package/.idea/jsLibraryMappings.xml +0 -6
package/.idea/steamutils.iml
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
<module type="WEB_MODULE" version="4">
|
3
3
|
<component name="NewModuleRootManager">
|
4
4
|
<content url="file://$MODULE_DIR$">
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
6
5
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
7
7
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
8
8
|
</content>
|
9
9
|
<orderEntry type="inheritedJdk" />
|
package/.idea/vcs.xml
CHANGED
package/SteamClient.js
CHANGED
@@ -9,7 +9,7 @@ import helpers from "./helpers/protos.js";
|
|
9
9
|
import {fileURLToPath} from "url";
|
10
10
|
import path from "path";
|
11
11
|
import SteamUtils from "./index.js";
|
12
|
-
import {
|
12
|
+
import {v4 as uuidv4} from 'uuid';
|
13
13
|
|
14
14
|
const __filename = fileURLToPath(import.meta.url);
|
15
15
|
const __dirname = path.dirname(__filename);
|
@@ -101,8 +101,9 @@ function SteamClient({
|
|
101
101
|
}
|
102
102
|
|
103
103
|
const intervals = {}
|
104
|
+
|
104
105
|
function doSetInterval(cb, timeout, key) {
|
105
|
-
if(!key){
|
106
|
+
if (!key) {
|
106
107
|
key = uuidv4()
|
107
108
|
}
|
108
109
|
if (intervals[key] !== undefined) {
|
@@ -183,20 +184,23 @@ function SteamClient({
|
|
183
184
|
* @returns {Promise.<Object>}
|
184
185
|
*/
|
185
186
|
async function partySearch({
|
186
|
-
prime = false,
|
187
|
+
prime = false,
|
188
|
+
game_type = 'Competitive',
|
189
|
+
rank = 'Silver Elite',
|
190
|
+
timeout = 10000,
|
187
191
|
}) {
|
188
192
|
|
189
193
|
return new Promise(resolve => {
|
190
194
|
steamClient.sendToGC(appid, Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Party_Search, {}, protoEncode(Protos.csgo.CMsgGCCStrike15_v2_Party_Search, {
|
191
195
|
ver: CSGO_VER,
|
192
196
|
apr: prime ? 1 : 0,
|
193
|
-
ark: Object.keys(RANKS).find(k => RANKS[k] === rank) * 10,
|
197
|
+
ark: parseInt(Object.keys(RANKS).find(k => RANKS[k] === rank)) * 10,
|
194
198
|
grps: [],
|
195
199
|
launcher: 0,
|
196
200
|
game_type: game_type === 'Competitive' ? 8 : 10
|
197
201
|
}))
|
198
202
|
partySearchCallback.push(resolve)
|
199
|
-
setTimeout(resolve,
|
203
|
+
setTimeout(resolve, timeout)
|
200
204
|
})
|
201
205
|
}
|
202
206
|
|
@@ -812,7 +816,7 @@ function SteamClient({
|
|
812
816
|
playCSGO,
|
813
817
|
doSetInterval,
|
814
818
|
doClearIntervals,
|
815
|
-
async gamesPlayed(apps){
|
819
|
+
async gamesPlayed(apps) {
|
816
820
|
steamClient.gamesPlayed(apps);
|
817
821
|
await sleep(2000)
|
818
822
|
steamClient.setPersona(SteamUser.EPersonaState.LookingToPlay)
|
package/package.json
CHANGED