Switch to replicon (#80)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
mod backpack;
|
||||
mod client;
|
||||
mod config;
|
||||
mod control;
|
||||
mod debug;
|
||||
mod enemy;
|
||||
@@ -22,13 +23,8 @@ use bevy_trenchbroom::prelude::*;
|
||||
use bevy_trenchbroom_avian::AvianPhysicsBackend;
|
||||
use camera::MainCamera;
|
||||
use heads_database::HeadDatabaseAsset;
|
||||
use lightyear::{
|
||||
avian3d::plugin::LightyearAvianPlugin, frame_interpolation::FrameInterpolationPlugin,
|
||||
prelude::client::ClientPlugins,
|
||||
};
|
||||
use loading_assets::AudioAssets;
|
||||
use shared::*;
|
||||
use std::time::Duration;
|
||||
|
||||
fn main() {
|
||||
let mut app = App::new();
|
||||
@@ -68,25 +64,7 @@ fn main() {
|
||||
bevy_debug_log::LogViewerPlugin::default()
|
||||
.auto_open_threshold(bevy::log::tracing::level_filters::LevelFilter::OFF),
|
||||
);
|
||||
app.add_plugins(
|
||||
PhysicsPlugins::default()
|
||||
.build()
|
||||
// TODO: This plugin is *not* disabled on the server. This is to solve a bug related to collider transform inheritance. See the
|
||||
// LightyearAvianPlugin below.
|
||||
// Periwink is looking into it at the moment. This **must** be disabled on the client, or positions break for NPCs and some other things.
|
||||
.disable::<PhysicsTransformPlugin>()
|
||||
// FrameInterpolation handles interpolating Position and Rotation
|
||||
.disable::<PhysicsInterpolationPlugin>(),
|
||||
);
|
||||
// TODO: This plugin is *not* inserted on the server. This is to solve a bug related to collider transform inheritance. See the
|
||||
// `.disable::<PhysicsTransformPlugin>()` above.
|
||||
// Periwink is looking into it at the moment. This **must** be inserted on the client, or positions break for NPCs and some other things.
|
||||
app.add_plugins(LightyearAvianPlugin::default());
|
||||
app.add_plugins(FrameInterpolationPlugin::<Position>::default());
|
||||
app.add_plugins(FrameInterpolationPlugin::<Rotation>::default());
|
||||
app.add_plugins(ClientPlugins {
|
||||
tick_duration: Duration::from_secs_f64(1.0 / 60.0),
|
||||
});
|
||||
app.add_plugins(PhysicsPlugins::default());
|
||||
app.add_plugins(Sprite3dPlugin);
|
||||
app.add_plugins(TrenchBroomPlugins(
|
||||
TrenchBroomConfig::new("hedz")
|
||||
@@ -116,7 +94,6 @@ fn main() {
|
||||
app.add_plugins(shared::player::plugin);
|
||||
app.add_plugins(shared::gates::plugin);
|
||||
app.add_plugins(shared::platforms::plugin);
|
||||
app.add_plugins(shared::protocol::plugin);
|
||||
app.add_plugins(shared::movables::plugin);
|
||||
app.add_plugins(shared::utils::billboards::plugin);
|
||||
app.add_plugins(shared::aim::plugin);
|
||||
@@ -140,10 +117,16 @@ fn main() {
|
||||
app.add_plugins(shared::utils::trail::plugin);
|
||||
app.add_plugins(shared::utils::auto_rotate::plugin);
|
||||
app.add_plugins(shared::tb_entities::plugin);
|
||||
app.add_plugins(shared::tick::plugin);
|
||||
app.add_plugins(shared::utils::explosions::plugin);
|
||||
|
||||
app.add_plugins(backpack::plugin);
|
||||
// Networking
|
||||
// The client/server plugin must go before the protocol, or else `ProtocolHasher` will not be available.
|
||||
app.add_plugins(client::plugin);
|
||||
app.add_plugins(shared::protocol::plugin);
|
||||
|
||||
app.add_plugins(backpack::plugin);
|
||||
app.add_plugins(config::plugin);
|
||||
app.add_plugins(control::plugin);
|
||||
app.add_plugins(debug::plugin);
|
||||
app.add_plugins(enemy::plugin);
|
||||
|
||||
Reference in New Issue
Block a user