use aeronet_replicon::server::AeronetRepliconServerPlugin;
use aeronet_websocket::server::WebSocketServerPlugin;
use avian2d::prelude::PhysicsInterpolationPlugin;
use bevy::app::{PluginGroup, PluginGroupBuilder};
use std::net::SocketAddr;
use avian2d::PhysicsPlugins;
pub struct ServerPluginGroup {
pub bind: SocketAddr,
pub tick_rate: f32,
pub max_clients: usize,
}
impl PluginGroup for ServerPluginGroup {
fn build(self) -> PluginGroupBuilder {
PluginGroupBuilder::start::<Self>()
.add_group(
PhysicsPlugins::default()
.with_length_unit(100.0)
.set(PhysicsInterpolationPlugin::interpolate_all())
)
.add(WebSocketServerPlugin)
.add(AeronetRepliconServerPlugin)
.add(crate::server::ServerPlugin {
bind: self.bind,
max_clients: self.max_clients,
})
}
}