助けが必要ですか?問題を開かないでください - ギッタールームで尋ねてください。
カウンターストライク用のノードスチームプラグイン:グローバル攻撃。
rjacksonm1によるノード-DOTA2に基づいています
このリストは長すぎています。それになりたいですか?ギッターで私にメッセージを送ってください、そして私たちは話します。 -Joshuaferrara
パラメーター:
steamUser
-SteamUserインスタンスを渡して、現在のステータス(ゲーム内/NOT)を変更します。steamGC
-SteamGameCoordinatorインスタンスを渡して、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()
Counter-Strike:Global Offensiveをプレイしていると報告し、ゲームコーディネーターとのコミュニケーションを開始します。
exit()
あなたがCSをプレイしていないことをSteamに伝えます:GO。
ToAccountID(steamId)
64ビットスチームIDをアカウントIDに変換します。
ToSteamID(accountId)
アカウントIDを64ビットスチームIDに変換します。
Rank.getString(int rank_id)
整数rank_idを文字列に変換します。例: CSGO.Rank.getString(1) = "Silver I"
Level.getString(int player_level)
Integer Player_Levelを文字列に変換します。例: CSGO.Level.getString(1) = "Recruit"
matchmakingStatsRequest()
いくつかのマッチメイキングの統計を要求するメッセージをゲームコーディネーターに送信します。ゲームコーディネーターの応答については、 matchmakingStatsData
イベントを聞いてください。 GCの準備が必要です(電話する前に、 ready
イベントを聞いてください)。
requestRecentGames()
現在ログインしているアカウントの最近のゲームのリストをリクエストします。ゲームコーディネーターの応答については、 matchList
イベントを聞いてください。
requestLiveGameForUser(accountId)
指定されたユーザーの現在のライブゲーム情報を要求します。ゲームコーディネーターの応答については、 matchList
イベントを聞いてください。
requestGame(string matchid, string outcomeid, int token)
ゲームに関するMatchID、Authemid、および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です(プレーヤーのSteamID64は、 CSGO.ToAccountID(steamid)
を使用してアカウントIDに変換できます)。
ゲームコーディネーターにプレイヤーのプロフィールをリクエストします。プレイヤーはオンラインでCSをプレイする必要があります。ゲームコーディネーターの応答については、 playerProfile
イベントを聞いてください。
注:豊かな存在感を任意の文字列に設定することはできません。むしろ、ゲームが表示できる最大20のリッチプレゼンス値のリストを定義するようになりました。詳細については、このドキュメントの
SetRichPresence
メソッドを参照してください。
richPresenceUpload(richPresenceObject)
現在ログインしているユーザーにリッチなプレゼンスオブジェクトを設定します。リッチなプレゼンスは、ゲームで何をしているのかについて友人を友人に提供するためのバルブのソリューションです。たとえば、別の友人のマッチメイキングゲーム(マップとスコアなど)に関する情報を確認すると、これはリッチな存在を使用して設定されます。この方法の使用方法の例は、example.jsにあります
itemDataRequest(string s, string a, string d, string m)
指定されたCSGOアイテムのアイテムデータをリクエストします。リンクパラメーターを検査します。 [インベントリ]リンクからのリンクがある場合、パラメーターs
には値があります。同様に、検査リンクが市場からのものである場合、パラメーターm
には値があります。 Inspectリンクの特定のパラメーターに値がない場合は、 "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クラスをインスタンス化して、ShareCodesをデコードします。
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
への応答)応答全体がREADMEには大きすぎることになり、ブラウザがクラッシュしました。このため、私は返されたものについての抜粋のみを含めました。
{
"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
}