diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index ec31b71..44ec0fe 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,3 +1,8 @@ +## Next + +1. Updated all crates to rust 2021 edition. [#27](https://github.com/ErnWong/crystalorb/pull/27) +2. Updated `crystalorb-bevy-networking-turbulence` plugin crate to bevy 0.6. [#26](https://github.com/ErnWong/crystalorb/issues/26) [#27](https://github.com/ErnWong/crystalorb/pull/27) + ## v0.3.0 ### Breaking Changes diff --git a/Cargo.toml b/Cargo.toml index db02a3e..83c3e8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.3.0" authors = ["Ernest Wong "] categories = ["games", "simulation"] description = "Network-agnostic, high-level game networking library" -edition = "2018" +edition = "2021" keywords = ["netcode"] license = "Apache-2.0" readme = "README.markdown" @@ -27,6 +27,7 @@ crystalorb-mock-network = {path = "./crates/crystalorb-mock-network"} crystalorb-demo = {path = "./examples/demo"} [workspace] +resolver = "2" members = [ "examples/demo", "crates/crystalorb-mock-network", diff --git a/crates/crystalorb-bevy-networking-turbulence/Cargo.toml b/crates/crystalorb-bevy-networking-turbulence/Cargo.toml index 9c6e652..12dfa56 100644 --- a/crates/crystalorb-bevy-networking-turbulence/Cargo.toml +++ b/crates/crystalorb-bevy-networking-turbulence/Cargo.toml @@ -4,7 +4,7 @@ version = "0.3.0" authors = ["Ernest Wong "] categories = ["games", "simulation"] description = "bevy_networking_turbulence integration for CrystalOrb" -edition = "2018" +edition = "2021" keywords = ["netcode"] license = "Apache-2.0" readme = "README.markdown" @@ -16,14 +16,14 @@ use-udp = ["bevy_networking_turbulence/use-udp"] use-webrtc = ["bevy_networking_turbulence/use-webrtc"] [dependencies] -bevy_app = "0.5" -bevy_ecs = "0.5" -bevy_core = "0.5" -bevy_networking_turbulence = {version = "0.3.0", default-features = false} +bevy_app = "0.6" +bevy_ecs = "0.6" +bevy_core = "0.6" +bevy_networking_turbulence = {version = "0.4.1", default-features = false} crystalorb = {version = "0.3.0", path="../../"} serde = {version = "1.0.118", features = ["derive"]} turbulence = "0.3" [dev-dependencies] -bevy = {version = "0.5", default-features = false} +bevy = {version = "0.6", default-features = false} crystalorb-demo = {path = "../../examples/demo"} diff --git a/crates/crystalorb-bevy-networking-turbulence/README.markdown b/crates/crystalorb-bevy-networking-turbulence/README.markdown index 32da185..51c57b9 100644 --- a/crates/crystalorb-bevy-networking-turbulence/README.markdown +++ b/crates/crystalorb-bevy-networking-turbulence/README.markdown @@ -45,7 +45,7 @@ struct PlayerInputState { jump: bool, } -fn player_input( +fn player_input_system( mut state: Local, input: Res>, mut client: ResMut>, @@ -71,7 +71,7 @@ fn player_input( } fn main() { - App::build() + App::new() // You can optionally override some message channel settings // There is `CommandChannelSettings`, `SnapshotChannelSettings`, and `ClockSyncChannelSettings` // Make sure you apply the same settings for both client and server. @@ -99,7 +99,7 @@ fn main() { )) .add_plugins(DefaultPlugins) .add_plugin(CrystalOrbClientPlugin::::new(Config::default())) - .add_system(player_input.system()) + .add_system(player_input_system) .run(); } ``` @@ -122,7 +122,7 @@ use crystalorb_bevy_networking_turbulence::{ use std::time::Duration; fn main() { - App::build() + App::new() // You can optionally override some message channel settings // There is `CommandChannelSettings`, `SnapshotChannelSettings`, and `ClockSyncChannelSettings` // Make sure you apply the same settings for both client and server. diff --git a/crates/crystalorb-bevy-networking-turbulence/src/lib.rs b/crates/crystalorb-bevy-networking-turbulence/src/lib.rs index 59c91ef..81468b1 100644 --- a/crates/crystalorb-bevy-networking-turbulence/src/lib.rs +++ b/crates/crystalorb-bevy-networking-turbulence/src/lib.rs @@ -1,7 +1,7 @@ #![feature(generic_associated_types)] #![doc = include_str!("../README.markdown")] -use bevy_app::{AppBuilder, EventReader, EventWriter, Plugin}; +use bevy_app::{App, EventReader, EventWriter, Plugin}; use bevy_core::Time; use bevy_ecs::prelude::*; use bevy_networking_turbulence::{ @@ -242,7 +242,7 @@ impl CrystalOrbServerPlugin { } impl Plugin for CrystalOrbServerPlugin { - fn build(&self, app: &mut AppBuilder) { + fn build(&self, app: &mut App) { app.add_plugin(NetworkingPlugin::default()) .insert_resource(Server::::new(self.config.clone(), 0.0)) .init_resource::() @@ -313,7 +313,7 @@ impl CrystalOrbClientPlugin { } impl Plugin for CrystalOrbClientPlugin { - fn build(&self, app: &mut AppBuilder) { + fn build(&self, app: &mut App) { app.add_plugin(NetworkingPlugin::default()) .insert_resource(Client::::new(self.config.clone())) .init_resource::() diff --git a/crates/crystalorb-mock-network/Cargo.toml b/crates/crystalorb-mock-network/Cargo.toml index 59eefce..231349a 100644 --- a/crates/crystalorb-mock-network/Cargo.toml +++ b/crates/crystalorb-mock-network/Cargo.toml @@ -4,7 +4,7 @@ version = "0.3.0" authors = ["Ernest Wong "] categories = ["games", "simulation"] description = "Mock, offline, in-memory transport layer for CrystalOrb" -edition = "2018" +edition = "2021" keywords = ["netcode"] license = "Apache-2.0" readme = "README.markdown" diff --git a/examples/demo/Cargo.toml b/examples/demo/Cargo.toml index addb9af..724f2c8 100644 --- a/examples/demo/Cargo.toml +++ b/examples/demo/Cargo.toml @@ -4,7 +4,7 @@ version = "0.3.0" authors = ["Ernest Wong "] categories = ["games", "simulation"] description = "Visual and interactive demo for CrystalOrb using the Rapier physics engine" -edition = "2018" +edition = "2021" keywords = ["netcode"] license = "Apache-2.0" readme = "README.markdown"