هل تحتاج إلى مساعدة؟ لا تفتح مشكلة - اسأل في غرفة الجثث.
مكون إضافي للعقدة للضربات المضادة: الهجوم العالمي.
استنادا إلى العقدة dota2 بواسطة Rjacksonm1
هذه القائمة تزداد وقتًا جدًا. هل تريد أن تكون عليها؟ أرسل لي رسالة على Gitter وسنتحدث. - Joshuaferrara
حدود:
steamUser
- تمرير مثيل Steamuser لتغيير حالتك الحالية (في اللعبة/لا).steamGC
- تمرير مثيل steamgamecooripinator لاستخدامه لإرسال واستقبال رسائل GC.debug
- A Bolean يشير إلى ما إذا كان يجب طباعة المعلومات حول العمليات إلى وحدة التحكم. 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: اذهب.
ToAccountID(steamId)
يحول معرف Steam 64 بت إلى معرف حساب.
ToSteamID(accountId)
يحول معرف الحساب إلى معرف Steam 64 بت.
Rank.getString(int rank_id)
يحول عدد صحيح Rank_id إلى سلسلة. على سبيل المثال: CSGO.Rank.getString(1) = "Silver I"
Level.getString(int player_level)
يحول عددًا صحيحًا إلى سلسلة. على سبيل المثال: CSGO.Level.getString(1) = "Recruit"
matchmakingStatsRequest()
يرسل رسالة إلى منسق اللعبة تطلب بعض إحصائيات التوفيق. استمع إلى حدث matchmakingStatsData
عن استجابة منسق اللعبة. يتطلب أن تكون GC جاهزة (استمع إلى الحدث ready
قبل الاتصال).
requestRecentGames()
يطلب قائمة بالألعاب الحديثة للمسجل حاليًا في الحساب. استمع إلى حدث matchList
لاستجابة منسق اللعبة.
requestLiveGameForUser(accountId)
يطلب معلومات اللعبة الحية الحالية للمستخدم المعطى. استمع إلى حدث matchList
لاستجابة منسق اللعبة.
requestGame(string matchid, string outcomeid, int token)
طلبات معلومات حول اللعبة التي تم إعطاء لعبة matchid و educesid و 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
هو معرف حساب اللاعب (يمكن تحويل steamid64 للاعب إلى معرف حساب مع CSGO.ToAccountID(steamid)
).
يطلب ملف تعريف اللاعب من منسق اللعبة. يجب أن يكون اللاعب على الإنترنت ولعب CS: اذهب. استمع إلى حدث playerProfile
لاستجابة منسق اللعبة.
ملاحظة: لا يمكنك ضبط وجودك الغني على السلاسل التعسفية بعد الآن. بدلاً من ذلك ، تحدد الألعاب الآن قائمة تصل إلى 20 قيم وجود غنية يمكن عرضها. راجع طريقة
SetRichPresence
في هذه الوثائق لمزيد من المعلومات.
richPresenceUpload(richPresenceObject)
يعين كائن التواجد الغني للمستخدم الذي تم تسجيله حاليًا. الوجود الغني هو حل Valve لإعطاء الأصدقاء معلومات حول ما تفعله في اللعبة. على سبيل المثال ، عندما ترى معلومات حول لعبة التوفيق بين الأصدقاء (كما في ، الخريطة والنتيجة) ، يتم تعيين هذا باستخدام الوجود الغني. يمكن العثور على مثال على كيفية استخدام هذه الطريقة في المثال
itemDataRequest(string s, string a, string d, string m)
طلبات العنصر بيانات العنصر CSGO المحدد معلمات ارتباط Inspect. المعلمة s
لها قيمة عندما يكون رابط Inspect من مخزون ؛ وبالمثل ، فإن المعلمة 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 لفك تشفير المشاريع.
سيعيد استدعاء طريقة decode()
لـ SharecodeDecoder
كائنًا بالمعلومات التي تم فك تشفيرها.
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
}