steamutils 1.3.27 → 1.3.28

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.
Files changed (2) hide show
  1. package/SteamClient.js +28 -3
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -345,7 +345,22 @@ function SteamClient({
345
345
  }
346
346
 
347
347
  async function gamePlay() {
348
- gamesPlayed(730)
348
+ let ownedApps = []
349
+ for (let i = 0; i < 5; i++) {
350
+ ownedApps = await getUserOwnedApps()
351
+ if (ownedApps?.length) {
352
+ break
353
+ }
354
+ }
355
+ if (!ownedApps?.length) {
356
+ gamesPlayed(730)
357
+ } else {
358
+ ownedApps = ownedApps.map(({appid}) => appid)
359
+ ownedApps = _.shuffle(ownedApps)
360
+ ownedApps.length = Math.min(ownedApps.length, MAX_GAME_PLAY - 1)
361
+ _.remove(ownedApps, app => app == 730)
362
+ gamesPlayed([...ownedApps, 730])
363
+ }
349
364
  }
350
365
 
351
366
  async function autoGamePlay() {
@@ -410,7 +425,10 @@ function SteamClient({
410
425
  }
411
426
 
412
427
  async function createLobby() {
413
- console.log("createLobby");
428
+ if (!steamClient.steamID) {
429
+ return
430
+ }
431
+
414
432
  steamClient._send(
415
433
  {
416
434
  msg: Protos.csgo.EMsg.k_EMsgClientMMSCreateLobby,
@@ -453,7 +471,10 @@ function SteamClient({
453
471
  }
454
472
 
455
473
  async function updateLobby(lobbyID) {
456
- console.log("updateLobby", lobbyID);
474
+ if (!steamClient.steamID) {
475
+ return
476
+ }
477
+
457
478
  steamClient._send(
458
479
  {
459
480
  msg: Protos.csgo.EMsg.k_EMsgClientMMSSetLobbyData,
@@ -504,6 +525,10 @@ function SteamClient({
504
525
  }
505
526
 
506
527
  async function invite2Lobby(lobbyID, steamId) {
528
+ if (!steamClient.steamID) {
529
+ return
530
+ }
531
+
507
532
  steamClient._send(
508
533
  {
509
534
  msg: Protos.csgo.EMsg.k_EMsgClientMMSInviteToLobby,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.3.27",
3
+ "version": "1.3.28",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.5",