需要幫助嗎?不要打開問題 - 在吉特室問。
用於反擊的節點式插件:全球進攻。
基於rjacksonm1的node-dota2
此列表越來越長。想上它嗎?在吉特(Gitter)上給我發消息,我們將交談。 -Joshuaferrara
參數:
steamUser
傳遞Steamuser實例以更改您的當前狀態(遊戲中/NOT)。steamGC
傳遞蒸汽加密歐洲式實例,用於發送和接收GC消息。debug
- 布爾值指出是否打印有關操作的信息。 var Steam = require ( 'steam' ) ,
steamClient = new Steam . SteamClient ( ) ,
steamUser = new Steam . SteamUser ( steamClient ) ,
steamGC = new Steam . SteamGameCoordinator ( steamClient , 730 ) ,
csgo = require ( 'csgo' ) ,
CSGO = new csgo . CSGOClient ( steamUser , steamGC , false ) ;
所有方法都需要登錄Steamclient實例。
launch()
向Steam報告說,您正在玩反擊:全球進攻,然後發起與遊戲協調員的交流。
exit()
告訴Steam您不玩CS:GO。
ToAccountID(steamId)
將64位Steam ID轉換為帳戶ID。
ToSteamID(accountId)
將帳戶ID轉換為64位Steam ID。
Rank.getString(int rank_id)
將整數rank_id轉換為字符串。例如: CSGO.Rank.getString(1) = "Silver I"
Level.getString(int player_level)
將整數player_level轉換為字符串。例如: CSGO.Level.getString(1) = "Recruit"
matchmakingStatsRequest()
向遊戲協調員發送一條消息,要求一些對接統計數據。收聽遊戲協調員的響應matchmakingStatsData
事件。要求GC準備就緒(在呼叫之前聆聽ready
事件)。
requestRecentGames()
請求目前已記錄的帳戶列出的最近遊戲列表。收聽遊戲協調員的響應的matchList
事件。
requestLiveGameForUser(accountId)
請求給定用戶當前的實時遊戲信息。收聽遊戲協調員的響應的matchList
事件。
requestGame(string matchid, string outcomeid, int token)
請求有關遊戲的信息,請求有關遊戲的匹配項,並為遊戲提供了令牌(提示:可以使用Sharecode解碼器找到這些信息)。收聽遊戲協調員的響應的matchList
事件。
requestWatchInfoFriends(arguments)
請求遊戲的可觀察信息。參數:
int request_id ; //Not enough tests yet
account_ids [ array_of_csgo_accounts ] ; //Not enough tests yet
long serverid ; //ServerID of match.
long matchid ; //MatchID of match.
例子:
CSGO . requestWatchInfoFriends ( {
serverid : new Long ( - 569600767 , - 2130640678 , true ) . toString ( ) ,
matchid : new Long ( 39 , 719230023 , true ) . toString ( )
} ) ;
要求:遊戲應該直播。
收聽遊戲協調員的響應的watchList
活動。
requestCurrentLiveGames()
請求當前現場遊戲列表。收聽遊戲協調員的響應的matchList
事件。
playerProfileRequest(accountId)
accountId
是播放器的帳戶ID(可以使用CSGO.ToAccountID(steamid)
將播放器的Steamid64轉換為帳戶ID)。
從遊戲協調員請求玩家的個人資料。玩家必須在線並玩CS:去。收聽遊戲協調員的響應的playerProfile
活動。
注意:您不能再將豐富的存在設置為任意字符串。相反,遊戲現在定義了可以顯示的最多20個豐富的存在值的列表。有關更多信息,請參見本文檔中的
SetRichPresence
方法。
richPresenceUpload(richPresenceObject)
為當前登錄的用戶設置豐富的存在對象。 Rich Stickent是Valve提供有關您在遊戲中所做的事情的信息的解決方案。例如,當您看到有關另一個朋友對接遊戲的信息(如地圖和得分)時,這是通過使用豐富的存在來設置的。可以在示例中找到如何使用此方法的示例。
itemDataRequest(string s, string a, string d, string m)
請求項目數據指定的CSGO項目檢查鏈接參數。當檢查鏈接來自庫存時,參數s
具有值。同樣,當檢查鏈接來自市場時,參數m
具有值。如果從檢查鏈接中沒有給定參數的值,請將其設置為"0"
。
收聽遊戲協調員響應的itemData
事件。
CSGO項目的庫存檢查鏈接的示例
// steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198084749846A6768147729D12557175561287951743
CSGO . itemDataRequest ( "76561198084749846" , "6768147729" , "12557175561287951743" , "0" ) ;
CSGO項目的市場檢查鏈接的示例
// steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20M563330426657599553A6710760926D9406593057029549017
CSGO . itemDataRequest ( "0" , "6710760926" , "9406593057029549017" , "563330426657599553" ) ;
new CSGO.SharecodeDecoder(string code);
實例化sharecodedecoder類以解碼共享。
調用SharecodeDecoder
的decode()
方法將返回帶有解碼信息的對象。
console . log ( new CSGO . SharecodeDecoder ( "CSGO-U6MWi-hYFWJ-opPwD-JciHm-qOijD" ) . decode ( ) )
{ matchId : '3106049990460440633' ,
outcomeId : '3106056003414655216' ,
tokenId : '11842' }
ready
當GC準備接收消息時發出。請注意不要在此處聲明匿名功能為事件處理程序,因為您需要能夠在unready
事件中使事件處理程序無效。
unready
當與GC的連接狀態更改並使庫無法進行交互時發出。您應該在此處的ready
事件”中清除任何事件處理程序,否則每次發送ready
事件時,您都會為每個消息提供多個處理程序。
exited
當.exit()
被稱為方便時,在有意退出時會發出。
itemData
( itemDataResponse
) {
"iteminfo" :
{
"accountid" : null ,
"itemid" : Long { "low" : - 1821786863 , "high" : 1 , "unsigned" : true } ,
"defindex" : 7 ,
"paintindex" : 474 ,
"rarity" : 6 ,
"quality" : 4 ,
"paintwear" : 1054492909 ,
"paintseed" : 183 ,
"killeaterscoretype" : null ,
"killeatervalue" : null ,
"customname" : null ,
"stickers" : [ ] ,
"inventory" : 3221225475 ,
"origin" : 8 ,
"questid" : null ,
"dropreason" : null ,
"floatvalue" : 0.4263376295566559
}
}
當遊戲協調員對itemDataRequest
方法響應時發出。
matchmakingStatsData
( matchmakingStatsResponse
)matchmakingStatsResponse
原始響應對象。下面的示例響應。 {
"account_id" : 137013074 ,
"ongoingmatch" : { // Only populated when logged in user is in a match
"serverid" : 90112014586923017 ,
"direct_udp_ip" : 2734604850 ,
"direct_udp_port" : 27035 ,
"reservationid" : 18374688715512210549 ,
"reservation" : {
"game_type" : 520 ,
"match_id" : 3245263802660290728 ,
"tournament_event" : null ,
"pre_match_data" : null
} ,
"map" : "de_dust2" ,
"server_address" : "=[A:1:153428969:9318]:0"
} ,
"global_stats" : {
"players_online" : 423480 ,
"servers_online" : 132472 ,
"players_searching" : 4212 ,
"servers_available" : 65497 ,
"ongoing_matches" : 17016 ,
"search_time_avg" : 46530 ,
"search_statistics" : [
{
"game_type" : 264 ,
"search_time_avg" : 128555 ,
"players_searching" : 148
} ,
{
"game_type" : 520 ,
"search_time_avg" : 31962 ,
"players_searching" : 1768
} ,
{
"game_type" : 1032 ,
"search_time_avg" : 122353 ,
"players_searching" : 426
} ,
{
"game_type" : 2056 ,
"search_time_avg" : 136133 ,
"players_searching" : 160
} ,
{
"game_type" : 4104 ,
"search_time_avg" : 62643 ,
"players_searching" : 1069
} ,
{
"game_type" : 8200 ,
"search_time_avg" : 70380 ,
"players_searching" : 563
} ,
{
"game_type" : 16392 ,
"search_time_avg" : 115923 ,
"players_searching" : 132
} ,
{
"game_type" : 32776 ,
"search_time_avg" : 54906 ,
"players_searching" : 1248
} ,
{
"game_type" : 65544 ,
"search_time_avg" : 116871 ,
"players_searching" : 183
} ,
{
"game_type" : 131080 ,
"search_time_avg" : 82308 ,
"players_searching" : 145
} ,
{
"game_type" : 262152 ,
"search_time_avg" : 209331 ,
"players_searching" : 105
} ,
{
"game_type" : 524296 ,
"search_time_avg" : 270376 ,
"players_searching" : 110
} ,
{
"game_type" : 1048584 ,
"search_time_avg" : 64499 ,
"players_searching" : 1020
} ,
{
"game_type" : 268435464 ,
"search_time_avg" : 84615 ,
"players_searching" : 642
} ,
{
"game_type" : 536870920 ,
"search_time_avg" : 104965 ,
"players_searching" : 478
} ,
{
"game_type" : 2097160 ,
"search_time_avg" : 198734 ,
"players_searching" : 228
} ,
{
"game_type" : 134217736 ,
"search_time_avg" : 147703 ,
"players_searching" : 203
} ,
{
"game_type" : 8388616 ,
"search_time_avg" : 538828 ,
"players_searching" : 138
} ,
{
"game_type" : 16777224 ,
"search_time_avg" : 232350 ,
"players_searching" : 192
} ,
{
"game_type" : 4194312 ,
"search_time_avg" : 237269 ,
"players_searching" : 151
} ,
{
"game_type" : 33554440 ,
"search_time_avg" : 203183 ,
"players_searching" : 181
}
] ,
"main_post_url" : "" ,
"required_appid_version" : 13494 ,
"pricesheet_version" : 1438240620 ,
"twitch_streams_version" : 2 ,
"active_tournament_eventid" : 6 ,
"active_survey_id" : 0
} ,
"penalty_seconds" : null , // Contains amount of time logged in account has an MM cooldown
"penalty_reason" : null , // Integer representing reason for MM cooldown
"vac_banned" : 0 ,
"ranking" : {
"account_id" : 137013074 ,
"rank_id" : 11 ,
"wins" : 192 ,
"rank_change" : null
} ,
"commendation" : {
"cmd_friendly" : 3 ,
"cmd_teaching" : 3 ,
"cmd_leader" : 3
} ,
"medals" : {
"medal_team" : 0 ,
"medal_combat" : 0 ,
"medal_weapon" : 0 ,
"medal_global" : 0 ,
"medal_arms" : 0 ,
"display_items_defidx" : [ ] ,
"featured_display_item_defidx" : null
} ,
"my_current_event" : null ,
"my_current_event_teams" : [ ] ,
"my_current_team" : null ,
"my_current_event_stages" : [ ] ,
"survey_vote" : null ,
"activity" : null ,
"player_level" : 3 ,
"player_cur_xp" : 327684342 ,
"player_xp_bonus_flags" : null
}
當遊戲協調員對matchmakingStatsRequest
方法響應時發出。
playerProfile
(對playerProfileRequest
的響應) {
"request_id" : null ,
"account_profiles" : [
{
"account_id" : 137013074 ,
"ongoingmatch" : null ,
"global_stats" : null ,
"penalty_seconds" : null ,
"penalty_reason" : null ,
"vac_banned" : null ,
"ranking" : {
"account_id" : 137013074 ,
"rank_id" : 11 ,
"wins" : 192 ,
"rank_change" : null
},
"commendation" : {
"cmd_friendly" : 3 ,
"cmd_teaching" : 3 ,
"cmd_leader" : 3
},
"medals" : {
"medal_team" : 0 ,
"medal_combat" : 0 ,
"medal_weapon" : 0 ,
"medal_global" : 0 ,
"medal_arms" : 0 ,
"display_items_defidx" : [],
"featured_display_item_defidx" : null
},
"my_current_event" : null ,
"my_current_event_teams" : [],
"my_current_team" : null ,
"my_current_event_stages" : [],
"survey_vote" : null ,
"activity" : null ,
"player_level" : 3 ,
"player_cur_xp" : 327684342 ,
"player_xp_bonus_flags" : null
}
]
}
當遊戲協調員響應playerProfileRequest
方法時發出。
matchList
(對requestRecentGames
的響應)整個響應最終對於讀書我來說太大了,並導致瀏覽器崩潰。因此,我只包含有關返回的內容的摘錄。
{
"reservationid" : {
"low" : 65 ,
"high" : 715485165 ,
"unsigned" : true
},
"reservation" : {
"account_ids" : [
2879081 ,
182261908 ,
225695551 ,
30039512 ,
90132590 ,
94815387 ,
37671978 ,
31906737 ,
137013074 ,
61347894
],
"game_type" : 1032 ,
"match_id" : null ,
"server_version" : null ,
"rankings" : [],
"encryption_key" : null ,
"encryption_key_pub" : null ,
"party_ids" : [],
"whitelist" : [],
"tv_master_steamid" : null ,
"tournament_event" : null ,
"tournament_teams" : [],
"tournament_casters_account_ids" : [],
"tv_relay_steamid" : null ,
"pre_match_data" : null
},
"map" : " http://replay124.valve.net/730/003072985384448163905_0699089210.dem.bz2 " ,
"round" : null ,
"kills" : [
21 ,
22 ,
15 ,
15 ,
12 ,
37 ,
20 ,
23 ,
17 ,
15
],
"assists" : [
5 ,
5 ,
1 ,
3 ,
4 ,
2 ,
3 ,
2 ,
6 ,
7
],
"deaths" : [
22 ,
22 ,
24 ,
23 ,
21 ,
13 ,
13 ,
19 ,
20 ,
20
],
"scores" : [
55 ,
54 ,
40 ,
39 ,
37 ,
79 ,
65 ,
59 ,
41 ,
37
],
"pings" : [],
"round_result" : null ,
"match_result" : 2 ,
"team_scores" : [
11 ,
16
],
"confirm" : null ,
"reservation_stage" : null ,
"match_duration" : 2332 ,
"enemy_kills" : [
21 ,
22 ,
15 ,
15 ,
12 ,
37 ,
20 ,
23 ,
17 ,
15
],
"enemy_headshots" : [
12 ,
11 ,
4 ,
2 ,
3 ,
9 ,
6 ,
9 ,
3 ,
12
],
"enemy_3ks" : [],
"enemy_4ks" : [],
"enemy_5ks" : [],
"mvps" : [
4 ,
3 ,
1 ,
1 ,
2 ,
4 ,
5 ,
2 ,
3 ,
2
],
"spectators_count" : null ,
"spectators_count_tv" : null ,
"spectators_count_lnk" : null ,
"enemy_kills_agg" : []
}
在requestRecentGames
, requestGame
, requestLiveGameForUser
, requestCurrentLiveGames
時發出。
watchList
(對requestWatchInfoFriends
的響應)例子:
{
"request_id" : 0 ,
"account_ids" : [],
"watchable_match_infos" : [
{
"server_ip" : 2453839835 ,
"tv_port" : 28056 ,
"tv_spectators" : 1 ,
"tv_time" : 417 ,
"tv_watch_password" : {
"buffer" : {
"type" : " Buffer " ,
"data" : [ ]
},
"offset" : 21 ,
"markedOffset" : -1 ,
"limit" : 53 ,
"littleEndian" : true ,
"noAssert" : false
},
"cl_decryptdata_key" : null ,
"cl_decryptdata_key_pub" : {
"low" : -249571153 ,
"high" : 1941167002 ,
"unsigned" : true
},
"game_type" : 32776 ,
"game_mapgroup" : " mg_de_mirage " ,
"game_map" : " de_mirage " ,
"server_id" : {
"low" : 2054631424 ,
"high" : 20977258 ,
"unsigned" : true
},
"match_id" : {
"low" : 32 ,
"high" : 719254593 ,
"unsigned" : true
},
"reservation_id" : null
}
],
"extended_timeout" : null
}