~starkingdoms/starkingdoms

ref: b3905a2319f3c384b06eb9a621812543223faa6c starkingdoms/crates/unified/src/server/plugins.rs -rw-r--r-- 530 bytes
b3905a23 — core netcode: remove aeronet 8 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::time::Duration;
use bevy::app::{PluginGroup, PluginGroupBuilder, ScheduleRunnerPlugin};
use crate::shared::plugins::TICK_RATE;

pub struct ServerPluginGroup;

impl PluginGroup for ServerPluginGroup {
    fn build(self) -> PluginGroupBuilder {
        PluginGroupBuilder::start::<Self>()
            .add(ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1.0 / TICK_RATE)))
            .add(bevy_replicon::server::ServerPlugin::default())
            .add(bevy_replicon::server::message::ServerMessagePlugin)
    }
}