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
use laminar::Config;
use std::net::SocketAddr;
#[derive(Clone)]
#[allow(missing_debug_implementations)]
pub struct ServerConfig {
pub udp_socket_addr: SocketAddr,
pub max_throughput: u16,
pub create_net_connection_on_connect: bool,
pub laminar_config: Config,
}
impl ServerConfig {
pub fn new(
ip: SocketAddr,
max_throughput: u16,
create_net_connection_on_connect: bool,
laminar_config: Config,
) -> ServerConfig {
ServerConfig {
udp_socket_addr: ip,
max_throughput,
create_net_connection_on_connect,
laminar_config,
}
}
}
impl Default for ServerConfig {
fn default() -> Self {
ServerConfig {
udp_socket_addr: "0.0.0.0:0".parse().unwrap(),
max_throughput: 5000,
create_net_connection_on_connect: true,
laminar_config: Config::default(),
}
}
}