M client/src/main.rs => client/src/main.rs +1 -1
@@ 107,7 107,7 @@ fn main() {
NaiaClientConfig::default(),
protocol(),
))
- .add_startup_system(init_networking);
+ .add_plugin(plugins::networking::NetworkingPlugin);
app.run();
}
M => +1 -0
@@ 14,6 14,7 @@ use crate::util::egui::{menuwindow, password};
#[derive(Default, Resource)]
pub struct ConnectScreenData {
pub state: ConnectState,
pub connecting: bool,
pub username: String,
pub email: String,
pub password: String,
M client/src/plugins/mod.rs => client/src/plugins/mod.rs +1 -0
@@ 8,4 8,5 @@
pub mod config;
pub mod menu;
+pub mod networking;
pub mod phases;
A client/src/plugins/networking/mod.rs => client/src/plugins/networking/mod.rs +21 -0
@@ 0,0 1,21 @@
+/*
+ * This file is part of laurelin/client
+ * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
+ *
+ * Licensed under GPL-3.0-only.
+ * See LICENSE for licensing information.
+ */
+
+use bevy::prelude::*;
+
+mod systems;
+
+pub struct NetworkingPlugin;
+
+impl Plugin for NetworkingPlugin {
+ fn build(&self, app: &mut App) {
+ app.add_system_to_stage(CoreStage::PreUpdate, systems::events::connect_events)
+ .add_system_to_stage(CoreStage::PreUpdate, systems::events::reject_events)
+ .add_system_to_stage(CoreStage::PreUpdate, systems::events::disconnect_events);
+ }
+}
A client/src/plugins/networking/systems/events.rs => client/src/plugins/networking/systems/events.rs +13 -0
@@ 0,0 1,13 @@
+/*
+ * This file is part of laurelin/client
+ * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
+ *
+ * Licensed under GPL-3.0-only.
+ * See LICENSE for licensing information.
+ */
+
+pub fn connect_events() {}
+
+pub fn reject_events() {}
+
+pub fn disconnect_events() {}
A client/src/plugins/networking/systems/mod.rs => client/src/plugins/networking/systems/mod.rs +9 -0
@@ 0,0 1,9 @@
+/*
+ * This file is part of laurelin/client
+ * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
+ *
+ * Licensed under GPL-3.0-only.
+ * See LICENSE for licensing information.
+ */
+
+pub mod events;