steamutils 1.2.13 → 1.2.14
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 +12 -0
- package/index.js +3 -0
- 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
@@ -11,6 +11,7 @@ import path from "path";
|
|
11
11
|
import SteamUtils from "./index.js";
|
12
12
|
import {v4 as uuidv4} from 'uuid';
|
13
13
|
import EFriendRelationship from "steam-user/enums/EFriendRelationship.js";
|
14
|
+
import SteamCommunity from "steamcommunity";
|
14
15
|
|
15
16
|
const __filename = fileURLToPath(import.meta.url);
|
16
17
|
const __dirname = path.dirname(__filename);
|
@@ -93,6 +94,7 @@ function SteamClient({
|
|
93
94
|
let prime = null
|
94
95
|
let state = 'Offline'//InGame, Online
|
95
96
|
let isLogOff = false
|
97
|
+
let playingBlocked = null
|
96
98
|
const richPresence = {}
|
97
99
|
|
98
100
|
const events = {
|
@@ -924,6 +926,7 @@ function SteamClient({
|
|
924
926
|
});
|
925
927
|
|
926
928
|
steamClient.on('playingState', async function (playing_blocked, playing_app) {
|
929
|
+
playingBlocked = playing_blocked
|
927
930
|
if(playing_app === 0){
|
928
931
|
playing_app = null
|
929
932
|
}
|
@@ -971,6 +974,12 @@ function SteamClient({
|
|
971
974
|
steamClient.on('friendsList', async function () {
|
972
975
|
callEvent(events.friendsList, getFriendList())
|
973
976
|
});
|
977
|
+
|
978
|
+
steamClient.on('gifts', async function (gid, packageid, TimeCreated, TimeExpiration, TimeSent, TimeAcked, TimeRedeemed, RecipientAddress, SenderAddress, SenderName) {
|
979
|
+
const community = new SteamCommunity();
|
980
|
+
community.setCookies(await getCookiesWait())
|
981
|
+
community.redeemGift(gid)
|
982
|
+
});
|
974
983
|
}
|
975
984
|
|
976
985
|
function getFriendList() {
|
@@ -1423,6 +1432,9 @@ function SteamClient({
|
|
1423
1432
|
},
|
1424
1433
|
getFriendList,
|
1425
1434
|
logOff,
|
1435
|
+
isPlayingBlocked(){
|
1436
|
+
return playingBlocked
|
1437
|
+
}
|
1426
1438
|
}
|
1427
1439
|
}
|
1428
1440
|
|
package/index.js
CHANGED