DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

ref: 343934c69a20354b4f27ed5b68cfa05976c1580a deck-builder/server/src/main.rs -rw-r--r-- 1.0 KiB
343934c6Jonni Liljamo chore(client): remove unused init_networking 1 year, 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * This file is part of laurelin/server
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use bevy_app::{App, ScheduleRunnerPlugin};
use bevy_core::CorePlugin;
use bevy_log::{info, LogPlugin};

use naia_bevy_server::{Plugin as ServerPlugin, ServerConfig};

use laurelin_shared::server::protocol::protocol;

mod systems;

fn main() {
    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()))
        // init system
        .add_startup_system(systems::init::init)
        // events
        .add_system(systems::event::auth_events);

    info!("Laurelin server starting");
    server.run();
}