steamutils 1.2.74 → 1.2.77
Sign up to get free protection for your applications and to get access to all the features.
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/steamutils.iml +1 -1
- package/.idea/vcs.xml +1 -1
- package/SteamClient.js +723 -715
- package/free_packages.json +10048 -10048
- package/index.js +1 -1
- package/package.json +1 -1
- package/protos/csgo/base_gcmessages_csgo.proto +547 -547
- package/protos/csgo/c_peer2peer_netmessages.proto +55 -55
- package/protos/csgo/clientmessages.proto +48 -48
- package/protos/csgo/connectionless_netmessages.proto +19 -19
- package/protos/csgo/cs_gameevents.proto +34 -34
- package/protos/csgo/cs_usercmd.proto +34 -34
- package/protos/csgo/cstrike15_gcmessages.proto +1402 -1402
- package/protos/csgo/cstrike15_usermessages.proto +596 -596
- package/protos/csgo/demo.proto +160 -160
- package/protos/csgo/econ_gcmessages.proto +228 -228
- package/protos/csgo/engine_gcmessages.proto +14 -14
- package/protos/csgo/enums_clientserver.proto +1529 -1529
- package/protos/csgo/fatdemo.proto +125 -125
- package/protos/csgo/gameevents.proto +120 -120
- package/protos/csgo/gcsdk_gcmessages.proto +323 -323
- package/protos/csgo/gcsystemmsgs.proto +242 -242
- package/protos/csgo/netmessages.proto +604 -604
- package/protos/csgo/network_connection.proto +126 -126
- package/protos/csgo/networkbasetypes.proto +244 -244
- package/protos/csgo/networksystem_protomessages.proto +17 -17
- package/protos/csgo/steamdatagram_messages_auth.proto +65 -65
- package/protos/csgo/steamdatagram_messages_sdr.proto +534 -534
- package/protos/csgo/steammessages.proto +597 -597
- package/protos/csgo/steammessages_base.proto +301 -301
- package/protos/csgo/steammessages_cloud.steamworkssdk.proto +68 -68
- package/protos/csgo/steammessages_gamenetworkingui.proto +61 -61
- package/protos/csgo/steammessages_helprequest.steamworkssdk.proto +22 -22
- package/protos/csgo/steammessages_oauth.steamworkssdk.proto +18 -18
- package/protos/csgo/steammessages_player.steamworkssdk.proto +254 -254
- package/protos/csgo/steammessages_publishedfile.steamworkssdk.proto +233 -233
- package/protos/csgo/steammessages_steamlearn.steamworkssdk.proto +357 -357
- package/protos/csgo/steammessages_unified_base.steamworkssdk.proto +30 -30
- package/protos/csgo/steamnetworkingsockets_messages.proto +205 -205
- package/protos/csgo/steamnetworkingsockets_messages_certs.proto +39 -39
- package/protos/csgo/steamnetworkingsockets_messages_udp.proto +75 -75
- package/protos/csgo/te.proto +259 -259
- package/protos/csgo/uifontfile_format.proto +13 -13
- package/protos/csgo/usercmd.proto +38 -38
- package/protos/csgo/usermessages.proto +721 -721
- package/protos/csgo/valveextensions.proto +17 -17
- package/protos/google/protobuf/descriptor.proto +281 -281
- package/protos/steam/clientmetrics.proto +45 -45
- package/protos/steam/content_manifest.proto +62 -62
- package/protos/steam/contenthubs.proto +41 -41
- package/protos/steam/encrypted_app_ticket.proto +10 -10
- package/protos/steam/enums.proto +444 -444
- package/protos/steam/enums_clientserver.proto +1539 -1539
- package/protos/steam/enums_productinfo.proto +13 -13
- package/protos/steam/htmlmessages.proto +1027 -1027
- package/protos/steam/offline_ticket.proto +8 -8
- package/protos/steam/renderer/rendermessages.proto +893 -893
- package/protos/steam/steamdatagram_messages_auth.proto +65 -65
- package/protos/steam/steamdatagram_messages_sdr.proto +533 -533
- package/protos/steam/steammessages_accounthardware.steamclient.proto +201 -201
- package/protos/steam/steammessages_appoverview.proto +187 -187
- package/protos/steam/steammessages_auth.steamclient.proto +435 -435
- package/protos/steam/steammessages_base.proto +332 -332
- package/protos/steam/steammessages_broadcast.steamclient.proto +759 -759
- package/protos/steam/steammessages_chat.steamclient.proto +1281 -1281
- package/protos/steam/steammessages_client_objects.proto +645 -645
- package/protos/steam/steammessages_clientlanp2p.proto +42 -42
- package/protos/steam/steammessages_clientmetrics.steamclient.proto +194 -194
- package/protos/steam/steammessages_clientnotificationtypes.proto +231 -231
- package/protos/steam/steammessages_clientserver.proto +392 -392
- package/protos/steam/steammessages_clientserver_2.proto +760 -760
- package/protos/steam/steammessages_clientserver_appinfo.proto +131 -131
- package/protos/steam/steammessages_clientserver_friends.proto +260 -260
- package/protos/steam/steammessages_clientserver_gameservers.proto +159 -159
- package/protos/steam/steammessages_clientserver_lbs.proto +70 -70
- package/protos/steam/steammessages_clientserver_login.proto +167 -167
- package/protos/steam/steammessages_clientserver_ucm.proto +205 -205
- package/protos/steam/steammessages_clientserver_uds.proto +124 -124
- package/protos/steam/steammessages_clientserver_ufs.proto +172 -172
- package/protos/steam/steammessages_clientserver_userstats.proto +80 -80
- package/protos/steam/steammessages_clientsettings.proto +168 -168
- package/protos/steam/steammessages_cloud.steamclient.proto +513 -513
- package/protos/steam/steammessages_contentsystem.steamclient.proto +115 -115
- package/protos/steam/steammessages_credentials.steamclient.proto +115 -115
- package/protos/steam/steammessages_datapublisher.steamclient.proto +116 -116
- package/protos/steam/steammessages_depotbuilder.steamclient.proto +118 -118
- package/protos/steam/steammessages_deviceauth.steamclient.proto +203 -203
- package/protos/steam/steammessages_econ.steamclient.proto +150 -150
- package/protos/steam/steammessages_friendmessages.steamclient.proto +168 -168
- package/protos/steam/steammessages_gamenetworking.steamclient.proto +32 -32
- package/protos/steam/steammessages_gamenetworkingui.proto +61 -61
- package/protos/steam/steammessages_gamenotifications.steamclient.proto +156 -156
- package/protos/steam/steammessages_gameservers.steamclient.proto +152 -152
- package/protos/steam/steammessages_hiddevices.proto +157 -157
- package/protos/steam/steammessages_inventory.steamclient.proto +224 -224
- package/protos/steam/steammessages_linkfilter.steamclient.proto +49 -49
- package/protos/steam/steammessages_lobbymatchmaking.steamclient.proto +33 -33
- package/protos/steam/steammessages_market.steamclient.proto +26 -26
- package/protos/steam/steammessages_marketingmessages.steamclient.proto +274 -274
- package/protos/steam/steammessages_offline.steamclient.proto +40 -40
- package/protos/steam/steammessages_parental.steamclient.proto +228 -228
- package/protos/steam/steammessages_parties.steamclient.proto +94 -94
- package/protos/steam/steammessages_partnerapps.steamclient.proto +138 -138
- package/protos/steam/steammessages_player.steamclient.proto +1060 -1060
- package/protos/steam/steammessages_publishedfile.steamclient.proto +813 -813
- package/protos/steam/steammessages_qms.steamclient.proto +125 -125
- package/protos/steam/steammessages_remoteclient.proto +99 -99
- package/protos/steam/steammessages_remoteclient_discovery.proto +235 -235
- package/protos/steam/steammessages_remoteclient_service.steamclient.proto +86 -86
- package/protos/steam/steammessages_remoteclient_service_messages.proto +217 -217
- package/protos/steam/steammessages_remoteplay.proto +976 -976
- package/protos/steam/steammessages_secrets.steamclient.proto +39 -39
- package/protos/steam/steammessages_shader.steamclient.proto +108 -108
- package/protos/steam/steammessages_site_license.steamclient.proto +128 -128
- package/protos/steam/steammessages_sitelicenseclient.proto +38 -38
- package/protos/steam/steammessages_siteserverui.proto +130 -130
- package/protos/steam/steammessages_star.steamclient.proto +64 -64
- package/protos/steam/steammessages_steamtv.steamclient.proto +630 -630
- package/protos/steam/steammessages_store.steamclient.proto +371 -371
- package/protos/steam/steammessages_storebrowse.steamclient.proto +402 -402
- package/protos/steam/steammessages_timedtrial.steamclient.proto +50 -50
- package/protos/steam/steammessages_twofactor.steamclient.proto +186 -186
- package/protos/steam/steammessages_unified_base.steamclient.proto +33 -33
- package/protos/steam/steammessages_unified_test.steamclient.proto +61 -61
- package/protos/steam/steammessages_useraccount.steamclient.proto +249 -249
- package/protos/steam/steammessages_vac.steamclient.proto +44 -44
- package/protos/steam/steammessages_video.steamclient.proto +171 -171
- package/protos/steam/steammessages_virtualcontroller.proto +138 -138
- package/protos/steam/steammessages_workshop.steamclient.proto +23 -23
- package/protos/steam/steamnetworkingsockets_messages.proto +205 -205
- package/protos/steam/steamnetworkingsockets_messages_certs.proto +39 -39
- package/protos/steam/steamnetworkingsockets_messages_udp.proto +75 -75
- package/protos/steam/webuimessages_base.proto +24 -24
- package/protos/steam/webuimessages_gamenotes.proto +21 -21
- package/protos/steam/webuimessages_steamengine.proto +32 -32
- package/protos/steam/webuimessages_storagedevicemanager.proto +110 -110
- package/protos/steam/webuimessages_systemmanager.proto +17 -17
- package/protos/steam/webuimessages_transport.proto +18 -18
- package/protos/steam/webuimessages_transportvalidation.proto +97 -97
- package/protos/webui/common.proto +5508 -5508
- package/protos/webui/common_base.proto +27 -27
- package/protos/webui/service_accountlinking.proto +27 -27
- package/protos/webui/service_accountprivacy.proto +42 -42
- package/protos/webui/service_auction.proto +97 -97
- package/protos/webui/service_authentication.proto +222 -222
- package/protos/webui/service_authenticationsupport.proto +74 -74
- package/protos/webui/service_broadcast.proto +562 -562
- package/protos/webui/service_chat.proto +11 -11
- package/protos/webui/service_chatroom.proto +810 -810
- package/protos/webui/service_chatusability.proto +107 -107
- package/protos/webui/service_clan.proto +41 -41
- package/protos/webui/service_clanchatrooms.proto +25 -25
- package/protos/webui/service_clanfaqs.proto +202 -202
- package/protos/webui/service_clientcomm.proto +150 -150
- package/protos/webui/service_clientmetrics.proto +63 -63
- package/protos/webui/service_cloud.proto +222 -222
- package/protos/webui/service_cloudconfigstore.proto +51 -51
- package/protos/webui/service_cloudgaming.proto +30 -30
- package/protos/webui/service_community.proto +365 -365
- package/protos/webui/service_econ.proto +134 -134
- package/protos/webui/service_embedded.proto +24 -24
- package/protos/webui/service_experimentservice.proto +6 -6
- package/protos/webui/service_fovasvideo.proto +15 -15
- package/protos/webui/service_friendmessages.proto +133 -133
- package/protos/webui/service_friendslist.proto +70 -70
- package/protos/webui/service_gamenotes.proto +15 -15
- package/protos/webui/service_helprequestlogs.proto +26 -26
- package/protos/webui/service_loyaltyrewards.proto +252 -252
- package/protos/webui/service_marketingmessages.proto +184 -184
- package/protos/webui/service_mobileapp.proto +18 -18
- package/protos/webui/service_mobileauth.proto +24 -24
- package/protos/webui/service_mobiledevice.proto +26 -26
- package/protos/webui/service_mobileperaccount.proto +31 -31
- package/protos/webui/service_news.proto +101 -101
- package/protos/webui/service_parental.proto +178 -178
- package/protos/webui/service_partnermembershipinvite.proto +29 -29
- package/protos/webui/service_partnerstorebrowse.proto +6 -6
- package/protos/webui/service_phone.proto +51 -51
- package/protos/webui/service_physicalgoods.proto +15 -15
- package/protos/webui/service_player.proto +885 -885
- package/protos/webui/service_promotioneventinvites.proto +50 -50
- package/protos/webui/service_promotionplanning.proto +72 -72
- package/protos/webui/service_publishedfile.proto +687 -687
- package/protos/webui/service_publishing.proto +119 -119
- package/protos/webui/service_quest.proto +127 -127
- package/protos/webui/service_salefeature.proto +315 -315
- package/protos/webui/service_saleitemrewards.proto +54 -54
- package/protos/webui/service_shoppingcart.proto +108 -108
- package/protos/webui/service_steamawards.proto +19 -19
- package/protos/webui/service_steamcharts.proto +75 -75
- package/protos/webui/service_steamengine.proto +36 -36
- package/protos/webui/service_steamlearn.proto +727 -727
- package/protos/webui/service_steamnotification.proto +84 -84
- package/protos/webui/service_steamtv.proto +495 -495
- package/protos/webui/service_steamvrvoicechat.proto +67 -67
- package/protos/webui/service_steamvrwebrtc.proto +48 -48
- package/protos/webui/service_storagedevicemanager.proto +104 -104
- package/protos/webui/service_store.proto +289 -289
- package/protos/webui/service_storeappsimilarity.proto +76 -76
- package/protos/webui/service_storebrowse.proto +73 -73
- package/protos/webui/service_storequery.proto +97 -97
- package/protos/webui/service_storesales.proto +15 -15
- package/protos/webui/service_storetopsellers.proto +44 -44
- package/protos/webui/service_systemmanager.proto +11 -11
- package/protos/webui/service_test_transporterror.proto +6 -6
- package/protos/webui/service_transportauth.proto +12 -12
- package/protos/webui/service_transportvalidation.proto +69 -69
- package/protos/webui/service_twofactor.proto +181 -181
- package/protos/webui/service_useraccount.proto +138 -138
- package/protos/webui/service_usergameactivity.proto +34 -34
- package/protos/webui/service_usergamenotes.proto +53 -53
- package/protos/webui/service_usernews.proto +68 -68
- package/protos/webui/service_userreviews.proto +96 -96
- package/protos/webui/service_video.proto +128 -128
- package/protos/webui/service_voicechat.proto +139 -139
- package/protos/webui/service_webrtc.proto +52 -52
- package/.idea/deployment.xml +0 -21
package/SteamClient.js
CHANGED
@@ -75,7 +75,7 @@ export const LOCS = {
|
|
75
75
|
|
76
76
|
|
77
77
|
const appid = 730
|
78
|
-
export let CSGO_VER =
|
78
|
+
export let CSGO_VER = 13958
|
79
79
|
const FreeAppList = JSON.parse(fs.readFileSync(path.join(__dirname, 'free_packages.json'))).packages
|
80
80
|
|
81
81
|
// SteamUtils.GetCurrentVersion(appid).then(function (ver) {
|
@@ -101,7 +101,8 @@ function SteamClient({
|
|
101
101
|
let playingBlocked = null
|
102
102
|
const richPresence = {}
|
103
103
|
let sendMessageTimestamp = 0
|
104
|
-
let lastTimePartyRegister =
|
104
|
+
let lastTimePartyRegister = 0
|
105
|
+
let lastTimePartySearch = 0
|
105
106
|
|
106
107
|
const onAnyCallbacks = []
|
107
108
|
|
@@ -379,6 +380,7 @@ function SteamClient({
|
|
379
380
|
launcher: 0,
|
380
381
|
game_type: game_type === 'Competitive' ? 8 : 10
|
381
382
|
}))
|
383
|
+
lastTimePartySearch = new Date().getTime()
|
382
384
|
pushGCCallback('partySearch', resolve, timeout)
|
383
385
|
})
|
384
386
|
}
|
@@ -441,444 +443,429 @@ function SteamClient({
|
|
441
443
|
|
442
444
|
|
443
445
|
function bindEvent() {
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
446
|
+
const events = {
|
447
|
+
async disconnected(eresult, msg) {
|
448
|
+
state = 'Offline'
|
449
|
+
log('disconnected', eresult, msg)
|
450
|
+
|
451
|
+
callEvent(events.disconnected, {eresult, msg})
|
452
|
+
|
453
|
+
if (['ServiceUnavailable', 'NoConnection'].includes(msg) && autoReconnect && !isLogOff) {
|
454
|
+
async function relogin(retry) {
|
455
|
+
if (retry <= 0) {
|
456
|
+
console.error("Cannot relogin")
|
457
|
+
return false
|
458
|
+
} else {
|
459
|
+
const isSuccess = await login(true)
|
460
|
+
if (isSuccess) {
|
461
|
+
const loggedOnResponse = await new Promise(resolve => {
|
462
|
+
onEvent('loggedOn', resolve, true, 180000)
|
463
|
+
})
|
464
|
+
if (loggedOnResponse) {
|
465
|
+
console.log("Relogin success")
|
466
|
+
return true
|
467
|
+
} else {
|
468
|
+
await sleep(120000)
|
469
|
+
return await relogin(retry - 1)
|
470
|
+
}
|
464
471
|
} else {
|
465
472
|
await sleep(120000)
|
466
473
|
return await relogin(retry - 1)
|
467
474
|
}
|
468
|
-
} else {
|
469
|
-
await sleep(120000)
|
470
|
-
return await relogin(retry - 1)
|
471
475
|
}
|
472
476
|
}
|
473
|
-
}
|
474
477
|
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
+
await sleep(60000)
|
479
|
+
const isSuccess = await relogin(50)
|
480
|
+
if (!isSuccess) {
|
481
|
+
offAllEvent()
|
482
|
+
doClearIntervals()
|
483
|
+
}
|
484
|
+
} else {
|
478
485
|
offAllEvent()
|
479
486
|
doClearIntervals()
|
480
487
|
}
|
481
|
-
}
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
break
|
502
|
-
default:
|
503
|
-
errorStr = `Unknown: ${e.eresult}`
|
504
|
-
break
|
505
|
-
}
|
506
|
-
log('error', e?.message)
|
507
|
-
doClearIntervals()
|
508
|
-
callEvent(events.error, {eresult: e.eresult, msg: e.message, error: errorStr})
|
509
|
-
})
|
510
|
-
|
511
|
-
steamClient.on('webSession', (sessionID, cookies) => {
|
512
|
-
const webSession = {sessionID, cookies};
|
513
|
-
steamClient.webSession = webSession
|
514
|
-
callEvent(events.webSession, webSession)
|
515
|
-
})
|
516
|
-
|
517
|
-
// steamClient.on('lobbyInvite', (inviterID, lobbyID ) => {
|
518
|
-
// joinLobby(lobbyID)
|
519
|
-
// })
|
520
|
-
|
521
|
-
// steamClient.on('debug', (msg) => {
|
522
|
-
// if (!["ClientPersonaState","ClientClanState"].some(c => msg.includes(c))) {
|
523
|
-
// if(msg.startsWith("Received")){
|
524
|
-
// console.log(`------- ${msg}`)
|
525
|
-
// } else {
|
526
|
-
// console.log(msg)
|
527
|
-
// }
|
528
|
-
// }
|
529
|
-
// })
|
530
|
-
|
531
|
-
steamClient.on('receivedFromGC', async (appid, msgType, payload) => {
|
532
|
-
const key = getECsgoGCMsgKey(msgType)
|
533
|
-
switch (msgType) {
|
534
|
-
case Protos.csgo.EMsg.k_EMsgClientChatInvite: {
|
535
|
-
log(payload)
|
536
|
-
break
|
537
|
-
}
|
538
|
-
case Protos.csgo.ECsgoGCMsg.k_EMsgClientMMSJoinLobbyResponse: {
|
539
|
-
let msg = protoDecode(Protos.csgo.CMsgClientMMSJoinLobbyResponse, payload)
|
540
|
-
log(msg)
|
541
|
-
break
|
488
|
+
},
|
489
|
+
async error(e) {
|
490
|
+
let errorStr = ``
|
491
|
+
switch (e.eresult) {
|
492
|
+
case 5:
|
493
|
+
errorStr = `Invalid Password`
|
494
|
+
break
|
495
|
+
case 6:
|
496
|
+
case 34:
|
497
|
+
errorStr = `Logged In Elsewhere`
|
498
|
+
break
|
499
|
+
case 84:
|
500
|
+
errorStr = `Rate Limit Exceeded`
|
501
|
+
break
|
502
|
+
case 65:
|
503
|
+
errorStr = `steam guard is invalid`
|
504
|
+
break
|
505
|
+
default:
|
506
|
+
errorStr = `Unknown: ${e.eresult}`
|
507
|
+
break
|
542
508
|
}
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
509
|
+
log('error', e?.message)
|
510
|
+
doClearIntervals()
|
511
|
+
callEvent(events.error, {eresult: e.eresult, msg: e.message, error: errorStr})
|
512
|
+
},
|
513
|
+
async webSession(sessionID, cookies) {
|
514
|
+
const webSession = {sessionID, cookies};
|
515
|
+
steamClient.webSession = webSession
|
516
|
+
callEvent(events.webSession, webSession)
|
517
|
+
},
|
518
|
+
async receivedFromGC(appid, msgType, payload) {
|
519
|
+
const key = getECsgoGCMsgKey(msgType)
|
520
|
+
switch (msgType) {
|
521
|
+
case Protos.csgo.EMsg.k_EMsgClientChatInvite: {
|
522
|
+
log(payload)
|
523
|
+
break
|
524
|
+
}
|
525
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgClientMMSJoinLobbyResponse: {
|
526
|
+
let msg = protoDecode(Protos.csgo.CMsgClientMMSJoinLobbyResponse, payload)
|
527
|
+
log(msg)
|
528
|
+
break
|
529
|
+
}
|
530
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Party_Invite: {
|
531
|
+
const msg = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_Party_Invite, payload);
|
532
|
+
const sid64 = SteamID.fromIndividualAccountID(msg.accountid).getSteamID64();
|
533
|
+
if (events.partyInvite?.length) {
|
534
|
+
const personas = await getPersonas([sid64]);
|
535
|
+
const player_name = personas.find(p => p.id == sid64)?.player_name
|
536
|
+
if (player_name === undefined) {
|
537
|
+
log(sid64, personas);
|
538
|
+
}
|
539
|
+
callEvent(events.partyInvite, {player_name, steamId: sid64, lobbyId: msg.lobbyid})
|
551
540
|
}
|
552
|
-
|
541
|
+
// log(player_name, `https://steamcommunity.com/profiles/${sid64}`);
|
542
|
+
// joinLobby(msg.lobbyid, msg.accountid)
|
543
|
+
break
|
553
544
|
}
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
switch (cache_object.type_id) {
|
572
|
-
case 1: {
|
573
|
-
const result = protoDecode(Protos.csgo.CSOEconItem, object_data);
|
574
|
-
break
|
575
|
-
}
|
576
|
-
case 2: {
|
577
|
-
const result = protoDecode(Protos.csgo.CSOPersonaDataPublic, object_data);
|
578
|
-
obj.PersonaDataPublic = result
|
579
|
-
const example = {
|
580
|
-
"player_level": 4,
|
581
|
-
"commendation": {
|
582
|
-
"cmd_friendly": 149,
|
583
|
-
"cmd_teaching": 108,
|
584
|
-
"cmd_leader": 115
|
585
|
-
},
|
586
|
-
"elevated_state": true
|
545
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Account_RequestCoPlays: {
|
546
|
+
const msg = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_Account_RequestCoPlays, payload);
|
547
|
+
const personas = msg.players.map(p => SteamID.fromIndividualAccountID(p.accountid));
|
548
|
+
callGCCallback('RequestCoPlays', personas)
|
549
|
+
break
|
550
|
+
}
|
551
|
+
case Protos.csgo.EGCBaseClientMsg.k_EMsgGCClientWelcome: {
|
552
|
+
prime = false
|
553
|
+
const CMsgClientWelcome = protoDecode(Protos.csgo.CMsgClientWelcome, payload);
|
554
|
+
const obj = {}
|
555
|
+
for (const outofdate_cache of CMsgClientWelcome.outofdate_subscribed_caches) {
|
556
|
+
for (const cache_object of outofdate_cache.objects) {
|
557
|
+
for (const object_data of cache_object.object_data) {
|
558
|
+
switch (cache_object.type_id) {
|
559
|
+
case 1: {
|
560
|
+
const result = protoDecode(Protos.csgo.CSOEconItem, object_data);
|
561
|
+
break
|
587
562
|
}
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
"elevated_timestamp": 5
|
602
|
-
} //1688518800
|
603
|
-
if ((CSOEconGameAccountClient.bonus_xp_usedflags & 16) != 0) { // EXPBonusFlag::PrestigeEarned
|
604
|
-
prime = true
|
605
|
-
CSOEconGameAccountClient.prime = true
|
563
|
+
case 2: {
|
564
|
+
const result = protoDecode(Protos.csgo.CSOPersonaDataPublic, object_data);
|
565
|
+
obj.PersonaDataPublic = result
|
566
|
+
const example = {
|
567
|
+
"player_level": 4,
|
568
|
+
"commendation": {
|
569
|
+
"cmd_friendly": 149,
|
570
|
+
"cmd_teaching": 108,
|
571
|
+
"cmd_leader": 115
|
572
|
+
},
|
573
|
+
"elevated_state": true
|
574
|
+
}
|
575
|
+
break
|
606
576
|
}
|
607
|
-
|
608
|
-
|
609
|
-
|
577
|
+
case 5: {
|
578
|
+
const result = protoDecode(Protos.csgo.CSOItemRecipe, object_data);
|
579
|
+
break
|
610
580
|
}
|
611
|
-
|
612
|
-
|
581
|
+
case 7: {
|
582
|
+
const CSOEconGameAccountClient = protoDecode(Protos.csgo.CSOEconGameAccountClient, object_data);
|
583
|
+
const CSOEconGameAccountClientExample = {
|
584
|
+
"additional_backpack_slots": 0,
|
585
|
+
"bonus_xp_timestamp_refresh": 1688518800,//Wednesday 1:00:00 AM every week
|
586
|
+
"bonus_xp_usedflags": 19,
|
587
|
+
"elevated_state": 5,
|
588
|
+
"elevated_timestamp": 5
|
589
|
+
} //1688518800
|
590
|
+
if ((CSOEconGameAccountClient.bonus_xp_usedflags & 16) != 0) { // EXPBonusFlag::PrestigeEarned
|
591
|
+
prime = true
|
592
|
+
CSOEconGameAccountClient.prime = true
|
593
|
+
}
|
594
|
+
if (CSOEconGameAccountClient.elevated_state === 5) { // bought prime
|
595
|
+
prime = true
|
596
|
+
CSOEconGameAccountClient.prime = true
|
597
|
+
}
|
598
|
+
if (CSOEconGameAccountClient) {
|
599
|
+
obj.GameAccountClient = CSOEconGameAccountClient
|
600
|
+
}
|
601
|
+
break
|
613
602
|
}
|
614
|
-
break
|
615
|
-
}
|
616
603
|
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
604
|
+
case 35: {
|
605
|
+
// const result =protoDecode(Protos.csgo.CSOSelectedItemPreset, object_data);
|
606
|
+
break
|
607
|
+
}
|
621
608
|
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
609
|
+
case 36: {
|
610
|
+
// const result =protoDecode(Protos.csgo.CSOEconItemPresetInstance, object_data);
|
611
|
+
break
|
612
|
+
}
|
613
|
+
case 38: {
|
614
|
+
const result = protoDecode(Protos.csgo.CSOEconItemDropRateBonus, object_data);
|
615
|
+
break
|
616
|
+
}
|
617
|
+
case 39: {
|
618
|
+
const result = protoDecode(Protos.csgo.CSOEconItemLeagueViewPass, object_data);
|
619
|
+
break
|
620
|
+
}
|
621
|
+
case 40: {
|
622
|
+
const result = protoDecode(Protos.csgo.CSOEconItemEventTicket, object_data);
|
623
|
+
break
|
624
|
+
}
|
625
|
+
case 41: {
|
626
|
+
const result = protoDecode(Protos.csgo.CSOAccountSeasonalOperation, object_data);
|
627
|
+
break
|
628
|
+
}
|
629
|
+
case 42: {
|
630
|
+
// const result =protoDecode(Protos.csgo.CSOEconItemTournamentPassport, object_data);
|
631
|
+
break
|
632
|
+
}
|
633
|
+
case 43: {
|
634
|
+
const result = protoDecode(Protos.csgo.CSOEconDefaultEquippedDefinitionInstanceClient, object_data);
|
635
|
+
const example = {
|
636
|
+
"account_id": 1080136620,
|
637
|
+
"item_definition": 61,
|
638
|
+
"class_id": 3,
|
639
|
+
"slot_id": 2
|
640
|
+
}
|
641
|
+
break
|
642
|
+
}
|
643
|
+
case 45: {
|
644
|
+
const result = protoDecode(Protos.csgo.CSOEconCoupon, object_data);
|
645
|
+
break
|
646
|
+
}
|
647
|
+
case 46: {
|
648
|
+
const result = protoDecode(Protos.csgo.CSOQuestProgress, object_data);
|
649
|
+
break
|
653
650
|
}
|
654
|
-
break
|
655
|
-
}
|
656
|
-
case 45: {
|
657
|
-
const result = protoDecode(Protos.csgo.CSOEconCoupon, object_data);
|
658
|
-
break
|
659
|
-
}
|
660
|
-
case 46: {
|
661
|
-
const result = protoDecode(Protos.csgo.CSOQuestProgress, object_data);
|
662
|
-
break
|
663
|
-
}
|
664
651
|
|
665
|
-
|
666
|
-
|
652
|
+
default: {
|
653
|
+
log("cache_object.type_id", cache_object.type_id);
|
654
|
+
}
|
667
655
|
}
|
668
656
|
}
|
669
|
-
}
|
670
657
|
|
658
|
+
}
|
671
659
|
}
|
672
|
-
|
673
|
-
callEvent(events.csgoOnline, obj)
|
660
|
+
callEvent(events.csgoOnline, obj)
|
674
661
|
|
675
|
-
|
676
|
-
partyRegister()
|
677
|
-
doSetInterval(function () {
|
662
|
+
if (isPartyRegister) {
|
678
663
|
partyRegister()
|
679
|
-
|
664
|
+
doSetInterval(function () {
|
665
|
+
partyRegister()
|
666
|
+
}, [60000, 120000], 'autoPartyRegister')
|
667
|
+
}
|
668
|
+
break
|
680
669
|
}
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate, payload)
|
685
|
-
break
|
686
|
-
}
|
687
|
-
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GC2ClientGlobalStats: {
|
688
|
-
const result = protoDecode(Protos.csgo.CMsgClientUGSGetGlobalStatsResponse, payload)
|
689
|
-
break
|
690
|
-
}
|
691
|
-
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportPlayer: {
|
692
|
-
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_ClientReportPlayer, payload)
|
693
|
-
break
|
694
|
-
}
|
695
|
-
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GC2ClientTextMsg: {
|
696
|
-
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_GC2ClientTextMsg, payload)
|
697
|
-
break
|
698
|
-
}
|
699
|
-
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello: {
|
700
|
-
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_MatchmakingGC2ClientHello, payload)
|
701
|
-
const example = {
|
702
|
-
my_current_event_teams: [],
|
703
|
-
my_current_event_stages: [],
|
704
|
-
rankings: [],
|
705
|
-
account_id: 1080136620,
|
706
|
-
ongoingmatch: null,
|
707
|
-
global_stats: {
|
708
|
-
search_statistics: [
|
709
|
-
{
|
710
|
-
game_type: 520,
|
711
|
-
search_time_avg: 0,
|
712
|
-
players_searching: 5141
|
713
|
-
},
|
714
|
-
{
|
715
|
-
game_type: 32776,
|
716
|
-
search_time_avg: 0,
|
717
|
-
players_searching: 6561
|
718
|
-
},
|
719
|
-
],
|
720
|
-
players_online: 617207,
|
721
|
-
servers_online: 230638,
|
722
|
-
players_searching: 13550,
|
723
|
-
servers_available: 126352,
|
724
|
-
ongoing_matches: 23264,
|
725
|
-
search_time_avg: 95993,
|
726
|
-
main_post_url: "*XA=https://blast.tv/live*XT=https://www.twitch.tv/blastpremier*XB=https://live.bilibili.com/35*XG=playcast://https://gotv.blast.tv/major-a*T=SGTAB*L=2@https://steamcommunity.com/broadcast/watch/76561199492362089",
|
727
|
-
required_appid_version: 13879,
|
728
|
-
pricesheet_version: 1688084844,
|
729
|
-
twitch_streams_version: 2,
|
730
|
-
active_tournament_eventid: 21,
|
731
|
-
active_survey_id: 0,
|
732
|
-
rtime32_cur: 0,
|
733
|
-
rtime32_event_start: 0
|
734
|
-
},
|
735
|
-
penalty_seconds: 0,
|
736
|
-
penalty_reason: 0,
|
737
|
-
vac_banned: 0,
|
738
|
-
ranking: {
|
739
|
-
account_id: 1080136620,
|
740
|
-
rank_id: 10,
|
741
|
-
wins: 209,
|
742
|
-
rank_change: 0,
|
743
|
-
rank_type_id: 6,
|
744
|
-
tv_control: 0
|
745
|
-
},
|
746
|
-
commendation: {
|
747
|
-
cmd_friendly: 149,
|
748
|
-
cmd_teaching: 108,
|
749
|
-
cmd_leader: 115
|
750
|
-
},
|
751
|
-
medals: null,
|
752
|
-
my_current_event: null,
|
753
|
-
my_current_team: null,
|
754
|
-
survey_vote: 0,
|
755
|
-
activity: null,
|
756
|
-
player_level: 4,
|
757
|
-
player_cur_xp: 327684501,
|
758
|
-
player_xp_bonus_flags: 0
|
670
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate: {
|
671
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate, payload)
|
672
|
+
break
|
759
673
|
}
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
674
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GC2ClientGlobalStats: {
|
675
|
+
const result = protoDecode(Protos.csgo.CMsgClientUGSGetGlobalStatsResponse, payload)
|
676
|
+
break
|
677
|
+
}
|
678
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportPlayer: {
|
679
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_ClientReportPlayer, payload)
|
680
|
+
break
|
681
|
+
}
|
682
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GC2ClientTextMsg: {
|
683
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_GC2ClientTextMsg, payload)
|
684
|
+
break
|
685
|
+
}
|
686
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello: {
|
687
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_MatchmakingGC2ClientHello, payload)
|
688
|
+
const example = {
|
689
|
+
my_current_event_teams: [],
|
690
|
+
my_current_event_stages: [],
|
691
|
+
rankings: [],
|
692
|
+
account_id: 1080136620,
|
693
|
+
ongoingmatch: null,
|
694
|
+
global_stats: {
|
695
|
+
search_statistics: [
|
696
|
+
{
|
697
|
+
game_type: 520,
|
698
|
+
search_time_avg: 0,
|
699
|
+
players_searching: 5141
|
700
|
+
},
|
701
|
+
{
|
702
|
+
game_type: 32776,
|
703
|
+
search_time_avg: 0,
|
704
|
+
players_searching: 6561
|
705
|
+
},
|
706
|
+
],
|
707
|
+
players_online: 617207,
|
708
|
+
servers_online: 230638,
|
709
|
+
players_searching: 13550,
|
710
|
+
servers_available: 126352,
|
711
|
+
ongoing_matches: 23264,
|
712
|
+
search_time_avg: 95993,
|
713
|
+
main_post_url: "*XA=https://blast.tv/live*XT=https://www.twitch.tv/blastpremier*XB=https://live.bilibili.com/35*XG=playcast://https://gotv.blast.tv/major-a*T=SGTAB*L=2@https://steamcommunity.com/broadcast/watch/76561199492362089",
|
714
|
+
required_appid_version: 13879,
|
715
|
+
pricesheet_version: 1688084844,
|
716
|
+
twitch_streams_version: 2,
|
717
|
+
active_tournament_eventid: 21,
|
718
|
+
active_survey_id: 0,
|
719
|
+
rtime32_cur: 0,
|
720
|
+
rtime32_event_start: 0
|
721
|
+
},
|
722
|
+
penalty_seconds: 0,
|
723
|
+
penalty_reason: 0,
|
724
|
+
vac_banned: 0,
|
725
|
+
ranking: {
|
726
|
+
account_id: 1080136620,
|
727
|
+
rank_id: 10,
|
728
|
+
wins: 209,
|
729
|
+
rank_change: 0,
|
730
|
+
rank_type_id: 6,
|
731
|
+
tv_control: 0
|
732
|
+
},
|
733
|
+
commendation: {
|
734
|
+
cmd_friendly: 149,
|
735
|
+
cmd_teaching: 108,
|
736
|
+
cmd_leader: 115
|
737
|
+
},
|
738
|
+
medals: null,
|
739
|
+
my_current_event: null,
|
740
|
+
my_current_team: null,
|
741
|
+
survey_vote: 0,
|
742
|
+
activity: null,
|
743
|
+
player_level: 4,
|
744
|
+
player_cur_xp: 327684501,
|
745
|
+
player_xp_bonus_flags: 0
|
746
|
+
}
|
747
|
+
callEvent(events.csgoClientHello, result)
|
748
|
+
break
|
749
|
+
}
|
750
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportResponse: {
|
751
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_ClientReportResponse, payload)
|
752
|
+
break
|
753
|
+
}
|
754
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientCommendPlayerQueryResponse: {
|
755
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_ClientCommendPlayer, payload)
|
756
|
+
break
|
757
|
+
}
|
758
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment: {
|
759
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment, payload)
|
760
|
+
break
|
761
|
+
}
|
762
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchList: {
|
763
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_MatchList, payload)
|
764
|
+
break
|
765
|
+
}
|
766
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GetEventFavorites_Response: {
|
767
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_GetEventFavorites_Response, payload)
|
768
|
+
break
|
769
|
+
}
|
770
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_StartAgreementSessionInGame: {
|
784
771
|
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
772
|
+
break
|
773
|
+
}
|
774
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_ClientDeepStats: {
|
775
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_ClientDeepStats, payload)
|
776
|
+
break
|
777
|
+
}
|
778
|
+
case Protos.csgo.EGCBaseClientMsg.k_EMsgGCClientConnectionStatus: {
|
779
|
+
const result = protoDecode(Protos.csgo.CMsgConnectionStatus, payload)
|
780
|
+
break
|
781
|
+
}
|
782
|
+
case Protos.csgo.EGCItemMsg.k_EMsgGCStoreGetUserDataResponse: {
|
783
|
+
const result = protoDecode(Protos.csgo.CMsgStoreGetUserDataResponse, payload)
|
784
|
+
break
|
785
|
+
}
|
786
|
+
case Protos.csgo.EGCItemMsg.k_EMsgGCStorePurchaseFinalizeResponse: {
|
787
|
+
const result = protoDecode(Protos.csgo.CMsgGCStorePurchaseFinalizeResponse, payload)
|
788
|
+
break
|
789
|
+
}
|
790
|
+
case Protos.csgo.EGCItemMsg.k_EMsgGCStorePurchaseCancelResponse: {
|
791
|
+
const result = protoDecode(Protos.csgo.CMsgGCStorePurchaseCancelResponse, payload)
|
792
|
+
break
|
793
|
+
}
|
794
|
+
case Protos.csgo.EGCItemMsg.k_EMsgGCStorePurchaseInitResponse: {
|
795
|
+
const result = protoDecode(Protos.csgo.CMsgGCStorePurchaseInitResponse, payload)
|
796
|
+
break
|
797
|
+
}
|
798
|
+
case Protos.csgo.EMsg.k_EMsgClientMMSCreateLobbyResponse: {
|
799
|
+
const result = protoDecode(Protos.csgo.CMsgClientMMSCreateLobbyResponse, payload)
|
800
|
+
break
|
801
|
+
}
|
802
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientGCRankUpdate: {
|
803
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_ClientGCRankUpdate, payload)
|
804
|
+
break
|
805
|
+
}
|
806
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Party_Search: {
|
807
|
+
const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_Party_SearchResults, payload)
|
808
|
+
const entries = _.uniqBy(result.entries, 'id')
|
809
|
+
//{
|
810
|
+
// "id": 144900402,
|
811
|
+
// "grp": 0,
|
812
|
+
// "game_type": 8,
|
813
|
+
// "apr": 1,
|
814
|
+
// "ark": 17,
|
815
|
+
// "loc": 20041,
|
816
|
+
// "accountid": 0
|
817
|
+
// }
|
818
|
+
|
819
|
+
const players = []
|
820
|
+
|
821
|
+
const steamIDs = entries
|
822
|
+
.map(p => SteamID.fromIndividualAccountID(p.id).getSteamID64())
|
823
|
+
const personas = await getPersonas(steamIDs)
|
824
|
+
//{
|
825
|
+
// "id": "76561199265943339",
|
826
|
+
// "rich_presence": [],
|
827
|
+
// "persona_state": null,
|
828
|
+
// "game_played_app_id": null,
|
829
|
+
// "game_server_ip": null,
|
830
|
+
// "game_server_port": null,
|
831
|
+
// "persona_state_flags": null,
|
832
|
+
// "online_session_instances": null,
|
833
|
+
// "persona_set_by_user": null,
|
834
|
+
// "player_name": "杀人不见血",
|
835
|
+
// "query_port": null,
|
836
|
+
// "steamid_source": null,
|
837
|
+
// "avatar_hash": "33994e26f1fe7e2093f8c7dee66c1ac91531050d",
|
838
|
+
// "last_logoff": null,
|
839
|
+
// "last_logon": null,
|
840
|
+
// "last_seen_online": null,
|
841
|
+
// "clan_rank": null,
|
842
|
+
// "game_name": null,
|
843
|
+
// "gameid": null,
|
844
|
+
// "game_data_blob": null,
|
845
|
+
// "clan_data": null,
|
846
|
+
// "clan_tag": null,
|
847
|
+
// "broadcast_id": null,
|
848
|
+
// "game_lobby_id": null,
|
849
|
+
// "watching_broadcast_accountid": null,
|
850
|
+
// "watching_broadcast_appid": null,
|
851
|
+
// "watching_broadcast_viewers": null,
|
852
|
+
// "watching_broadcast_title": null,
|
853
|
+
// "is_community_banned": null,
|
854
|
+
// "player_name_pending_review": null,
|
855
|
+
// "avatar_pending_review": null,
|
856
|
+
// "avatar_url_icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/33/33994e26f1fe7e2093f8c7dee66c1ac91531050d.jpg",
|
857
|
+
// "avatar_url_medium": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/33/33994e26f1fe7e2093f8c7dee66c1ac91531050d_medium.jpg",
|
858
|
+
// "avatar_url_full": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/33/33994e26f1fe7e2093f8c7dee66c1ac91531050d_full.jpg"
|
859
|
+
// }
|
860
|
+
for (const player of entries) {
|
861
|
+
try {
|
862
|
+
const prime = player.apr === 1 ? 'PRIME' : 'NON-PRIME'
|
863
|
+
const loc = LOCS[player.loc] || player.loc
|
864
|
+
const steamId = SteamID.fromIndividualAccountID(player.id).getSteamID64()
|
865
|
+
const persona = personas.find(p => p.id == steamId)
|
866
|
+
const friendCode = FriendCode.encode(steamId)
|
867
|
+
|
868
|
+
// if ((LOCS[player.loc] == 'VN' || !LOCS[player.loc])) {
|
882
869
|
players.push({
|
883
870
|
prime,
|
884
871
|
player_name: persona.player_name,
|
@@ -888,75 +875,330 @@ function SteamClient({
|
|
888
875
|
friendCode,
|
889
876
|
avatar_hash: persona.avatar_hash,
|
890
877
|
})
|
891
|
-
|
892
|
-
|
878
|
+
// }
|
879
|
+
} catch (e) {
|
880
|
+
}
|
893
881
|
}
|
894
|
-
}
|
895
882
|
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
883
|
+
callGCCallback('partySearch', players)
|
884
|
+
break
|
885
|
+
}
|
886
|
+
case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_PlayersProfile: {
|
887
|
+
let data = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_PlayersProfile, payload)?.account_profiles
|
888
|
+
const dataExample = [{
|
889
|
+
my_current_event_teams: [],
|
890
|
+
my_current_event_stages: [],
|
891
|
+
rankings: [{
|
892
|
+
account_id: 1225887169,
|
893
|
+
rank_id: 0,
|
894
|
+
wins: 6,
|
895
|
+
rank_change: 0,
|
896
|
+
rank_type_id: 7,
|
897
|
+
tv_control: 0
|
898
|
+
}, {
|
899
|
+
account_id: 1225887169,
|
900
|
+
rank_id: 0,
|
901
|
+
wins: 0,
|
902
|
+
rank_change: 0,
|
903
|
+
rank_type_id: 10,
|
904
|
+
tv_control: 0
|
905
|
+
}],
|
916
906
|
account_id: 1225887169,
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
907
|
+
ongoingmatch: null,
|
908
|
+
global_stats: null,
|
909
|
+
penalty_seconds: 0,
|
910
|
+
penalty_reason: 0,
|
911
|
+
vac_banned: 0,
|
912
|
+
ranking: {
|
913
|
+
account_id: 1225887169,
|
914
|
+
rank_id: 8,
|
915
|
+
wins: 469,
|
916
|
+
rank_change: 0,
|
917
|
+
rank_type_id: 6,
|
918
|
+
tv_control: 0
|
919
|
+
},
|
920
|
+
commendation: {
|
921
|
+
cmd_friendly: 51, cmd_teaching: 40, cmd_leader: 40
|
922
|
+
},
|
923
|
+
medals: {
|
924
|
+
display_items_defidx: [4819, 4737], featured_display_item_defidx: 4819
|
925
|
+
},
|
926
|
+
my_current_event: null,
|
927
|
+
my_current_team: null,
|
928
|
+
survey_vote: 0,
|
929
|
+
activity: null,
|
930
|
+
player_level: 32,
|
931
|
+
player_cur_xp: 327682846,
|
932
|
+
player_xp_bonus_flags: 0
|
933
|
+
}]
|
934
|
+
|
935
|
+
const player = data?.[0];
|
936
|
+
if (player) {
|
937
|
+
player.prime = !!(player.ranking?.account_id || player.player_level || player.player_cur_xp)
|
938
|
+
player.steamId = SteamID.fromIndividualAccountID(player.account_id).getSteamID64()
|
939
|
+
}
|
940
|
+
callGCCallback('PlayersProfile' + player?.account_id, player)
|
941
|
+
callEvent(events.playersProfile, player)
|
942
|
+
break
|
943
|
+
}
|
944
|
+
default:
|
945
|
+
log(`receivedFromGC ${msgType} ${key}`)
|
946
|
+
const results = Object.values(Protos.csgo).map(function (p) {
|
947
|
+
try {
|
948
|
+
return protoDecode(p, payload)
|
949
|
+
} catch (e) {
|
950
|
+
}
|
951
|
+
}).filter(function (result) {
|
952
|
+
return result && Object.keys(result).length
|
953
|
+
})
|
954
|
+
log(key, results)
|
955
|
+
}
|
956
|
+
},
|
957
|
+
async loggedOn(loggedOnResponse) {
|
958
|
+
steamClient.setPersona(SteamUser.EPersonaState.Online)
|
959
|
+
state = 'Online'
|
960
|
+
await sendHello()
|
961
|
+
callEvent(events.loggedOn, loggedOnResponse)
|
962
|
+
if (isAutoRequestFreeLicense) {
|
963
|
+
doSetInterval(function () {
|
964
|
+
autoRequestFreeLicense(false, 50)
|
965
|
+
}, [5 * 60000, 10 * 60000], 'autoRequestFreeLicense')
|
966
|
+
}
|
967
|
+
if (autoPlay) {
|
968
|
+
await sleep(10000)
|
969
|
+
onCookie(function () {
|
970
|
+
autoGamePlay()
|
971
|
+
})
|
972
|
+
}
|
973
|
+
},
|
974
|
+
async user(steamId, data) {
|
975
|
+
callEvent(events.user, {steamId: steamId.getSteamID64(), data})
|
976
|
+
const dataExample = {
|
977
|
+
"rich_presence": [
|
978
|
+
{
|
979
|
+
"key": "status",
|
980
|
+
"value": "Competitive Mirage [ 3 : 6 ]"
|
981
|
+
},
|
982
|
+
{
|
983
|
+
"key": "version",
|
984
|
+
"value": "13875"
|
985
|
+
},
|
986
|
+
{
|
987
|
+
"key": "game:state",
|
988
|
+
"value": "game"
|
989
|
+
},
|
990
|
+
{
|
991
|
+
"key": "steam_display",
|
992
|
+
"value": "#display_GameKnownMapScore"
|
993
|
+
},
|
994
|
+
{
|
995
|
+
"key": "game:mode",
|
996
|
+
"value": "competitive"
|
997
|
+
},
|
998
|
+
{
|
999
|
+
"key": "game:mapgroupname",
|
1000
|
+
"value": "mg_de_mirage"
|
1001
|
+
},
|
1002
|
+
{
|
1003
|
+
"key": "game:map",
|
1004
|
+
"value": "de_mirage"
|
922
1005
|
},
|
923
|
-
|
924
|
-
|
1006
|
+
{
|
1007
|
+
"key": "game:server",
|
1008
|
+
"value": "kv"
|
925
1009
|
},
|
926
|
-
|
927
|
-
|
1010
|
+
{
|
1011
|
+
"key": "watch",
|
1012
|
+
"value": "1"
|
928
1013
|
},
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
1014
|
+
{
|
1015
|
+
"key": "steam_player_group",
|
1016
|
+
"value": "2134948645"
|
1017
|
+
},
|
1018
|
+
{
|
1019
|
+
"key": "game:score",
|
1020
|
+
"value": "[ 3 : 6 ]"
|
1021
|
+
}
|
1022
|
+
],
|
1023
|
+
"friendid": "76561199405834425",
|
1024
|
+
"persona_state": 1,
|
1025
|
+
"game_played_app_id": 730,
|
1026
|
+
"game_server_ip": null,
|
1027
|
+
"game_server_port": null,
|
1028
|
+
"persona_state_flags": 1,
|
1029
|
+
"online_session_instances": 1,
|
1030
|
+
"persona_set_by_user": null,
|
1031
|
+
"player_name": "quỷ súng",
|
1032
|
+
"query_port": null,
|
1033
|
+
"steamid_source": "0",
|
1034
|
+
"avatar_hash": {
|
1035
|
+
"type": "Buffer",
|
1036
|
+
"data": [
|
1037
|
+
23,
|
1038
|
+
163,
|
1039
|
+
216,
|
1040
|
+
209,
|
1041
|
+
236,
|
1042
|
+
179,
|
1043
|
+
73,
|
1044
|
+
228,
|
1045
|
+
225,
|
1046
|
+
30,
|
1047
|
+
48,
|
1048
|
+
190,
|
1049
|
+
192,
|
1050
|
+
170,
|
1051
|
+
177,
|
1052
|
+
246,
|
1053
|
+
139,
|
1054
|
+
71,
|
1055
|
+
122,
|
1056
|
+
205
|
1057
|
+
]
|
1058
|
+
},
|
1059
|
+
"last_logoff": 1683950268,
|
1060
|
+
"last_logon": 1683950281,
|
1061
|
+
"last_seen_online": 1683950268,
|
1062
|
+
"clan_rank": null,
|
1063
|
+
"game_name": "",
|
1064
|
+
"gameid": "730",
|
1065
|
+
"game_data_blob": {
|
1066
|
+
"type": "Buffer",
|
1067
|
+
"data": []
|
1068
|
+
},
|
1069
|
+
"clan_data": null,
|
1070
|
+
"clan_tag": null,
|
1071
|
+
"broadcast_id": "0",
|
1072
|
+
"game_lobby_id": "0",
|
1073
|
+
"watching_broadcast_accountid": null,
|
1074
|
+
"watching_broadcast_appid": null,
|
1075
|
+
"watching_broadcast_viewers": null,
|
1076
|
+
"watching_broadcast_title": null,
|
1077
|
+
"is_community_banned": null,
|
1078
|
+
"player_name_pending_review": null,
|
1079
|
+
"avatar_pending_review": null
|
1080
|
+
}
|
1081
|
+
},
|
1082
|
+
async friendMessage(data) {
|
1083
|
+
if (!data) return
|
1084
|
+
data.message_no_bbcode = data.message_no_bbcode?.replaceAll(`ː`, `:`)
|
1085
|
+
data.message = data.message?.replaceAll(`ː`, `:`)
|
1086
|
+
const example = {
|
1087
|
+
"steamid_friend": {
|
1088
|
+
"universe": 1,
|
1089
|
+
"type": 1,
|
1090
|
+
"instance": 1,
|
1091
|
+
"accountid": 1080136620
|
1092
|
+
},
|
1093
|
+
"chat_entry_type": 1,
|
1094
|
+
"from_limited_account": false,
|
1095
|
+
"message": "xxx",
|
1096
|
+
"ordinal": 0,
|
1097
|
+
"local_echo": false,
|
1098
|
+
"message_no_bbcode": "xxx",
|
1099
|
+
"low_priority": false,
|
1100
|
+
"server_timestamp": "2023-05-14T09:26:25.000Z",
|
1101
|
+
"message_bbcode_parsed": [
|
1102
|
+
"xxx"
|
1103
|
+
]
|
1104
|
+
}
|
1105
|
+
const timestamp = new Date(data.server_timestamp).getTime()
|
1106
|
+
const steamId = data.steamid_friend.getSteamID64()
|
1107
|
+
const personas = await getPersonas([steamId])
|
1108
|
+
const player_name = personas.find(p => p.id == steamId)?.player_name || ''
|
1109
|
+
const invite = [`Invited you to play a game!`, `Đã mời bạn chơi một trò chơi!`].includes(data.message_no_bbcode || data.message)
|
1110
|
+
const emotion = (data.message_no_bbcode || '').split(' ').find(m => m.startsWith(':') && m.endsWith(':'))
|
1111
|
+
|
1112
|
+
callEvent(events.friendMessage, {
|
1113
|
+
player_name,
|
1114
|
+
message: data.message_no_bbcode,
|
1115
|
+
invite,
|
1116
|
+
steamId,
|
1117
|
+
timestamp,
|
1118
|
+
from_limited_account: data.from_limited_account,
|
1119
|
+
emotion,
|
1120
|
+
})
|
1121
|
+
},
|
1122
|
+
async friendTyping(steamId, message) {
|
1123
|
+
callEvent(events.friendTyping, {
|
1124
|
+
steamId, message
|
1125
|
+
})
|
1126
|
+
},
|
1127
|
+
async playingState(playing_blocked, playing_app) {
|
1128
|
+
playingBlocked = playing_blocked
|
1129
|
+
if (playing_app === 0) {
|
1130
|
+
playing_app = null
|
1131
|
+
}
|
1132
|
+
if (playing_blocked) {//true, false
|
1133
|
+
console.log("Playing else where")
|
1134
|
+
}
|
1135
|
+
log('playingState', playing_blocked, playing_app);
|
1136
|
+
},
|
1137
|
+
async friendRelationship(sid, relationship, previousRelationship) {
|
1138
|
+
callEvent(events.friendRelationship, {steamId: sid.getSteamID64(), relationship, previousRelationship})
|
1139
|
+
switch (relationship) {
|
1140
|
+
case EFriendRelationship.None: {
|
1141
|
+
//we got unfriended.
|
1142
|
+
break
|
1143
|
+
}
|
1144
|
+
case EFriendRelationship.RequestRecipient: {
|
1145
|
+
//we got invited as a friend
|
1146
|
+
break
|
1147
|
+
}
|
1148
|
+
case EFriendRelationship.Friend: {
|
1149
|
+
//we got added as a friend
|
1150
|
+
break
|
942
1151
|
}
|
943
|
-
callGCCallback('PlayersProfile' + player?.account_id, player)
|
944
|
-
callEvent(events.playersProfile, player)
|
945
|
-
break
|
946
1152
|
}
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
})
|
957
|
-
|
1153
|
+
},
|
1154
|
+
async tradeOffers(count) {
|
1155
|
+
callEvent(events.tradeOffers, count)
|
1156
|
+
},
|
1157
|
+
async offlineMessages(count, friends) {
|
1158
|
+
callEvent(events.offlineMessages, {count, steamIdList: friends})
|
1159
|
+
},
|
1160
|
+
async tradeRequest(steamID, respond) {
|
1161
|
+
if (autoAcceptTradeRequest) {
|
1162
|
+
log(`Incoming trade request from ${steamID.getSteam3RenderedID()}, accepting`);
|
1163
|
+
respond(true);
|
1164
|
+
} else {
|
1165
|
+
log(`Incoming trade request from ${steamID.getSteam3RenderedID()}, wating`);
|
1166
|
+
}
|
1167
|
+
},
|
1168
|
+
async friendsList() {
|
1169
|
+
callEvent(events.friendsList, getFriendList())
|
1170
|
+
},
|
1171
|
+
async gifts(gid, packageid, TimeCreated, TimeExpiration, TimeSent, TimeAcked, TimeRedeemed, RecipientAddress, SenderAddress, SenderName) {
|
1172
|
+
callEvent(events.gifts, {
|
1173
|
+
gid,
|
1174
|
+
packageid,
|
1175
|
+
TimeCreated,
|
1176
|
+
TimeExpiration,
|
1177
|
+
TimeSent,
|
1178
|
+
TimeAcked,
|
1179
|
+
TimeRedeemed,
|
1180
|
+
RecipientAddress,
|
1181
|
+
SenderAddress,
|
1182
|
+
SenderName
|
1183
|
+
})
|
958
1184
|
}
|
959
|
-
}
|
1185
|
+
}
|
1186
|
+
|
1187
|
+
|
1188
|
+
// steamClient.on('lobbyInvite', (inviterID, lobbyID ) => {
|
1189
|
+
// joinLobby(lobbyID)
|
1190
|
+
// })
|
1191
|
+
|
1192
|
+
// steamClient.on('debug', (msg) => {
|
1193
|
+
// if (!["ClientPersonaState","ClientClanState"].some(c => msg.includes(c))) {
|
1194
|
+
// if(msg.startsWith("Received")){
|
1195
|
+
// console.log(`------- ${msg}`)
|
1196
|
+
// } else {
|
1197
|
+
// console.log(msg)
|
1198
|
+
// }
|
1199
|
+
// }
|
1200
|
+
// })
|
1201
|
+
|
960
1202
|
|
961
1203
|
function getECsgoGCMsgKey(_key) {
|
962
1204
|
for (let key in Protos.csgo.ECsgoGCMsg) {
|
@@ -981,246 +1223,9 @@ function SteamClient({
|
|
981
1223
|
}
|
982
1224
|
}
|
983
1225
|
|
984
|
-
|
985
|
-
steamClient.
|
986
|
-
|
987
|
-
await sendHello()
|
988
|
-
callEvent(events.loggedOn, loggedOnResponse)
|
989
|
-
if (isAutoRequestFreeLicense) {
|
990
|
-
doSetInterval(function () {
|
991
|
-
autoRequestFreeLicense(false, 50)
|
992
|
-
}, [5 * 60000, 10 * 60000], 'autoRequestFreeLicense')
|
993
|
-
}
|
994
|
-
if (autoPlay) {
|
995
|
-
await sleep(10000)
|
996
|
-
onCookie(function () {
|
997
|
-
autoGamePlay()
|
998
|
-
})
|
999
|
-
}
|
1000
|
-
})
|
1001
|
-
|
1002
|
-
|
1003
|
-
steamClient.on('user', async (steamId, data) => {
|
1004
|
-
callEvent(events.user, {steamId: steamId.getSteamID64(), data})
|
1005
|
-
const dataExample = {
|
1006
|
-
"rich_presence": [
|
1007
|
-
{
|
1008
|
-
"key": "status",
|
1009
|
-
"value": "Competitive Mirage [ 3 : 6 ]"
|
1010
|
-
},
|
1011
|
-
{
|
1012
|
-
"key": "version",
|
1013
|
-
"value": "13875"
|
1014
|
-
},
|
1015
|
-
{
|
1016
|
-
"key": "game:state",
|
1017
|
-
"value": "game"
|
1018
|
-
},
|
1019
|
-
{
|
1020
|
-
"key": "steam_display",
|
1021
|
-
"value": "#display_GameKnownMapScore"
|
1022
|
-
},
|
1023
|
-
{
|
1024
|
-
"key": "game:mode",
|
1025
|
-
"value": "competitive"
|
1026
|
-
},
|
1027
|
-
{
|
1028
|
-
"key": "game:mapgroupname",
|
1029
|
-
"value": "mg_de_mirage"
|
1030
|
-
},
|
1031
|
-
{
|
1032
|
-
"key": "game:map",
|
1033
|
-
"value": "de_mirage"
|
1034
|
-
},
|
1035
|
-
{
|
1036
|
-
"key": "game:server",
|
1037
|
-
"value": "kv"
|
1038
|
-
},
|
1039
|
-
{
|
1040
|
-
"key": "watch",
|
1041
|
-
"value": "1"
|
1042
|
-
},
|
1043
|
-
{
|
1044
|
-
"key": "steam_player_group",
|
1045
|
-
"value": "2134948645"
|
1046
|
-
},
|
1047
|
-
{
|
1048
|
-
"key": "game:score",
|
1049
|
-
"value": "[ 3 : 6 ]"
|
1050
|
-
}
|
1051
|
-
],
|
1052
|
-
"friendid": "76561199405834425",
|
1053
|
-
"persona_state": 1,
|
1054
|
-
"game_played_app_id": 730,
|
1055
|
-
"game_server_ip": null,
|
1056
|
-
"game_server_port": null,
|
1057
|
-
"persona_state_flags": 1,
|
1058
|
-
"online_session_instances": 1,
|
1059
|
-
"persona_set_by_user": null,
|
1060
|
-
"player_name": "quỷ súng",
|
1061
|
-
"query_port": null,
|
1062
|
-
"steamid_source": "0",
|
1063
|
-
"avatar_hash": {
|
1064
|
-
"type": "Buffer",
|
1065
|
-
"data": [
|
1066
|
-
23,
|
1067
|
-
163,
|
1068
|
-
216,
|
1069
|
-
209,
|
1070
|
-
236,
|
1071
|
-
179,
|
1072
|
-
73,
|
1073
|
-
228,
|
1074
|
-
225,
|
1075
|
-
30,
|
1076
|
-
48,
|
1077
|
-
190,
|
1078
|
-
192,
|
1079
|
-
170,
|
1080
|
-
177,
|
1081
|
-
246,
|
1082
|
-
139,
|
1083
|
-
71,
|
1084
|
-
122,
|
1085
|
-
205
|
1086
|
-
]
|
1087
|
-
},
|
1088
|
-
"last_logoff": 1683950268,
|
1089
|
-
"last_logon": 1683950281,
|
1090
|
-
"last_seen_online": 1683950268,
|
1091
|
-
"clan_rank": null,
|
1092
|
-
"game_name": "",
|
1093
|
-
"gameid": "730",
|
1094
|
-
"game_data_blob": {
|
1095
|
-
"type": "Buffer",
|
1096
|
-
"data": []
|
1097
|
-
},
|
1098
|
-
"clan_data": null,
|
1099
|
-
"clan_tag": null,
|
1100
|
-
"broadcast_id": "0",
|
1101
|
-
"game_lobby_id": "0",
|
1102
|
-
"watching_broadcast_accountid": null,
|
1103
|
-
"watching_broadcast_appid": null,
|
1104
|
-
"watching_broadcast_viewers": null,
|
1105
|
-
"watching_broadcast_title": null,
|
1106
|
-
"is_community_banned": null,
|
1107
|
-
"player_name_pending_review": null,
|
1108
|
-
"avatar_pending_review": null
|
1109
|
-
}
|
1110
|
-
})
|
1111
|
-
|
1112
|
-
steamClient.chat.on('friendMessage', async (data) => {
|
1113
|
-
if (!data) return
|
1114
|
-
data.message_no_bbcode = data.message_no_bbcode?.replaceAll(`ː`,`:`)
|
1115
|
-
data.message = data.message?.replaceAll(`ː`,`:`)
|
1116
|
-
const example = {
|
1117
|
-
"steamid_friend": {
|
1118
|
-
"universe": 1,
|
1119
|
-
"type": 1,
|
1120
|
-
"instance": 1,
|
1121
|
-
"accountid": 1080136620
|
1122
|
-
},
|
1123
|
-
"chat_entry_type": 1,
|
1124
|
-
"from_limited_account": false,
|
1125
|
-
"message": "xxx",
|
1126
|
-
"ordinal": 0,
|
1127
|
-
"local_echo": false,
|
1128
|
-
"message_no_bbcode": "xxx",
|
1129
|
-
"low_priority": false,
|
1130
|
-
"server_timestamp": "2023-05-14T09:26:25.000Z",
|
1131
|
-
"message_bbcode_parsed": [
|
1132
|
-
"xxx"
|
1133
|
-
]
|
1134
|
-
}
|
1135
|
-
const timestamp = new Date(data.server_timestamp).getTime()
|
1136
|
-
const steamId = data.steamid_friend.getSteamID64()
|
1137
|
-
const personas = await getPersonas([steamId])
|
1138
|
-
const player_name = personas.find(p => p.id == steamId)?.player_name || ''
|
1139
|
-
const invite = [`Invited you to play a game!`, `Đã mời bạn chơi một trò chơi!`].includes(data.message_no_bbcode || data.message)
|
1140
|
-
const emotion = (data.message_no_bbcode || '').split(' ').find(m => m.startsWith(':') && m.endsWith(':'))
|
1141
|
-
|
1142
|
-
callEvent(events.friendMessage, {
|
1143
|
-
player_name,
|
1144
|
-
message: data.message_no_bbcode,
|
1145
|
-
invite,
|
1146
|
-
steamId,
|
1147
|
-
timestamp,
|
1148
|
-
from_limited_account: data.from_limited_account,
|
1149
|
-
emotion,
|
1150
|
-
})
|
1151
|
-
|
1152
|
-
});
|
1153
|
-
|
1154
|
-
steamClient.on('friendTyping', async function (steamId, message) {
|
1155
|
-
callEvent(events.friendTyping, {
|
1156
|
-
steamId, message
|
1157
|
-
})
|
1158
|
-
});
|
1159
|
-
|
1160
|
-
steamClient.on('playingState', async function (playing_blocked, playing_app) {
|
1161
|
-
playingBlocked = playing_blocked
|
1162
|
-
if (playing_app === 0) {
|
1163
|
-
playing_app = null
|
1164
|
-
}
|
1165
|
-
if (playing_blocked) {//true, false
|
1166
|
-
console.log("Playing else where")
|
1167
|
-
}
|
1168
|
-
log('playingState', playing_blocked, playing_app);
|
1169
|
-
});
|
1170
|
-
|
1171
|
-
steamClient.on('friendRelationship', async function (sid, relationship, previousRelationship) {
|
1172
|
-
callEvent(events.friendRelationship, {steamId: sid.getSteamID64(), relationship, previousRelationship})
|
1173
|
-
switch (relationship) {
|
1174
|
-
case EFriendRelationship.None: {
|
1175
|
-
//we got unfriended.
|
1176
|
-
break
|
1177
|
-
}
|
1178
|
-
case EFriendRelationship.RequestRecipient: {
|
1179
|
-
//we got invited as a friend
|
1180
|
-
break
|
1181
|
-
}
|
1182
|
-
case EFriendRelationship.Friend: {
|
1183
|
-
//we got added as a friend
|
1184
|
-
break
|
1185
|
-
}
|
1186
|
-
}
|
1187
|
-
});
|
1188
|
-
|
1189
|
-
steamClient.on('tradeOffers', async function (count) {
|
1190
|
-
callEvent(events.tradeOffers, count)
|
1191
|
-
});
|
1192
|
-
|
1193
|
-
steamClient.on('offlineMessages', async function (count, friends) {
|
1194
|
-
callEvent(events.offlineMessages, {count, steamIdList: friends})
|
1195
|
-
});
|
1196
|
-
|
1197
|
-
steamClient.on('tradeRequest', async function (steamID, respond) {
|
1198
|
-
if (autoAcceptTradeRequest) {
|
1199
|
-
log(`Incoming trade request from ${steamID.getSteam3RenderedID()}, accepting`);
|
1200
|
-
respond(true);
|
1201
|
-
} else {
|
1202
|
-
log(`Incoming trade request from ${steamID.getSteam3RenderedID()}, wating`);
|
1203
|
-
}
|
1204
|
-
});
|
1205
|
-
|
1206
|
-
steamClient.on('friendsList', async function () {
|
1207
|
-
callEvent(events.friendsList, getFriendList())
|
1208
|
-
});
|
1209
|
-
|
1210
|
-
steamClient.on('gifts', async function (gid, packageid, TimeCreated, TimeExpiration, TimeSent, TimeAcked, TimeRedeemed, RecipientAddress, SenderAddress, SenderName) {
|
1211
|
-
callEvent(events.gifts, {
|
1212
|
-
gid,
|
1213
|
-
packageid,
|
1214
|
-
TimeCreated,
|
1215
|
-
TimeExpiration,
|
1216
|
-
TimeSent,
|
1217
|
-
TimeAcked,
|
1218
|
-
TimeRedeemed,
|
1219
|
-
RecipientAddress,
|
1220
|
-
SenderAddress,
|
1221
|
-
SenderName
|
1222
|
-
})
|
1223
|
-
});
|
1226
|
+
for (const name in events) {
|
1227
|
+
steamClient.on(name, events[name])
|
1228
|
+
}
|
1224
1229
|
}
|
1225
1230
|
|
1226
1231
|
function getFriendList() {
|
@@ -1398,7 +1403,7 @@ function SteamClient({
|
|
1398
1403
|
}
|
1399
1404
|
|
1400
1405
|
async function sendFriendMessage(steamId, message) {
|
1401
|
-
while (sendMessageTimestamp && new Date().getTime() - sendMessageTimestamp < 1100){
|
1406
|
+
while (sendMessageTimestamp && new Date().getTime() - sendMessageTimestamp < 1100) {
|
1402
1407
|
await sleep(500)
|
1403
1408
|
}
|
1404
1409
|
|
@@ -1411,7 +1416,7 @@ function SteamClient({
|
|
1411
1416
|
})
|
1412
1417
|
|
1413
1418
|
if (result?.[1]?.server_timestamp) {
|
1414
|
-
sendMessageTimestamp= new Date().getTime()
|
1419
|
+
sendMessageTimestamp = new Date().getTime()
|
1415
1420
|
return result?.[1]
|
1416
1421
|
} else if (result?.[0]?.message?.includes?.("RateLimitExceeded")) {
|
1417
1422
|
await sleep(5000)
|
@@ -1698,7 +1703,7 @@ function SteamClient({
|
|
1698
1703
|
})
|
1699
1704
|
},
|
1700
1705
|
onAnyEvent,
|
1701
|
-
async redeemGift(gid){
|
1706
|
+
async redeemGift(gid) {
|
1702
1707
|
try {
|
1703
1708
|
const community = new SteamCommunity();
|
1704
1709
|
let cookies = await getCookiesWait();
|
@@ -1707,13 +1712,13 @@ function SteamClient({
|
|
1707
1712
|
} catch (e) {
|
1708
1713
|
}
|
1709
1714
|
},
|
1710
|
-
async requestFreeLicense(...args){
|
1715
|
+
async requestFreeLicense(...args) {
|
1711
1716
|
try {
|
1712
1717
|
return await steamClient.requestFreeLicense(...args)
|
1713
1718
|
} catch (e) {
|
1714
1719
|
}
|
1715
1720
|
},
|
1716
|
-
getSteamId(){
|
1721
|
+
getSteamId() {
|
1717
1722
|
try {
|
1718
1723
|
return steamClient.steamID.getSteamID64()
|
1719
1724
|
} catch (e) {
|
@@ -1721,6 +1726,9 @@ function SteamClient({
|
|
1721
1726
|
},
|
1722
1727
|
getLastTimePartyRegister(){
|
1723
1728
|
return lastTimePartyRegister
|
1729
|
+
},
|
1730
|
+
getLastTimePartySearch(){
|
1731
|
+
return lastTimePartySearch
|
1724
1732
|
}
|
1725
1733
|
}
|
1726
1734
|
}
|