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
//! # Naia Server
//! A server that uses either UDP or WebRTC communication to send/receive events
//! to/from connected clients, and syncs registered actors to clients to whom
//! those actors are in-scope.

#![deny(
    missing_docs,
    trivial_casts,
    trivial_numeric_casts,
    unsafe_code,
    unstable_features,
    unused_import_braces
)]

#[macro_use]
extern crate log;

#[macro_use]
extern crate slotmap;

#[cfg(all(feature = "use-udp", feature = "use-webrtc"))]
compile_error!("Naia Server can only use UDP or WebRTC, you must pick one");

#[cfg(all(not(feature = "use-udp"), not(feature = "use-webrtc")))]
compile_error!("Naia Server requires either the 'use-udp' or 'use-webrtc' feature to be enabled, you must pick one.");

pub use naia_shared::{
    find_my_ip_address, Actor, ActorType, LinkConditionerConfig, Random, SharedConfig,
};

mod actors;
mod client_connection;
mod command_receiver;
mod error;
mod interval;
mod naia_server;
mod ping_manager;
mod room;
mod server_config;
mod server_event;
mod server_packet_writer;
mod server_tick_manager;
mod user;

pub use actors::actor_key::actor_key::ActorKey;
pub use naia_server::NaiaServer;
pub use room::room_key::RoomKey;
pub use server_config::ServerConfig;
pub use server_event::ServerEvent;
pub use user::user_key::UserKey;