steam_api.h - adambiser/agk-steam-plugin GitHub Wiki

Init

Init() as integer

Initializes the Steam API. This method should be called before attempting to do anything else with this plugin. This also calls RequestCurrentStats() internally so calling code does not need to do so. The result of the RequestCurrentStats call has no effect on the return value.

Returns: 1 when Steam API initialization succeeds; otherwise 0.

Reference:
steam_api#SteamAPI_Init

SteamInitialized

SteamInitialized() as integer

Returns whether the Steam API is currently initialized.

Returns: 1 when the Steam API is initialized; otherwise 0.

Reference:
steam_api#SteamAPI_Init

RestartAppIfNecessary

RestartAppIfNecessary(ownAppID as integer) as integer

  • ownAppID - The Steam AppID of your game.

When used, this command should be called near the beginning of the starting process and should be called before Init.

Tests to see if the game has been started through the Steam Client. Effectively serves as a basic DRM by forcing the game to be started by the Steam Client.

Returns: 1 when a new instance of the game has been started by Steam Client and this instance should close as soon as possible; otherwise 0 when the game is already running from the Steam Client.

0 will also be reported if the steam_appid.txt file exists.

Reference:
steam_api#SteamAPI_RestartAppIfNecessary

RunCallbacks

RunCallbacks()

Allows asynchronous Steam API calls to handle any new results. Should be called each frame sync.

Reference:
steam_api#SteamAPI_RunCallbacks

Shutdown

Shutdown()

Shuts down the plugin and frees memory.

Reference:
steam_api#SteamAPI_Shutdown