steamutils 1.4.58 → 1.4.59

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 +32 -5
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -1994,11 +1994,38 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
1994
1994
  }
1995
1995
 
1996
1996
  async function playCSGO() {
1997
- try {
1998
- await steamClient.requestFreeLicense(AppID);
1999
- await sleep(5000);
2000
- } catch (e) {}
2001
- gamesPlayed(AppID);
1997
+ games = 730;
1998
+ isInvisible = false;
1999
+ isAutoPlay = true;
2000
+ isPartyRegister = false;
2001
+ const online = await new Promise((resolve) => {
2002
+ onEvent(
2003
+ SteamClientEvents.csgoOnline,
2004
+ function () {
2005
+ resolve(true);
2006
+ },
2007
+ true,
2008
+ );
2009
+ onEvent(
2010
+ SteamClientEvents.error,
2011
+ function () {
2012
+ resolve(false);
2013
+ },
2014
+ true,
2015
+ );
2016
+ onEvent(
2017
+ SteamClientEvents.playingState,
2018
+ function ({ playing_blocked, playing_app }) {
2019
+ if (playing_blocked) {
2020
+ resolve(false);
2021
+ }
2022
+ },
2023
+ true,
2024
+ );
2025
+ init();
2026
+ });
2027
+ steamClient.offAllEvent();
2028
+ return online;
2002
2029
  }
2003
2030
 
2004
2031
  function doFakeGameScore() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.4.58",
3
+ "version": "1.4.59",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.6",