From dbc7bc74ab061a8db57e6bf0840b4e0eedc349f4 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Thu, 23 Feb 2023 13:15:18 +0200 Subject: [PATCH] feat(server): the very basics of the server --- server/src/main.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/server/src/main.rs b/server/src/main.rs index 0619b1f..ad6a5a0 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -6,6 +6,28 @@ * See LICENSE for licensing information. */ +use bevy_app::{App, CoreStage, ScheduleRunnerPlugin}; +use bevy_core::CorePlugin; +use bevy_log::{info, LogPlugin}; + +use naia_bevy_server::{Plugin as ServerPlugin, ServerConfig, Stage}; + +use laurelin_shared::server::protocol::protocol; + fn main() { - println!("Hello, world!"); + let mut server = App::new(); + + server + // plugins + .add_plugin(CorePlugin::default()) + .add_plugin(ScheduleRunnerPlugin::default()) + .add_plugin(LogPlugin { + // NOTE: overridden by RUST_LOG environment variable + level: bevy_log::Level::INFO, + ..Default::default() + }) + .add_plugin(ServerPlugin::new(ServerConfig::default(), protocol())); + + info!("Laurelin server starting"); + server.run(); } -- 2.44.1