steamutils 1.2.13 → 1.2.15

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.
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -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
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project version="4">
3
3
  <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
4
+ <mapping directory="" vcs="Git" />
5
5
  </component>
6
6
  </project>
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 = {
@@ -904,7 +906,7 @@ function SteamClient({
904
906
  const personas = await getPersonas([steamId])
905
907
  const player_name = personas.find(p => p.id == steamId)?.player_name || ''
906
908
  log('friendMessage', data)
907
- 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)
909
+ const invite = [`Invited you to play a game!`, `Đã mời bạn chơi một trò chơi!`].includes(data.message_no_bbcode || data.message)
908
910
 
909
911
  callEvent(events.friendMessage, {
910
912
  player_name,
@@ -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
@@ -1216,6 +1216,107 @@ class SteamUser {
1216
1216
  }
1217
1217
  }
1218
1218
 
1219
+ static async getAppDetail (appIds) {
1220
+ if(Array.isArray(appIds)){
1221
+ appIds = appIds.join(",")
1222
+ }
1223
+ let result = await request(`https://store.steampowered.com/api/appdetails?appids=${appIds}&hl=en`)
1224
+ return result?.data
1225
+ const resultExample = {
1226
+ "730": {
1227
+ "success": true, "data": {
1228
+ "type": "game",
1229
+ "name": "Counter-Strike: Global Offensive",
1230
+ "steam_appid": 730,
1231
+ "required_age": 0,
1232
+ "is_free": true,
1233
+ "controller_support": "full",
1234
+ "detailed_description": "Counter-Strike: Global Offensive (CS: GO) expands upon the team-based action gameplay that it pioneered when it was launched 19 years ago.<br \/>\r\n<br \/>\r\nCS: GO features new maps, characters, weapons, and game modes, and delivers updated versions of the classic CS content (de_dust2, etc.).<br \/>\r\n<br \/>\r\n&quot;Counter-Strike took the gaming industry by surprise when the unlikely MOD became the most played online PC action game in the world almost immediately after its release in August 1999,&quot; said Doug Lombardi at Valve. &quot;For the past 12 years, it has continued to be one of the most-played games in the world, headline competitive gaming tournaments and selling over 25 million units worldwide across the franchise. CS: GO promises to expand on CS' award-winning gameplay and deliver it to gamers on the PC as well as the next gen consoles and the Mac.&quot;",
1235
+ "about_the_game": "Counter-Strike: Global Offensive (CS: GO) expands upon the team-based action gameplay that it pioneered when it was launched 19 years ago.<br \/>\r\n<br \/>\r\nCS: GO features new maps, characters, weapons, and game modes, and delivers updated versions of the classic CS content (de_dust2, etc.).<br \/>\r\n<br \/>\r\n&quot;Counter-Strike took the gaming industry by surprise when the unlikely MOD became the most played online PC action game in the world almost immediately after its release in August 1999,&quot; said Doug Lombardi at Valve. &quot;For the past 12 years, it has continued to be one of the most-played games in the world, headline competitive gaming tournaments and selling over 25 million units worldwide across the franchise. CS: GO promises to expand on CS' award-winning gameplay and deliver it to gamers on the PC as well as the next gen consoles and the Mac.&quot;",
1236
+ "short_description": "Counter-Strike: Global Offensive (CS: GO) expands upon the team-based action gameplay that it pioneered when it was launched 19 years ago. CS: GO features new maps, characters, weapons, and game modes, and delivers updated versions of the classic CS content (de_dust2, etc.).",
1237
+ "supported_languages": "Czech, Danish, Dutch, English<strong>*<\/strong>, Finnish, French, German, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese - Portugal, Portuguese - Brazil, Romanian, Russian, Simplified Chinese, Spanish - Spain, Swedish, Thai, Traditional Chinese, Turkish, Bulgarian, Ukrainian, Greek, Spanish - Latin America, Vietnamese<br><strong>*<\/strong>languages with full audio support",
1238
+ "header_image": "https:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/730\/header.jpg?t=1683566799",
1239
+ "capsule_image": "https:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/730\/capsule_231x87.jpg?t=1683566799",
1240
+ "capsule_imagev5": "https:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/730\/capsule_184x69.jpg?t=1683566799",
1241
+ "website": "http:\/\/blog.counter-strike.net\/",
1242
+ "pc_requirements": {"minimum": "<strong>Minimum:<\/strong><br><ul class=\"bb_ul\"><li><strong>OS:<\/strong> Windows® 7\/Vista\/XP<br><\/li><li><strong>Processor:<\/strong> Intel® Core™ 2 Duo E6600 or AMD Phenom™ X3 8750 processor or better<br><\/li><li><strong>Memory:<\/strong> 2 GB RAM<br><\/li><li><strong>Graphics:<\/strong> Video card must be 256 MB or more and should be a DirectX 9-compatible with support for Pixel Shader 3.0<br><\/li><li><strong>DirectX:<\/strong> Version 9.0c<br><\/li><li><strong>Storage:<\/strong> 15 GB available space<\/li><\/ul>"},
1243
+ "mac_requirements": {"minimum": "<strong>Minimum:<\/strong><br><ul class=\"bb_ul\"><li><strong>OS:<\/strong> MacOS X 10.11 (El Capitan) or later<br><\/li><li><strong>Processor:<\/strong> Intel Core Duo Processor (2GHz or better)<br><\/li><li><strong>Memory:<\/strong> 2 GB RAM<br><\/li><li><strong>Graphics:<\/strong> ATI Radeon HD 2400 or better \/ NVIDIA 8600M or better<br><\/li><li><strong>Storage:<\/strong> 15 GB available space<\/li><\/ul>"},
1244
+ "linux_requirements": {"minimum": "<strong>Minimum:<\/strong><br><ul class=\"bb_ul\"><li><strong>OS:<\/strong> Ubuntu 12.04<br><\/li><li><strong>Processor:<\/strong> 64-bit Dual core from Intel or AMD at 2.8 GHz<br><\/li><li><strong>Memory:<\/strong> 4 GB RAM<br><\/li><li><strong>Graphics:<\/strong> NVIDIA GeForce 8600\/9600GT, ATI\/AMD Radeon HD2600\/3600 (Graphic Drivers: NVIDIA 310, AMD 12.11), OpenGL 2.1<br><\/li><li><strong>Storage:<\/strong> 15 GB available space<br><\/li><li><strong>Sound Card:<\/strong> OpenAL Compatible Sound Card<\/li><\/ul>"},
1245
+ "developers": ["Valve", "Hidden Path Entertainment"],
1246
+ "publishers": ["Valve"],
1247
+ "packages": [329385, 298963, 54029],
1248
+ "package_groups": [{
1249
+ "name": "default",
1250
+ "title": "Buy Counter-Strike: Global Offensive",
1251
+ "description": "",
1252
+ "selection_text": "Select a purchase option",
1253
+ "save_text": "",
1254
+ "display_type": 0,
1255
+ "is_recurring_subscription": "false",
1256
+ "subs": [{
1257
+ "packageid": 298963,
1258
+ "percent_savings_text": " ",
1259
+ "percent_savings": 0,
1260
+ "option_text": "Counter-Strike: Global Offensive - Free",
1261
+ "option_description": "",
1262
+ "can_get_free_license": "0",
1263
+ "is_free_license": true,
1264
+ "price_in_cents_with_discount": 0
1265
+ }, {
1266
+ "packageid": 54029,
1267
+ "percent_savings_text": " ",
1268
+ "percent_savings": 0,
1269
+ "option_text": "Prime Status Upgrade - 375.000₫",
1270
+ "option_description": "",
1271
+ "can_get_free_license": "0",
1272
+ "is_free_license": false,
1273
+ "price_in_cents_with_discount": 37500000
1274
+ }]
1275
+ }],
1276
+ "platforms": {"windows": true, "mac": true, "linux": true},
1277
+ "metacritic": {
1278
+ "score": 83,
1279
+ "url": "https:\/\/www.metacritic.com\/game\/pc\/counter-strike-global-offensive?ftag=MCD-06-10aaa1f"
1280
+ },
1281
+ "categories": [{"id": 1, "description": "Multi-player"}],
1282
+ "genres": [{"id": "1", "description": "Action"}],
1283
+ "screenshots": [{
1284
+ "id": 0,
1285
+ "path_thumbnail": "https:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/730\/ss_118cb022b9a43f70d2e5a2df7427f29088b6b191.600x338.jpg?t=1683566799",
1286
+ "path_full": "https:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/730\/ss_118cb022b9a43f70d2e5a2df7427f29088b6b191.1920x1080.jpg?t=1683566799"
1287
+ }],
1288
+ "movies": [{
1289
+ "id": 81958,
1290
+ "name": "CS:GO Trailer Long",
1291
+ "thumbnail": "https:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/81958\/movie.293x165.jpg?t=1554409259",
1292
+ "webm": {
1293
+ "480": "http:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/81958\/movie480.webm?t=1554409259",
1294
+ "max": "http:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/81958\/movie_max.webm?t=1554409259"
1295
+ },
1296
+ "mp4": {
1297
+ "480": "http:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/81958\/movie480.mp4?t=1554409259",
1298
+ "max": "http:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/81958\/movie_max.mp4?t=1554409259"
1299
+ },
1300
+ "highlight": true
1301
+ }],
1302
+ "recommendations": {"total": 3833937},
1303
+ "achievements": {
1304
+ "total": 167,
1305
+ "highlighted": [{
1306
+ "name": "Someone Set Up Us The Bomb",
1307
+ "path": "https:\/\/cdn.akamai.steamstatic.com\/steamcommunity\/public\/images\/apps\/730\/9f60ea3c56b4ab248ab598bbd62568b953116301.jpg"
1308
+ }]
1309
+ },
1310
+ "release_date": {"coming_soon": false, "date": "22 Aug, 2012"},
1311
+ "support_info": {"url": "", "email": ""},
1312
+ "background": "https:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/730\/page_bg_generated_v6b.jpg?t=1683566799",
1313
+ "background_raw": "https:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/730\/page_bg_generated.jpg?t=1683566799",
1314
+ "content_descriptors": {"ids": [2, 5], "notes": "Includes intense violence and blood."}
1315
+ }
1316
+ }
1317
+ }
1318
+ }
1319
+
1219
1320
  static async GetCurrentVersion (appID) {
1220
1321
  for (let i = 0; i < 10; i++) {
1221
1322
  try {
@@ -5408,6 +5509,9 @@ class SteamUser {
5408
5509
  case "Got an item drop": {
5409
5510
  break
5410
5511
  }
5512
+ case "Random item drop": {
5513
+ break
5514
+ }
5411
5515
  case "Purchased a gift": {
5412
5516
  break
5413
5517
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.4.0",