steamutils 1.3.42 → 1.3.44

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
4
+ <serverData>
5
+ <paths name="botnatridiscord">
6
+ <serverdata>
7
+ <mappings>
8
+ <mapping local="$PROJECT_DIR$" web="/" />
9
+ </mappings>
10
+ </serverdata>
11
+ </paths>
12
+ </serverData>
13
+ </component>
14
+ </project>
package/SteamClient.js CHANGED
@@ -97,7 +97,8 @@ function SteamClient({
97
97
  isInvisible = false,
98
98
  autoAcceptTradeRequest = false,
99
99
  autoReconnect = true,
100
- MAX_GAME_PLAY = 10
100
+ MAX_GAME_PLAY = 10,
101
+ games = null
101
102
  }) {
102
103
  const steamClient = new NodeSteamUser()
103
104
  let prime = null
@@ -367,6 +368,10 @@ function SteamClient({
367
368
  }
368
369
 
369
370
  async function gamePlay() {
371
+ if ((Array.isArray(games) && games.length) || (games && (typeof games === "number" || typeof games === "string"))) {
372
+ return gamesPlayed(games)
373
+ }
374
+
370
375
  let ownedApps = []
371
376
  for (let i = 0; i < 5; i++) {
372
377
  ownedApps = await getUserOwnedApps()
@@ -591,7 +596,7 @@ function SteamClient({
591
596
  return
592
597
  }
593
598
 
594
- if(!Array.isArray(steamIds)){
599
+ if (!Array.isArray(steamIds)) {
595
600
  steamIds = [steamIds]
596
601
  }
597
602
 
@@ -605,7 +610,7 @@ function SteamClient({
605
610
 
606
611
  for (const steamId of steamIds) {
607
612
  onInvite?.(lobbyID, steamId)
608
- await invite2Lobby(lobbyID, steamId)
613
+ await invite2Lobby(lobbyID, steamId)
609
614
  }
610
615
 
611
616
  return lobbyID
@@ -784,7 +789,7 @@ function SteamClient({
784
789
  errorStr = `Unknown: ${e.eresult}`
785
790
  break
786
791
  }
787
- log('error', e?.message)
792
+ log(`error [isLogOff: ${isLogOff}]`, e?.message)
788
793
  doClearIntervals()
789
794
  callEvent(events.error, {eresult: e.eresult, msg: e.message, error: errorStr})
790
795
  },
@@ -1954,9 +1959,15 @@ function SteamClient({
1954
1959
  }
1955
1960
 
1956
1961
  steamClient.gamesPlayed(apps);
1957
- await sleep(2000)
1958
- // steamClient.setPersona(NodeSteamUser.EPersonaState.Online)
1959
- await sendHello()
1962
+ const shouldHello = apps.some(app => parseInt(app) === 730);
1963
+ await sleep(1000)
1964
+ if (shouldHello) {
1965
+ await sendHello()
1966
+ }
1967
+ await sleep(1000)
1968
+ if (shouldHello) {
1969
+ await sendHello()
1970
+ }
1960
1971
  updateFakeGameScore()
1961
1972
 
1962
1973
  // await sleep(10000)
@@ -2256,7 +2267,7 @@ function SteamClient({
2256
2267
  },
2257
2268
  getUserOwnedApps,
2258
2269
  getPlayingAppIds,
2259
- getCurrentLobby(){
2270
+ getCurrentLobby() {
2260
2271
  return currentLobby
2261
2272
  }
2262
2273
  }
@@ -2268,19 +2279,20 @@ export function increaseCSGO_VER() {
2268
2279
  return ++CSGO_VER
2269
2280
  }
2270
2281
 
2271
- SteamClient.isAccountPlayable = function isAccountPlayable(cookie, timeoutMs) {
2282
+ SteamClient.isAccountPlayable = function isAccountPlayable(params, timeoutMs) {
2272
2283
  return new Promise((resolve) => {
2273
2284
  const timeout = setTimeout(() => {
2274
2285
  doResolve();
2275
2286
  }, timeoutMs || 30000);
2276
2287
 
2277
2288
  const steamClient = new SteamClient({
2278
- cookie,
2279
2289
  isFakeGameScore: false,
2280
2290
  isAutoPlay: true,
2281
2291
  isPartyRegister: false,
2282
2292
  isInvisible: false,
2283
2293
  MAX_GAME_PLAY: 10,
2294
+ games: 730,
2295
+ ...params,
2284
2296
  });
2285
2297
 
2286
2298
  steamClient.onEvent("error", ({eresult, msg, error}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.3.42",
3
+ "version": "1.3.44",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.5",