aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorMatthew Collins <[email protected]>2018-05-02 21:12:13 +0100
committerMatthew Collins <[email protected]>2018-05-02 21:17:00 +0100
commit4e5a0ced33f810284b26eae661d1e1b7fafa3d42 (patch)
treea1ab8283350aee2a3d182098f025070b2af12f83 /src/lib.rs
parentCleanup callback handling. (diff)
downloadsteamworks-rs-4e5a0ced33f810284b26eae661d1e1b7fafa3d42.tar.xz
steamworks-rs-4e5a0ced33f810284b26eae661d1e1b7fafa3d42.zip
Add restart_app_if_necessary
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b2ec727..26662e7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -72,6 +72,17 @@ unsafe impl <Manager: Send + Sync> Sync for Inner<Manager> {}
unsafe impl <Manager: Send + Sync> Send for Client<Manager> {}
unsafe impl <Manager: Send + Sync> Sync for Client<Manager> {}
+/// Returns true if the app wasn't launched through steam and
+/// begins relaunching it, the app should exit as soon as possible.
+///
+/// Returns false if the app was either launched through steam
+/// or has a `steam_appid.txt`
+pub fn restart_app_if_necessary(app_id: AppId) -> bool {
+ unsafe {
+ sys::SteamAPI_RestartAppIfNecessary(app_id.0) != 0
+ }
+}
+
impl Client<ClientManager> {
/// Attempts to initialize the steamworks api and returns
/// a client to access the rest of the api.