@@ 20,6 20,12 @@ use iyes_loopless::prelude::*;
use belly::prelude::{BellyPlugin, StyleSheet};
+use naia_bevy_client::{
+ Client as NaiaClient, ClientConfig as NaiaClientConfig, Plugin as NaiaClientPlugin,
+};
+
+use laurelin_shared::server::protocol::protocol;
+
mod api;
mod cfg;
mod constants;
@@ 104,9 110,22 @@ fn main() {
app.insert_resource(runtime::menu::RTDMenu::default())
.insert_resource(runtime::game::RTDGame::default());
+ // Networking
+ app.add_plugin(NaiaClientPlugin::new(
+ NaiaClientConfig::default(),
+ protocol(),
+ ))
+ .add_startup_system(init_networking);
+
app.run();
}
+fn init_networking(mut commands: Commands, mut client: NaiaClient) {
+ info!("Laurelin client connecting");
+
+ client.connect("http://127.0.0.1:14191");
+}
+
fn setup(mut commands: Commands) {
// Spawn a camera
commands.spawn(Camera3dBundle::default());