steamutils 1.0.62 → 1.0.64
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/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/steamutils.iml +1 -1
- package/.idea/vcs.xml +1 -1
- package/SteamClient.js +15 -21
- package/package.json +1 -1
package/.idea/steamutils.iml
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
<module type="WEB_MODULE" version="4">
|
3
3
|
<component name="NewModuleRootManager">
|
4
4
|
<content url="file://$MODULE_DIR$">
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
6
5
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
7
7
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
8
8
|
</content>
|
9
9
|
<orderEntry type="inheritedJdk" />
|
package/.idea/vcs.xml
CHANGED
package/SteamClient.js
CHANGED
@@ -10,6 +10,7 @@ import {fileURLToPath} from "url";
|
|
10
10
|
import path from "path";
|
11
11
|
import SteamUtils from "./index.js";
|
12
12
|
import {v4 as uuidv4} from 'uuid';
|
13
|
+
import { steamID } from 'steam-user/components/helpers.js'
|
13
14
|
|
14
15
|
const __filename = fileURLToPath(import.meta.url);
|
15
16
|
const __dirname = path.dirname(__filename);
|
@@ -783,27 +784,20 @@ function SteamClient({
|
|
783
784
|
]
|
784
785
|
}
|
785
786
|
const timestamp = new Date(data.server_timestamp).getTime()
|
786
|
-
const
|
787
|
-
const personas = await getPersonas([
|
788
|
-
const player_name = personas
|
789
|
-
log('friendMessage', data)
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
callEvent(events.friendMessage, {
|
801
|
-
message: data.message_no_bbcode,
|
802
|
-
player_name,
|
803
|
-
sid64,
|
804
|
-
timestamp,
|
805
|
-
})
|
806
|
-
}
|
787
|
+
const steamId = data.steamid_friend.getSteamID64()
|
788
|
+
const personas = await getPersonas([steamId])
|
789
|
+
const player_name = personas.find(p => p.id == steamID)?.player_name || ''
|
790
|
+
log('friendMessage', data)
|
791
|
+
const invite = [`Inited you to play a game!`, `Đã mời bạn chơi một trò chơi!`].includes(data.message_no_bbcode || data.message)
|
792
|
+
|
793
|
+
callEvent(events.friendMessage, {
|
794
|
+
player_name,
|
795
|
+
message: data.message_no_bbcode,
|
796
|
+
invite,
|
797
|
+
steamId,
|
798
|
+
timestamp,
|
799
|
+
})
|
800
|
+
|
807
801
|
});
|
808
802
|
|
809
803
|
steamClient.on('friendTyping', async function (steamID, message) {
|