steamutils 1.4.54 → 1.4.56

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 +17 -42
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -1994,43 +1994,14 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
1994
1994
 
1995
1995
  function doFakeGameScore() {
1996
1996
  const maxRound = Math.random() > 0.7 ? 16 : 12;
1997
- const maps = [
1998
- "ar_baggage",
1999
- "ar_dizzy",
2000
- "ar_monastery",
2001
- "ar_shoots",
2002
- "cs_agency",
2003
- "cs_assault",
2004
- "cs_italy",
2005
- "cs_militia",
2006
- "cs_office",
2007
- "de_ancient",
2008
- "de_anubis",
2009
- "de_bank",
2010
- "de_boyard",
2011
- "de_cache",
2012
- "de_canals",
2013
- "de_cbble",
2014
- "de_chalice",
2015
- "de_dust2",
2016
- "de_inferno",
2017
- "de_lake",
2018
- "de_mirage",
2019
- "de_nuke",
2020
- "de_overpass",
2021
- "de_safehouse",
2022
- // "de_shortnuke",
2023
- "de_stmarc",
2024
- "de_sugarcane",
2025
- "de_train",
2026
- "de_tuscan",
2027
- "de_vertigo",
2028
- "dz_ember",
2029
- "dz_vineyard",
2030
- "gd_cbble",
2031
- "training1",
2032
- ];
1997
+ const maps = ["cs_agency", "cs_assault", "cs_italy", "cs_militia", "cs_office", "de_ancient", "de_anubis", "de_bank", "de_boyard", "de_cache", "de_canals", "de_cbble", "de_chalice", "de_dust2", "de_inferno", "de_lake", "de_mirage", "de_nuke", "de_overpass", "de_safehouse", "de_sugarcane", "de_train", "de_tuscan", "de_vertigo", "de_thera", "de_mills", "de_memento", "de_assembly", "training1"];
2033
1998
 
1999
+ if (richPresence.numPlayers === undefined) {
2000
+ richPresence.numPlayers = (Math.floor(Math.random() * 5) + 1).toString();
2001
+ }
2002
+ if (richPresence.server === undefined) {
2003
+ richPresence.server = Math.random() > 0.7 ? "community" : "kv";
2004
+ }
2034
2005
  if (richPresence.myScore === undefined) {
2035
2006
  richPresence.myScore = _.random(0, maxRound);
2036
2007
  }
@@ -2044,6 +2015,8 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
2044
2015
  richPresence.myScore = 0;
2045
2016
  richPresence.theirScore = 0;
2046
2017
  richPresence.map = maps[Math.floor(Math.random() * maps.length)];
2018
+ richPresence.numPlayers = (Math.floor(Math.random() * 5) + 1).toString();
2019
+ richPresence.server = Math.random() > 0.7 ? "community" : "kv";
2047
2020
  } else {
2048
2021
  const isMyTeamWin = Math.random() > 0.5;
2049
2022
  if (isMyTeamWin) {
@@ -2055,21 +2028,23 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
2055
2028
 
2056
2029
  const score = richPresence.myScore === 0 && richPresence.theirScore === 0 ? "" : `[ ${richPresence.myScore} : ${richPresence.theirScore} ]`;
2057
2030
  steamClient.uploadRichPresence(730, {
2058
- "game:state": "game",
2059
- steam_display: "#display_GameKnownMapScore",
2031
+ "game:state": "game", //lobby
2032
+ steam_display: "#display_GameKnownMapScore", //#DISPLAY_In_Lobby, #display_GameKnownMapScoreFlags
2060
2033
  // connect: "+gcconnectG082AA752",
2061
2034
  version: CSGO_VER.toString(),
2062
- "game:mode": "competitive",
2035
+ "game:mode": "competitive", //competitive,deathmatch,casual
2063
2036
  "game:map": richPresence.map,
2064
- "game:server": "kv",
2037
+ "game:server": richPresence.server, //offline
2065
2038
  // watch: Math.random() > 0.95 ? _.random(1, 5).toString() : null,
2066
- "game:score": score,
2039
+ "game:score": score.toString(),
2040
+ "members:numPlayers": richPresence.numPlayers, //generate a random number between 1 and 5
2041
+ "members:numSlots": "10",
2067
2042
  });
2068
2043
  }
2069
2044
 
2070
2045
  function updateFakeGameScore() {
2071
2046
  if (isFakeGameScore && getPlayingAppIds().some((a) => a == 730)) {
2072
- doSetInterval(doFakeGameScore, [60000, 180000], "uploadRichPresenceCSGO");
2047
+ doSetInterval(doFakeGameScore, [120000, 180000], "uploadRichPresenceCSGO");
2073
2048
  } else {
2074
2049
  doClearInterval("uploadRichPresenceCSGO");
2075
2050
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.4.54",
3
+ "version": "1.4.56",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.6",