steamutils 1.1.56 → 1.1.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 +22 -2
- package/package.json +1 -1
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 EFriendRelationship from "steam-user/enums/EFriendRelationship.js";
|
13
14
|
|
14
15
|
const __filename = fileURLToPath(import.meta.url);
|
15
16
|
const __dirname = path.dirname(__filename);
|
@@ -100,6 +101,7 @@ function SteamClient({
|
|
100
101
|
disconnected: [],
|
101
102
|
error: [],
|
102
103
|
playersProfile: [],
|
104
|
+
partyInvite: [],
|
103
105
|
}
|
104
106
|
|
105
107
|
const gcCallback = {}
|
@@ -416,7 +418,8 @@ function SteamClient({
|
|
416
418
|
if (player_name === undefined) {
|
417
419
|
log(sid64, personas);
|
418
420
|
}
|
419
|
-
|
421
|
+
callEvent(events.partyInvite, {player_name, steamId: sid64})
|
422
|
+
// log(player_name, `https://steamcommunity.com/profiles/${sid64}`);
|
420
423
|
// joinLobby(msg.lobbyid, msg.accountid)
|
421
424
|
break
|
422
425
|
}
|
@@ -446,7 +449,7 @@ function SteamClient({
|
|
446
449
|
break
|
447
450
|
}
|
448
451
|
default: {
|
449
|
-
log("cache_object.type_id", cache_object.type_id);
|
452
|
+
// log("cache_object.type_id", cache_object.type_id);
|
450
453
|
}
|
451
454
|
}
|
452
455
|
}
|
@@ -879,6 +882,23 @@ function SteamClient({
|
|
879
882
|
}
|
880
883
|
log('playingState', playing_blocked, playing_app);
|
881
884
|
});
|
885
|
+
|
886
|
+
steamClient.on('friendRelationship', async function (sid, relationship, previousRelationship) {
|
887
|
+
switch (relationship) {
|
888
|
+
case EFriendRelationship.None: {
|
889
|
+
//we got unfriended.
|
890
|
+
break
|
891
|
+
}
|
892
|
+
case EFriendRelationship.RequestRecipient: {
|
893
|
+
//we got invited as a friend
|
894
|
+
break
|
895
|
+
}
|
896
|
+
case EFriendRelationship.Friend: {
|
897
|
+
//we got added as a friend
|
898
|
+
break
|
899
|
+
}
|
900
|
+
}
|
901
|
+
});
|
882
902
|
}
|
883
903
|
|
884
904
|
function sendFriendTyping(steamId, callback) {
|