steamutils 1.3.31 → 1.3.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/SteamClient.js +22 -6
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -95,13 +95,14 @@ function SteamClient({
95
95
  isFakeGameScore = true,
96
96
  isPartyRegister = true,
97
97
  isAutoPlay = false,
98
+ isInvisible = false,
98
99
  autoAcceptTradeRequest = false,
99
100
  autoReconnect = true,
100
101
  MAX_GAME_PLAY = 10
101
102
  }) {
102
103
  const steamClient = new SteamUser()
103
104
  let prime = null
104
- let state = 'Offline'//InGame, Online
105
+ let state = 'Offline'//InGame, Online, Invisible
105
106
  let isLogOff = false
106
107
  let playingBlocked = null
107
108
  const richPresence = {}
@@ -1134,10 +1135,8 @@ function SteamClient({
1134
1135
  }
1135
1136
  },
1136
1137
  async loggedOn(loggedOnResponse) {
1137
- steamClient.setPersona(SteamUser.EPersonaState.Online)
1138
- state = 'Online'
1139
- await sendHello()
1140
1138
  callEvent(events.loggedOn, loggedOnResponse)
1139
+ updateInvisible()
1141
1140
  updateAutoRequestFreeLicense()
1142
1141
  updateAutoGamePlay()
1143
1142
  },
@@ -1607,11 +1606,11 @@ function SteamClient({
1607
1606
 
1608
1607
  steamClient._handlerManager.add(5480, function (payload) {
1609
1608
  const result = protoDecode(Protos.csgo.CMsgClientRequestedClientStats, payload.toBuffer())
1610
- console.log("CMsgClientRequestedClientStats", result);
1609
+ // console.log("CMsgClientRequestedClientStats", result);
1611
1610
  })
1612
1611
  steamClient._handlerManager.add(6612, function (payload) {
1613
1612
  const result = protoDecode(Protos.csgo.CMsgClientMMSLobbyData, payload.toBuffer())
1614
- console.log("CMsgClientMMSLobbyData", result);
1613
+ // console.log("CMsgClientMMSLobbyData", result);
1615
1614
  })
1616
1615
  }
1617
1616
 
@@ -1812,6 +1811,16 @@ function SteamClient({
1812
1811
  }
1813
1812
  }
1814
1813
 
1814
+ function updateInvisible() {
1815
+ if (isInvisible) {
1816
+ steamClient.setPersona(SteamUser.EPersonaState.Invisible)
1817
+ state = 'Invisible'
1818
+ } else {
1819
+ steamClient.setPersona(SteamUser.EPersonaState.Online)
1820
+ state = 'Online'
1821
+ }
1822
+ }
1823
+
1815
1824
  async function gamesPlayed(apps) {
1816
1825
  if (!Array.isArray(apps)) {
1817
1826
  apps = [apps]
@@ -2003,6 +2012,13 @@ function SteamClient({
2003
2012
  updateAutoGamePlay()
2004
2013
  }
2005
2014
  },
2015
+ setIsInvisible(change) {
2016
+ change = !!change
2017
+ if (isInvisible !== change) {
2018
+ isInvisible = change
2019
+ updateInvisible()
2020
+ }
2021
+ },
2006
2022
  setFakeGameScore(change) {
2007
2023
  change = !!change
2008
2024
  if (isFakeGameScore !== change) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.3.31",
3
+ "version": "1.3.32",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.5",