From 6ae5accd5c4bc81cf9a17d252616d7721144b585 Mon Sep 17 00:00:00 2001 From: covercash2 Date: Sat, 18 May 2019 14:17:17 -0700 Subject: [PATCH 1/3] fix compilation bug --- amethyst_assets/src/prefab/mod.rs | 30 ++++++++-------- amethyst_renderer/src/formats/texture.rs | 45 ++++++++++++------------ 2 files changed, 37 insertions(+), 38 deletions(-) diff --git a/amethyst_assets/src/prefab/mod.rs b/amethyst_assets/src/prefab/mod.rs index 09cadb89b0..39edf6de20 100644 --- a/amethyst_assets/src/prefab/mod.rs +++ b/amethyst_assets/src/prefab/mod.rs @@ -380,22 +380,20 @@ where progress: &mut ProgressCounter, system_data: &mut Self::SystemData, ) -> Result { - let handle = if let AssetPrefab::File(ref name, ref format, ref options) = *self { - Some(system_data.0.load( - name.as_ref(), - format.clone(), - options.clone(), - progress, - &system_data.2, - )) - } else { - None - }; - if let Some(handle) = handle { - *self = AssetPrefab::Handle(handle); - Ok(true) - } else { - Ok(false) + match *self { + AssetPrefab::File(ref name, ref format, ref options) => { + *self = AssetPrefab::Handle(system_data.0.load( + name.clone(), + format.clone(), + options.clone(), + progress, + &system_data.2, + )); + return Ok(true); + } + + // Already loaded + _ => return Ok(false), } } } diff --git a/amethyst_renderer/src/formats/texture.rs b/amethyst_renderer/src/formats/texture.rs index 8c3965a3c9..d130b2cf53 100644 --- a/amethyst_renderer/src/formats/texture.rs +++ b/amethyst_renderer/src/formats/texture.rs @@ -254,28 +254,29 @@ where progress: &mut ProgressCounter, system_data: &mut Self::SystemData, ) -> Result { - let handle = match *self { - TexturePrefab::Data(ref data) => Some(system_data.0.load_from_data( - data.clone(), - progress, - &system_data.1, - )), - - TexturePrefab::File(ref name, ref format, ref options) => Some(system_data.0.load( - name.as_ref(), - format.clone(), - options.clone(), - progress, - &system_data.1, - )), - - TexturePrefab::Handle(_) => None, - }; - if let Some(handle) = handle { - *self = TexturePrefab::Handle(handle); - Ok(true) - } else { - Ok(false) + match *self { + TexturePrefab::Data(ref data) => { + *self = TexturePrefab::Handle(system_data.0.load_from_data( + data.clone(), + progress, + &system_data.1, + )); + return Ok(true); + } + + TexturePrefab::File(ref name, ref format, ref options) => { + *self = TexturePrefab::Handle(system_data.0.load( + name.clone(), + format.clone(), + options.clone(), + progress, + &system_data.1, + )); + return Ok(true); + } + + // Already loaded + TexturePrefab::Handle(_) => return Ok(false), } } } From b7f620a6af7533b5bac07c340d398302db474561 Mon Sep 17 00:00:00 2001 From: covercash2 Date: Sun, 19 May 2019 11:49:21 -0700 Subject: [PATCH 2/3] remove return statements --- amethyst_assets/src/prefab/mod.rs | 4 ++-- amethyst_renderer/src/formats/texture.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/amethyst_assets/src/prefab/mod.rs b/amethyst_assets/src/prefab/mod.rs index 39edf6de20..5785e14d3b 100644 --- a/amethyst_assets/src/prefab/mod.rs +++ b/amethyst_assets/src/prefab/mod.rs @@ -389,11 +389,11 @@ where progress, &system_data.2, )); - return Ok(true); + Ok(true) } // Already loaded - _ => return Ok(false), + _ => Ok(false), } } } diff --git a/amethyst_renderer/src/formats/texture.rs b/amethyst_renderer/src/formats/texture.rs index d130b2cf53..3428495efe 100644 --- a/amethyst_renderer/src/formats/texture.rs +++ b/amethyst_renderer/src/formats/texture.rs @@ -261,7 +261,7 @@ where progress, &system_data.1, )); - return Ok(true); + Ok(true) } TexturePrefab::File(ref name, ref format, ref options) => { @@ -272,11 +272,11 @@ where progress, &system_data.1, )); - return Ok(true); + Ok(true) } // Already loaded - TexturePrefab::Handle(_) => return Ok(false), + TexturePrefab::Handle(_) => Ok(false), } } } From 6bdc329e1d3f50f9929a7050d94c6b8df78c9c4d Mon Sep 17 00:00:00 2001 From: Timon Date: Tue, 21 May 2019 19:50:20 +0200 Subject: [PATCH 3/3] Added some more flavor to the README (#1622) --- amethyst_network/README.md | 41 +++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/amethyst_network/README.md b/amethyst_network/README.md index 86faf3bfdf..6038ce5efc 100644 --- a/amethyst_network/README.md +++ b/amethyst_network/README.md @@ -1,10 +1,41 @@ # Amethyst Networking -The networking crate for the `amethyst` game engine. The main engine can be found at https://amethyst.rs. +[![Build Status][s2]][l2] [![Latest Version][s1]][l1] [![docs.rs][s4]][l4] [![Join us on Discord][s5]][l5] [![MIT/Apache][s3]][l3] -## Status +[s1]: https://img.shields.io/crates/v/amethyst_network.svg +[l1]: https://crates.io/crates/amethyst_network +[s2]: https://jenkins.amethyst-engine.org/buildStatus/icon?job=amethyst%2Fmaster +[l2]: https://jenkins.amethyst-engine.org/job/laminar/job/master/badge/icon +[s3]: https://img.shields.io/badge/license-MIT%2FApache-blue.svg +[l3]: docs/LICENSE-MIT +[s4]: https://docs.rs/amethyst_network/badge.svg +[l4]: https://docs.rs/amethyst_network/ +[s5]: https://img.shields.io/discord/425678876929163284.svg?logo=discord +[l5]: https://discord.gg/GnP5Whs -Right now this crate is very simple and it just supports sending messages through specs to other clients. It uses a combination of `EventChannel`s -to send events between the network thread. In its current state it is not ready to be used in a game but there is work going into [Laminar](https://github.com/amethyst/laminar) that will soon be the underlying socket implemenation for this crate. +The networking crate for the `amethyst` game engine. This crate provides the API and functionality which application developers will normally use to develop multiplayer games. The main engine can be found at https://amethyst.rs. -For more information or help, please come find us on the discord server's #net channel. +This project is still at an early stage. We are currently designing and implementing a fast/robust networking system on top of specs. To exercise our implementation, we are creating a small test game which we will make public when we feel it's in a good place. Eventually, as we gain more confidence in our solution, we will move stable functionality over from that game to amethyst network. + +Currently, amethyst network supports: +- Reliable (ordered, sequenced) UDP. +- Unreliable (sequenced) UDP. +- Connect/Disconnect events from clients. +- Automatic creation of `NetConnection` on client connect. +- Automatic Fragmentation of big packets + +We use [laminar](https://github.com/amethyst/laminar) as the application layer communication protocol. + +## Contribution + +Unless you explicitly state otherwise, any Contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any +additional terms or conditions. + +For more information or help, please come find us on the amethyst discord server's `#net` channel. We are working on architecture, design, and roadmaps and can definitely use some helping hands, don't hessitate :). + +## License + +Licensed under either of + * Apache License, Version 2.0 ([LICENSE-APACHE](docs/LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](docs/LICENSE-MIT) or https://opensource.org/licenses/MIT) +at your option.