需要帮助吗?不要打开问题 - 在吉特室问。
用于反击的节点式插件:全球进攻。
基于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
}