Skip to content

Steam client reference#92

Merged
AAGaming00 merged 59 commits intoSteamDeckHomebrew:mainfrom
FlashyReese:steam-client-reference
Apr 23, 2025
Merged

Steam client reference#92
AAGaming00 merged 59 commits intoSteamDeckHomebrew:mainfrom
FlashyReese:steam-client-reference

Conversation

@FlashyReese
Copy link
Contributor

@FlashyReese FlashyReese commented Aug 27, 2023

Using the SDH Discord server, GitHub, and personal findings, I have attempted to document as many functions as possible within the SteamClient object. Feedback is greatly appreciated. If you come across any functions that are not documented and you already understand their purpose, please consider leaving a comment or suggestion.

To do list will be done on a separate PR.
To-Do List:
- [ ] Verify the functionality of all documented functions.
- [ ] Organize and restructure all the interfaces for better readability.

@AAGaming00
Copy link
Member

After reading the latest commit message, how are you detecting the interface changes so quickly?

@FlashyReese
Copy link
Contributor Author

After reading the latest commit message, how are you detecting the interface changes so quickly?

Using the CEF debugger console, I've written this function to quickly extract every method for any object.

function mapFunctions(obj) {
  const methods = {};

  function extractMethods(obj, path = []) {
    for (const key in obj) {
      if (typeof obj[key] === 'function') {
        if (!methods[path.join('.')]) {
          methods[path.join('.')] = [];
        }
        methods[path.join('.')].push(key);
      } else if (typeof obj[key] === 'object' && obj[key] !== null) {
        extractMethods(obj[key], [...path, key]);
      }
    }
  }

  extractMethods(obj);

  return methods;
}

Then I simply apply this to the SteamClient object, deserialize it as JSON, and compare it to a previous version using git's diff tool.

@AAGaming00
Copy link
Member

That's awesome, I'll add this to my update diff system if you don't mind

@FlashyReese
Copy link
Contributor Author

FlashyReese commented Sep 22, 2023

That's awesome, I'll add this to my update diff system if you don't mind

That would be awesome!

I think we can write a tool to generate the aforementioned TypeScript interfaces from it. This could prove useful, as it can be utilized anywhere. Unfortunately, native code does not provide parameters for these functions. This means documenting parameters must be done manually, unless someone is aware of a method I am not familiar with.

Edit: I decided to spend some time and write one: https://gist.github.com/FlashyReese/05748e25b9feabe14e62ef873a8058cb

@PartyWumpus PartyWumpus added the enhancement New feature or request label Nov 11, 2023
@PartyWumpus
Copy link
Member

Edit: I decided to spend some time and write one: https://gist.github.com/FlashyReese/05748e25b9feabe14e62ef873a8058cb

Noticed you weren't able to get the name of the object from the object. If it's a global object then this should work Object.getOwnPropertyNames(window).filter(name => window[name] === obj)[0]. Probably not actually useful though.

@PartyWumpus PartyWumpus force-pushed the steam-client-reference branch from d0baaab to 2ece5e2 Compare March 24, 2024 16:00
@AAGaming00
Copy link
Member

is this ready for review yet? (at least to have it merged until we can have this as a separate package)

@AAGaming00
Copy link
Member

Also please retarget to v4-dev

@FlashyReese FlashyReese changed the base branch from main to v4-dev June 27, 2024 03:31
Steam Version:  1690583737
Steam Client Build Date:  Sat, Jul 29 02:44 UTC -08:00
Using the SDH discord server, GitHub and some personal findings, I tried to document as much SteamClient functions as I can.
Steam Version:  1691097434
Steam Client Build Date:  Fri, Aug 4 04:54 UTC -08:00
Steam Version:  1694466342
Steam Client Build Date:  Tue, Sep 12 04:59 UTC +08:00
Steam Version:  1698260427
Steam Client Build Date:  Thu, Oct 26 2:40 AM UTC -08:00
@KP2048
Copy link

KP2048 commented Oct 17, 2024

Yeah it's just been sitting here and it would be more useful if it was actually merged lol

@snowkat
Copy link

snowkat commented Nov 5, 2024

Looks like Apps.SetShortcutExe is defined in main but not this PR, is that intentional?

I also noticed a dozen or so other methods that are missing from both main and this PR. I'm assuming they were intentionally skipped (mostly RegisterFor[...]), but for the sake of completeness, here they are: https://gist.github.com/snowkat/2a60138a4a67bc4342787383c3c9ccd4

Checked on Steam versions 1726683985 and 1730512277.

@ricewind012
Copy link
Contributor

Looks like Apps.SetShortcutExe is defined in main but not this PR, is that intentional?

I also noticed a dozen or so other methods that are missing from both main and this PR. I'm assuming they were intentionally skipped (mostly RegisterFor[...]), but for the sake of completeness, here they are: https://gist.github.com/snowkat/2a60138a4a67bc4342787383c3c9ccd4

Checked on Steam versions 1726683985 and 1730512277.

just missed, thanks for the list

Copy link
Member

@AAGaming00 AAGaming00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls move out of deck-components these aren't components, then ill merge

otherwise lgtm, left a few comments but not strict requirements

we're considering forming a team to maintain these in the future (possibly in a separate package) so this doesn't happen again, send me a dm over on discord (or an email if you can't) if you're interested

thank you for being patient <3

@AAGaming00
Copy link
Member

also please document any tooling used in creating and maintaining these on the wiki when you can

@AAGaming00
Copy link
Member

redo the move commit using git mv pls

@ricewind012
Copy link
Contributor

i don't know git but i hope it's fine now 😭

@AAGaming00
Copy link
Member

AAGaming00 commented Apr 23, 2025

i don't know git but i hope it's fine now 😭

history is still messed up since u just reverted the commit instead of removing it
use git reset to revert to the commit before you moved them, then use git mv

@ricewind012
Copy link
Contributor

git reset

oh, like that, then git push --force ? it's the only way i know of removing commits but i always saw that it's a bad idea, etc. etc... im asking since i don't want to mess it up any further

@AAGaming00
Copy link
Member

yep force push

@ricewind012 ricewind012 force-pushed the steam-client-reference branch from 5ea9879 to 95826ea Compare April 23, 2025 15:15
@github-project-automation github-project-automation bot moved this from 🏗 In progress to 👀 In review in SDH Tracker Apr 23, 2025
@AAGaming00 AAGaming00 merged commit 131ab4c into SteamDeckHomebrew:main Apr 23, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in SDH Tracker Apr 23, 2025
@github-actions
Copy link

🎉 This PR is included in version 4.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

7 participants