code sharing for steam setup
+ strip server a bit more
This commit is contained in:
@@ -25,6 +25,7 @@ pub mod physics_layers;
|
||||
pub mod platforms;
|
||||
pub mod player;
|
||||
pub mod sounds;
|
||||
pub mod steam;
|
||||
pub mod tb_entities;
|
||||
pub mod utils;
|
||||
pub mod water;
|
||||
|
||||
25
crates/shared/src/steam.rs
Normal file
25
crates/shared/src/steam.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use bevy::prelude::*;
|
||||
use bevy_steamworks::SteamworksPlugin;
|
||||
|
||||
pub fn plugin(app: &mut App) {
|
||||
let app_id = 1603000;
|
||||
|
||||
// should only be done in production builds
|
||||
#[cfg(not(debug_assertions))]
|
||||
if steamworks::restart_app_if_necessary(app_id.into()) {
|
||||
info!("Restarting app via steam");
|
||||
return;
|
||||
}
|
||||
|
||||
info!("steam app init: {app_id}");
|
||||
|
||||
match SteamworksPlugin::init_app(app_id) {
|
||||
Ok(plugin) => {
|
||||
info!("steam app init done");
|
||||
app.add_plugins(plugin);
|
||||
}
|
||||
Err(e) => {
|
||||
warn!("steam init error: {e:?}");
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user