Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds implementation for SteamAPI_InitFlat #185

Merged
merged 4 commits into from
Jul 24, 2024

Conversation

Thelvaen
Copy link
Contributor

Adds functions:

  • steam_api_init_flat() : wrapper for the SDK call,
  • init_flat() : copy of init(), but calls steam_api_init_flat() instead of steam_api_init_ex(),
  • init_flat_app() : copy of init_app(), but calls init_flat() instead of init(),

@LZQCN
Copy link
Contributor

LZQCN commented Jun 30, 2024

Now, you can safely remove Client::steam_api_init_ex as it was merely a temporary workaround for 1.58a SDK, reason is valve forgot to expose the steam_api_init_flat function.

@Thelvaen
Copy link
Contributor Author

Thelvaen commented Jul 1, 2024

Now, you can safely remove Client::steam_api_init_ex as it was merely a temporary workaround for 1.58a SDK, reason is valve forgot to expose the steam_api_init_flat function.

That would mean discard the existing init & init_app function and replace them with the implementation I provided?

I don't mind editing my PR in that direction, I'm just not sure as to what are the consequences of not initializing the SteamAPI with the ISteam Interface on our side, as it's what the previous version is doing (to my understanding).

@LZQCN
Copy link
Contributor

LZQCN commented Jul 3, 2024

The Client:: steam.api_init_ex function was added by me, due to it is hard-coded, it is highly likely to lack upward compatibility.

It is just to simulate this function:

S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_SteamAPI_Init( const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg );
inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg )
{
const char *pszInternalCheckInterfaceVersions =
STEAMUTILS_INTERFACE_VERSION "\0"
STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0"
STEAMAPPS_INTERFACE_VERSION "\0"
STEAMCONTROLLER_INTERFACE_VERSION "\0"
STEAMFRIENDS_INTERFACE_VERSION "\0"
STEAMGAMESEARCH_INTERFACE_VERSION "\0"
STEAMHTMLSURFACE_INTERFACE_VERSION "\0"
STEAMHTTP_INTERFACE_VERSION "\0"
STEAMINPUT_INTERFACE_VERSION "\0"
STEAMINVENTORY_INTERFACE_VERSION "\0"
STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "\0"
STEAMMATCHMAKING_INTERFACE_VERSION "\0"
STEAMMUSICREMOTE_INTERFACE_VERSION "\0"
STEAMMUSIC_INTERFACE_VERSION "\0"
STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "\0"
STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "\0"
STEAMNETWORKING_INTERFACE_VERSION "\0"
STEAMPARENTALSETTINGS_INTERFACE_VERSION "\0"
STEAMPARTIES_INTERFACE_VERSION "\0"
STEAMREMOTEPLAY_INTERFACE_VERSION "\0"
STEAMREMOTESTORAGE_INTERFACE_VERSION "\0"
STEAMSCREENSHOTS_INTERFACE_VERSION "\0"
STEAMUGC_INTERFACE_VERSION "\0"
STEAMUSERSTATS_INTERFACE_VERSION "\0"
STEAMUSER_INTERFACE_VERSION "\0"
STEAMVIDEO_INTERFACE_VERSION "\0"
"\0";
return SteamInternal_SteamAPI_Init( pszInternalCheckInterfaceVersions, pOutErrMsg );
}


For the new version, the SteamAPI_InitFlat should be used:

// If you are unable to include this C++ header in your project and are dynamically loading
// Steamworks SDK methods from dll/so, you can use the following method:
// - SteamAPI_InitFlat()

…and replacing it with the calls to flat_init
@Thelvaen
Copy link
Contributor Author

Thelvaen commented Jul 3, 2024

Removed:

  • steam_api_init_ex(),
  • init(),
  • init_app(),

Replaced them with the call chain to SteamAPI_InitFlat()

src/lib.rs Outdated Show resolved Hide resolved
@Noxime Noxime merged commit 88b255e into Noxime:master Jul 24, 2024
9 checks passed
@Thelvaen Thelvaen deleted the init_flat_app branch August 2, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants