Roll your own Steam Front End
After quite some time and a lot of help mainly from Didrole, VoiDeD and AzuiSleet and others here at OSW, I have compiled the steps that allow me to Launch a Steam App (game).
Step by Step to Launching a Steam App - based on work by Didrole
The basic steps are:-
- Loading the Steam DLLs (create an instance of CSteamApiLoader)
- Getting the function pointers into the DLLs (plus factories)
- Creating a Worker Thread to handle the Steam callbacks
- Creating a Steam Pipe and Global User
- Steam2 Start up
Steam User logon
- Add callback handlers for Steam3 logon
- Prepare and Invoke Steam3 logon
- Handle logon callback results (remove logon callback handlers)
- a) Logon failure - determine reason - may need 2nd Auth (SteamGuard) etc
- b) Logon success
- Invoke Steam2 Login
- Enable file system
- Setup environment variables
- Read various Steam User information
Get User App list - (this is required if Launching is intended)
- Iterate through user License/Subscription list
- For all Apps in License/Subscription -
- a) Determine App type (Media, demo, crap, game etc)
- b) If App type is a game - Store App information (i.e URL to icons etc)
- Apply Didrole's bit of magic for each owned game (read the code)
Launch Game from App List
- Check App type and if subscribed
- Enable "Cloud"
- Load Cache if required
- Prepare App for Launch
- Read App's "local" launch arguments
- Use Steam2 to Launch App
Killing the App and GameOverlayUI.exe
Steam doesn't appear to have any exposed and working functions to do this (maybe due to 3ed party products?). Refer to the VC++ wrapper for alternative methods.
Steam User Logoff
- Add logoff callback handler
- Invoke Steam3 LogOff
- Handle logoff callback result (remove logoff callback handler)
- Do Steam2 Logout (if required)
- Steam2 Cleanup
- Steam2 ShutdownEngine
Steam Cleanup and unload Dlls
- (Work in progress) - see 6. above
- Terminate the Steam callback handler thread
- Release Global User and Steam Pipe
- Delete the instance of CSteamApiLoader (frees and unloads the Steam DLLs)
- The OSW headers are "undocumented" and based on the virtual tables in the Steam (client) DLLs.
- The Steam Dlls are subject to change without notice by Steam/Valve
- The OSW headers are maintained and updated by the Open Steam Works group and you should check for updates periodically.
- Valve/Steam will probably not support any of your projects or answer questions
- Steam strings appear to be UTF8, so wide strings/unicode should be converted before using.
- Steam2 is slowly being replaced by Steam3
- Not all defined Steam3 functions are operational.
- (Windows) Launching an App will cause GameOvelayUI.exe to run - which will create a delayed error when the App is exited.
Steam2 - Older/original Steam functions usually in Steam.dll (being phased out)
Steam3 - New Steam interface mostly through SteamClient.dll (slowly replacing Steam2) App - Steam Game
Subscription/License - A group of Steam Apps - related by a concept, Steam3 uses the term License
i.e Subscription 0 - free games Orange Box etc
Steam User Account - A group of 0 or more Licenses/subscriptions accessed with a username and password