~starkingdoms/starkingdoms

ref: c7da20800d035a6491e612693b2039aa99988c15 starkingdoms/crates/unified/src/main.rs -rw-r--r-- 1.8 KiB
c7da2080 — core netcode: easing 6 days 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#![warn(clippy::pedantic)]
#![deny(
    clippy::allow_attributes_without_reason,
    clippy::assertions_on_result_states
)]
#![warn(clippy::if_then_some_else_none)]
#![allow(clippy::type_complexity, reason = "Bevy makes this a nightmare")]
#![allow(clippy::needless_pass_by_value, reason = "Bevy makes this a nightmare")]
#![allow(
    clippy::cast_precision_loss,
    clippy::cast_possible_truncation,
    clippy::cast_sign_loss,
    reason = "We cast ints to floats a lot"
)]
#![allow(clippy::missing_panics_doc, reason = "Gamedev! We panic a lot")]
#![allow(clippy::too_many_arguments, reason = "Le Bevy:tm:")]
#![allow(clippy::too_many_lines, reason = "With the three of us, this is impossible")]
#![allow(dead_code, unused, reason = "We have a lot of this and it's getting annoying")]

pub mod client;
#[cfg(not(target_arch = "wasm32"))]
pub mod server;

pub mod prelude;

#[cfg(target_arch = "wasm32")]
pub mod wasm_entrypoint;
pub mod cli;
pub mod shared;
pub mod universal_entrypoint;

use std::str::FromStr;
#[cfg(target_arch = "wasm32")]
pub use wasm_entrypoint::*;

use crate::prelude::*;
use crate::universal_entrypoint::run;

#[cfg(feature = "wasm")]
fn main() {
    // noop on webassembly
}

#[cfg(feature = "native")]
fn main() -> AppExit {
    use tracing_subscriber::util::SubscriberInitExt;
    use bevy::log::tracing_subscriber;

    let cli = cli::parse_args();

    tracing_subscriber::fmt()
        .with_env_filter(
            tracing_subscriber::EnvFilter::from_default_env()
                .add_directive(tracing_subscriber::filter::Directive::from_str("naga=error").unwrap())
                .add_directive(tracing_subscriber::filter::Directive::from_str("info").unwrap())
                .add_directive(tracing_subscriber::filter::Directive::from_str("starkingdoms=trace").unwrap()),
        )
        .finish()
        .init();

    run(cli)
}