Skip to content

Commit

Permalink
Added SteamClient.RestartAppIfNecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
garrynewman committed Jun 21, 2019
1 parent 15dc278 commit fd50e3b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Facepunch.Steamworks/SteamClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,24 @@ internal static void UnregisterCallback( IntPtr intPtr )
/// returns the appID of the current process
/// </summary>
public static AppId AppId { get; internal set; }

/// <summary>
/// Checks if your executable was launched through Steam and relaunches it through Steam if it wasn't
/// this returns true then it starts the Steam client if required and launches your game again through it,
/// and you should quit your process as soon as possible. This effectively runs steam://run/AppId so it
/// may not relaunch the exact executable that called it, as it will always relaunch from the version
/// installed in your Steam library folder/
/// Note that during development, when not launching via Steam, this might always return true.
/// </summary>
public static bool RestartAppIfNecessary( uint appid )
{
// Having these here would probably mean it always returns false?

//System.Environment.SetEnvironmentVariable( "SteamAppId", appid.ToString() );
//System.Environment.SetEnvironmentVariable( "SteamGameId", appid.ToString() );

return SteamAPI.RestartAppIfNecessary( appid );
}

}
}

0 comments on commit fd50e3b

Please sign in to comment.