steamutils 1.1.10 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
- package/.idea/steamutils.iml +1 -1
- package/.idea/vcs.xml +1 -1
- package/SteamClient.js +4 -5
- package/package.json +2 -1
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
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$/.tmp" />
|
6
5
|
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
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,7 +10,6 @@ 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'
|
14
13
|
|
15
14
|
const __filename = fileURLToPath(import.meta.url);
|
16
15
|
const __dirname = path.dirname(__filename);
|
@@ -239,7 +238,7 @@ function SteamClient({
|
|
239
238
|
}
|
240
239
|
|
241
240
|
async function getPersonas(steamIDs) {
|
242
|
-
steamIDs = steamIDs.map(
|
241
|
+
steamIDs = steamIDs.map(steamId => steamId instanceof SteamID ? steamId.getSteamID64() : steamId)
|
243
242
|
const notCachesteamIDs = steamIDs.filter(id => !PersonasCache.some(p => p.id == id))
|
244
243
|
const cachedPersonas = PersonasCache.filter(p => steamIDs.includes(p.id))
|
245
244
|
|
@@ -845,7 +844,7 @@ function SteamClient({
|
|
845
844
|
const timestamp = new Date(data.server_timestamp).getTime()
|
846
845
|
const steamId = data.steamid_friend.getSteamID64()
|
847
846
|
const personas = await getPersonas([steamId])
|
848
|
-
const player_name = personas.find(p => p.id ==
|
847
|
+
const player_name = personas.find(p => p.id == steamId)?.player_name || ''
|
849
848
|
log('friendMessage', data)
|
850
849
|
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)
|
851
850
|
|
@@ -859,9 +858,9 @@ function SteamClient({
|
|
859
858
|
|
860
859
|
});
|
861
860
|
|
862
|
-
steamClient.on('friendTyping', async function (
|
861
|
+
steamClient.on('friendTyping', async function (steamId, message) {
|
863
862
|
callEvent(events.friendTyping, {
|
864
|
-
|
863
|
+
steamId, message
|
865
864
|
})
|
866
865
|
});
|
867
866
|
|
package/package.json
CHANGED