From a3b2947f720878f639ba186040555b3e4ff5a86c Mon Sep 17 00:00:00 2001 From: iNilo Date: Thu, 3 Mar 2022 14:40:13 +0100 Subject: [PATCH 1/6] Method to ask the GC for MM stats (data is in accountData) --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index eaee9e3..320e894 100644 --- a/index.js +++ b/index.js @@ -175,6 +175,10 @@ GlobalOffensive.prototype.requestGame = function(shareCodeOrDetails) { }); }; +GlobalOffensive.prototype.requestMatchmakingStats = function() { + this._send(Language.MatchmakingClient2GCHello, Protos.CMsgGCCStrike15_v2_MatchmakingClient2GCHello , {}); +}; + GlobalOffensive.prototype.requestLiveGames = function() { this._send(Language.MatchListRequestCurrentLiveGames, Protos.CMsgGCCStrike15_v2_MatchListRequestCurrentLiveGames, {}); }; From a3561221f94388da30092b299a3dab0512bde7e2 Mon Sep 17 00:00:00 2001 From: iNilo Date: Thu, 3 Mar 2022 14:45:18 +0100 Subject: [PATCH 2/6] Documentation for requestMatchmakingStats() --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c012407..f08fc37 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,11 @@ When instantiating your node-globaloffensive instance, you need to pass your act var csgo = new GlobalOffensive(steamClient); ``` +### requestMatchmakingStats() + +Requests the GC for matchmaking data. +Listen for the `accountData` event to get your response or access the accountData propery after `accountData` was emitted + ### requestGame(shareCodeOrDetails) - `shareCodeOrDetails` - Either a share code as a string, or an object containing properties `matchId`, `outcomeId`, `token` From 5ec3fb149829629fd43d909e1c6a957c733f1d9e Mon Sep 17 00:00:00 2001 From: iNilo Date: Thu, 3 Mar 2022 14:47:31 +0100 Subject: [PATCH 3/6] Anchor to documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f08fc37..55bfc7c 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ var csgo = new GlobalOffensive(steamClient); ### requestMatchmakingStats() Requests the GC for matchmaking data. -Listen for the `accountData` event to get your response or access the accountData propery after `accountData` was emitted +Listen for the `accountData` event to get your response or access the [accountData](#accountdata) propery after `accountData` was emitted ### requestGame(shareCodeOrDetails) - `shareCodeOrDetails` - Either a share code as a string, or an object containing properties `matchId`, `outcomeId`, `token` From 3d08d7e8b7face9c579076a6919e9bd123b753c6 Mon Sep 17 00:00:00 2001 From: iNilo Date: Thu, 3 Mar 2022 14:59:28 +0100 Subject: [PATCH 4/6] Document the entire accountData array --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/README.md b/README.md index 55bfc7c..a2f96d0 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,54 @@ There are a few useful read-only properties available to you. A big object containing account data and some statistics including players in-game. Undefined until `accountData` is emitted. +- `my_current_event_teams` - Always an empty array? +- `my_current_event_stages` - Always an empty array? +- `rankings` - Always an empty array? +- `account_id` +- `ongoingmatch` +- `global_stats` + - `search_statistics` - Array of MM queues with info + - `game_type` + - `search_time_avg` - Always `null`? + - `players_searching` + - `players_online` + - `servers_online` + - `players_searching` + - `servers_available` + - `ongoing_matches` + - `search_time_avg` + - `main_post_url` + - `required_appid_version` + - `pricesheet_version"` + - `twitch_streams_version` + - `active_tournament_eventid` + - `active_survey_id"` + - `rtime32_cur` + - `rtime32_event_start` +- `penalty_seconds` +- `penalty_reason` +- `vac_banned` +- `ranking` + - `account_id` + - `rank_id` + - `wins` + - `rank_change` + - `rank_type_id` + - `tv_control` +- `commendation` + - `cmd_friendly` + - `cmd_teaching` + - `cmd_leader` +- `medals` +- `my_current_event` +- `my_current_team` +- `survey_vote` +- `activity` +- `player_level` +- `player_cur_xp` +- `player_xp_bonus_flags` + + ### inventory An array containing the items in your inventory. Undefined until `connectedToGC` is emitted. From 5afbae050951d0434098dadb0d05de59ef0c587a Mon Sep 17 00:00:00 2001 From: iNilo Date: Thu, 3 Mar 2022 15:01:44 +0100 Subject: [PATCH 5/6] Inform that we can request the GC to populate accountData --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a2f96d0..774befa 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ There are a few useful read-only properties available to you. ### accountData A big object containing account data and some statistics including players in-game. Undefined until `accountData` is emitted. +You can request this info to be populated by calling [requestMatchmakingStats()](#requestmatchmakingstats) - `my_current_event_teams` - Always an empty array? - `my_current_event_stages` - Always an empty array? From f49a15436e2e82eb12a406c285113e134ecbffbc Mon Sep 17 00:00:00 2001 From: iNilo Date: Thu, 3 Mar 2022 15:02:41 +0100 Subject: [PATCH 6/6] Forgot to remove some double quotes in documentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 774befa..f60c3db 100644 --- a/README.md +++ b/README.md @@ -71,10 +71,10 @@ You can request this info to be populated by calling [requestMatchmakingStats()] - `search_time_avg` - `main_post_url` - `required_appid_version` - - `pricesheet_version"` + - `pricesheet_version` - `twitch_streams_version` - `active_tournament_eventid` - - `active_survey_id"` + - `active_survey_id` - `rtime32_cur` - `rtime32_event_start` - `penalty_seconds`