aboutsummaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/network.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/network.rs b/src/client/network.rs
index 4d1a128..df55cc9 100644
--- a/src/client/network.rs
+++ b/src/client/network.rs
@@ -8,8 +8,11 @@ use lightyear::client::resource::Authentication;
use lightyear::prelude::client::NetConfig;
use lightyear::prelude::*;
use lightyear::transport::LOCAL_SOCKET;
+use std::net::SocketAddr;
pub struct NetworkPlugin {
+ pub server_addr: Option<SocketAddr>,
+ pub client_id: u64,
pub transport: TransportConfig,
}
@@ -20,8 +23,8 @@ impl Plugin for NetworkPlugin {
net: NetConfig::Netcode {
config: Default::default(),
auth: Authentication::Manual {
- server_addr: LOCAL_SOCKET,
- client_id: CLIENT_ID,
+ server_addr: self.server_addr.unwrap_or(LOCAL_SOCKET),
+ client_id: self.client_id,
private_key: KEY,
protocol_id: PROTOCOL_ID,
},