steamutils 1.2.36 → 1.2.37

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
@@ -12,6 +12,7 @@ import SteamUtils from "./index.js";
12
12
  import {v4 as uuidv4} from 'uuid';
13
13
  import EFriendRelationship from "steam-user/enums/EFriendRelationship.js";
14
14
  import SteamCommunity from "steamcommunity";
15
+ import ELobbyType from "steam-user/enums/ELobbyType.js";
15
16
 
16
17
  const __filename = fileURLToPath(import.meta.url);
17
18
  const __dirname = path.dirname(__filename);
@@ -378,6 +379,50 @@ function SteamClient({
378
379
  })
379
380
  }
380
381
 
382
+ async function createLobby() {
383
+ console.log("createLobby");
384
+ steamClient.sendToGC(730, Protos.csgo.EMsg.k_EMsgClientMMSCreateLobby, null, protoEncode(Protos.csgo.CMsgClientMMSCreateLobby, {
385
+ app_id: 730,
386
+ routing_appid: 730,
387
+ max_members: 10,
388
+ lobby_type: ELobbyType.Public,
389
+ lobby_flags: 1,
390
+ cell_id: steamClient.cellID,
391
+ public_ip: {
392
+ v4: steamClient.publicIP,
393
+ },
394
+ persona_name_owner: steamClient.accountInfo.name,
395
+ metadata: null,
396
+ }))
397
+ }
398
+
399
+ async function invite2Lobby(lobbyID, steamId) {
400
+ const accountid = new SteamID(steamId).accountid;
401
+ // lobbyID = new SteamID(lobbyID).accountid;
402
+
403
+ // Protos.csgo.EMsg.k_EMsgGCHInviteUserToLobby
404
+ // Protos.csgo.EMsg.k_EMsgClientMMSInviteToLobby
405
+ steamClient.sendToGC(730, Protos.csgo.EMsg.k_EMsgClientMMSInviteToLobby, {}, protoEncode(Protos.csgo.CMsgClientMMSInviteToLobby, {
406
+ app_id: 730,
407
+ steam_id_lobby: lobbyID,
408
+ steam_id_user_invited: accountid,
409
+ }), function (...args) {
410
+ console.log("invite2Lobby response", args)
411
+ })
412
+ }
413
+
414
+
415
+ async function joinLobby(lobbyID) {
416
+ console.log("joinLobby", lobbyID.accountid);
417
+ steamClient.sendToGC(730, Protos.csgo.EMsg.k_EMsgClientMMSJoinLobby, {}, protoEncode(Protos.csgo.CMsgClientMMSJoinLobby, {
418
+ app_id: 730,
419
+ steam_id_lobby: lobbyID.accountid,
420
+ persona_name: steamClient.accountInfo.name,
421
+ }), function (...args) {
422
+ console.log("joinLobby response", args)
423
+ })
424
+ }
425
+
381
426
  async function sendHello() {
382
427
  steamClient.sendToGC(appid, Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingClient2GCHello, {}, Buffer.alloc(0))
383
428
  steamClient.sendToGC(appid, Protos.csgo.EGCBaseClientMsg.k_EMsgGCClientHello, {}, Buffer.alloc(0))
@@ -465,6 +510,20 @@ function SteamClient({
465
510
  callEvent(events.webSession, webSession)
466
511
  })
467
512
 
513
+ // steamClient.on('lobbyInvite', (inviterID, lobbyID ) => {
514
+ // joinLobby(lobbyID)
515
+ // })
516
+
517
+ // steamClient.on('debug', (msg) => {
518
+ // if (!["ClientPersonaState","ClientClanState"].some(c => msg.includes(c))) {
519
+ // if(msg.startsWith("Received")){
520
+ // console.log(`------- ${msg}`)
521
+ // } else {
522
+ // console.log(msg)
523
+ // }
524
+ // }
525
+ // })
526
+
468
527
  steamClient.on('receivedFromGC', async (appid, msgType, payload) => {
469
528
  const key = getECsgoGCMsgKey(msgType)
470
529
  switch (msgType) {
@@ -623,6 +682,10 @@ function SteamClient({
623
682
  const result = protoDecode(Protos.csgo.CMsgClientUGSGetGlobalStatsResponse, payload)
624
683
  break
625
684
  }
685
+ case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportPlayer: {
686
+ const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_ClientReportPlayer, payload)
687
+ break
688
+ }
626
689
  case Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GC2ClientTextMsg: {
627
690
  const result = protoDecode(Protos.csgo.CMsgGCCStrike15_v2_GC2ClientTextMsg, payload)
628
691
  break
@@ -1557,6 +1620,8 @@ function SteamClient({
1557
1620
  return {
1558
1621
  init,
1559
1622
  partySearch,
1623
+ invite2Lobby,
1624
+ createLobby,
1560
1625
  partyRegister,
1561
1626
  requestCoPlays,
1562
1627
  getPersonas,
@@ -1648,6 +1713,12 @@ function SteamClient({
1648
1713
  return await steamClient.requestFreeLicense(...args)
1649
1714
  } catch (e) {
1650
1715
  }
1716
+ },
1717
+ getSteamId(){
1718
+ try {
1719
+ return steamClient.steamID.getSteamID64()
1720
+ } catch (e) {
1721
+ }
1651
1722
  }
1652
1723
  }
1653
1724
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.36",
3
+ "version": "1.2.37",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.4.0",
@@ -1,21 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
4
- <serverData>
5
- <paths name="steamsupport">
6
- <serverdata>
7
- <mappings>
8
- <mapping local="$PROJECT_DIR$" web="/" />
9
- </mappings>
10
- </serverdata>
11
- </paths>
12
- <paths name="steamsupportui">
13
- <serverdata>
14
- <mappings>
15
- <mapping local="$PROJECT_DIR$" web="/" />
16
- </mappings>
17
- </serverdata>
18
- </paths>
19
- </serverData>
20
- </component>
21
- </project>