steamutils 1.0.57 → 1.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SteamClient.js +113 -2
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -88,6 +88,7 @@ function SteamClient({
|
|
88
88
|
let prime = null
|
89
89
|
|
90
90
|
const events = {
|
91
|
+
user: [],
|
91
92
|
loggedOn: [],
|
92
93
|
csgoOnline: [],
|
93
94
|
webSession: [],
|
@@ -639,6 +640,116 @@ function SteamClient({
|
|
639
640
|
}
|
640
641
|
})
|
641
642
|
|
643
|
+
|
644
|
+
steamClient.on('user', async (steamId, data) => {
|
645
|
+
callEvent(events.user, data)
|
646
|
+
const dataExample = {
|
647
|
+
"rich_presence": [
|
648
|
+
{
|
649
|
+
"key": "status",
|
650
|
+
"value": "Competitive Mirage [ 3 : 6 ]"
|
651
|
+
},
|
652
|
+
{
|
653
|
+
"key": "version",
|
654
|
+
"value": "13875"
|
655
|
+
},
|
656
|
+
{
|
657
|
+
"key": "game:state",
|
658
|
+
"value": "game"
|
659
|
+
},
|
660
|
+
{
|
661
|
+
"key": "steam_display",
|
662
|
+
"value": "#display_GameKnownMapScore"
|
663
|
+
},
|
664
|
+
{
|
665
|
+
"key": "game:mode",
|
666
|
+
"value": "competitive"
|
667
|
+
},
|
668
|
+
{
|
669
|
+
"key": "game:mapgroupname",
|
670
|
+
"value": "mg_de_mirage"
|
671
|
+
},
|
672
|
+
{
|
673
|
+
"key": "game:map",
|
674
|
+
"value": "de_mirage"
|
675
|
+
},
|
676
|
+
{
|
677
|
+
"key": "game:server",
|
678
|
+
"value": "kv"
|
679
|
+
},
|
680
|
+
{
|
681
|
+
"key": "watch",
|
682
|
+
"value": "1"
|
683
|
+
},
|
684
|
+
{
|
685
|
+
"key": "steam_player_group",
|
686
|
+
"value": "2134948645"
|
687
|
+
},
|
688
|
+
{
|
689
|
+
"key": "game:score",
|
690
|
+
"value": "[ 3 : 6 ]"
|
691
|
+
}
|
692
|
+
],
|
693
|
+
"friendid": "76561199405834425",
|
694
|
+
"persona_state": 1,
|
695
|
+
"game_played_app_id": 730,
|
696
|
+
"game_server_ip": null,
|
697
|
+
"game_server_port": null,
|
698
|
+
"persona_state_flags": 1,
|
699
|
+
"online_session_instances": 1,
|
700
|
+
"persona_set_by_user": null,
|
701
|
+
"player_name": "quỷ súng",
|
702
|
+
"query_port": null,
|
703
|
+
"steamid_source": "0",
|
704
|
+
"avatar_hash": {
|
705
|
+
"type": "Buffer",
|
706
|
+
"data": [
|
707
|
+
23,
|
708
|
+
163,
|
709
|
+
216,
|
710
|
+
209,
|
711
|
+
236,
|
712
|
+
179,
|
713
|
+
73,
|
714
|
+
228,
|
715
|
+
225,
|
716
|
+
30,
|
717
|
+
48,
|
718
|
+
190,
|
719
|
+
192,
|
720
|
+
170,
|
721
|
+
177,
|
722
|
+
246,
|
723
|
+
139,
|
724
|
+
71,
|
725
|
+
122,
|
726
|
+
205
|
727
|
+
]
|
728
|
+
},
|
729
|
+
"last_logoff": 1683950268,
|
730
|
+
"last_logon": 1683950281,
|
731
|
+
"last_seen_online": 1683950268,
|
732
|
+
"clan_rank": null,
|
733
|
+
"game_name": "",
|
734
|
+
"gameid": "730",
|
735
|
+
"game_data_blob": {
|
736
|
+
"type": "Buffer",
|
737
|
+
"data": []
|
738
|
+
},
|
739
|
+
"clan_data": null,
|
740
|
+
"clan_tag": null,
|
741
|
+
"broadcast_id": "0",
|
742
|
+
"game_lobby_id": "0",
|
743
|
+
"watching_broadcast_accountid": null,
|
744
|
+
"watching_broadcast_appid": null,
|
745
|
+
"watching_broadcast_viewers": null,
|
746
|
+
"watching_broadcast_title": null,
|
747
|
+
"is_community_banned": null,
|
748
|
+
"player_name_pending_review": null,
|
749
|
+
"avatar_pending_review": null
|
750
|
+
}
|
751
|
+
})
|
752
|
+
|
642
753
|
steamClient.chat.on('friendMessage', async (data) => {
|
643
754
|
const example = {
|
644
755
|
"steamid_friend": {
|
@@ -663,9 +774,9 @@ function SteamClient({
|
|
663
774
|
const sid64 = data.steamid_friend.getSteamID64();
|
664
775
|
const personas = await getPersonas([sid64]);
|
665
776
|
const player_name = personas[sid64]?.player_name || ''
|
666
|
-
log('friendMessage',
|
777
|
+
log('friendMessage', data);
|
667
778
|
|
668
|
-
if ([`Inited you to play a game!`, `Đã mời bạn chơi một trò chơi!`].includes(message)) {
|
779
|
+
if ([`Inited you to play a game!`, `Đã mời bạn chơi một trò chơi!`].includes(data.message)) {
|
669
780
|
callEvent(events.friendMessage, {
|
670
781
|
player_name,
|
671
782
|
message: data.message_no_bbcode,
|