From 54335d900bd07e135a88cf3fafcdefdfbccddc72 Mon Sep 17 00:00:00 2001 From: aecsocket Date: Fri, 17 Oct 2025 13:29:24 +0100 Subject: [PATCH 1/7] Fix example UIs --- crates/aeronet_channel/examples/channel.rs | 8 +- crates/aeronet_steam/examples/steam_client.rs | 5 ++ crates/aeronet_steam/src/config.rs | 78 +++++++++---------- .../examples/websocket_client.rs | 5 ++ .../examples/websocket_server.rs | 6 +- .../examples/webtransport_client.rs | 5 ++ 6 files changed, 65 insertions(+), 42 deletions(-) diff --git a/crates/aeronet_channel/examples/channel.rs b/crates/aeronet_channel/examples/channel.rs index c740c01b..950b731d 100644 --- a/crates/aeronet_channel/examples/channel.rs +++ b/crates/aeronet_channel/examples/channel.rs @@ -23,7 +23,7 @@ fn main() -> AppExit { // This will automatically add the `AeronetIoPlugin`. ChannelIoPlugin, )) - .add_systems(Startup, setup) + .add_systems(Startup, (setup_camera, setup_io)) .add_systems(Update, add_msgs_to_ui) .add_systems(EguiPrimaryContextPass, session_ui) .run() @@ -35,7 +35,11 @@ struct SessionUi { log: Vec, } -fn setup(mut commands: Commands) { +fn setup_camera(mut commands: Commands) { + commands.spawn(Camera2d); +} + +fn setup_io(mut commands: Commands) { // Typically, you'll use commands to create a session. // With other implementations, you spawn an entity and push an // `EntityCommand` onto it to set up the session. diff --git a/crates/aeronet_steam/examples/steam_client.rs b/crates/aeronet_steam/examples/steam_client.rs index 45b5949b..a31899e5 100644 --- a/crates/aeronet_steam/examples/steam_client.rs +++ b/crates/aeronet_steam/examples/steam_client.rs @@ -27,6 +27,7 @@ fn main() -> AppExit { }) .add_plugins((DefaultPlugins, EguiPlugin::default(), SteamNetClientPlugin)) .init_resource::() + .add_systems(Startup, setup_camera) .add_systems(Update, add_msgs_to_ui) .add_systems(EguiPrimaryContextPass, (global_ui, session_ui).chain()) .add_observer(on_connecting) @@ -44,6 +45,10 @@ struct SessionUi { log: Vec, } +fn setup_camera(mut commands: Commands) { + commands.spawn(Camera2d); +} + fn on_connecting(trigger: On, names: Query<&Name>, mut log: ResMut) { let session = trigger.event_target(); let name = names diff --git a/crates/aeronet_steam/src/config.rs b/crates/aeronet_steam/src/config.rs index e889185a..1e5d97bd 100644 --- a/crates/aeronet_steam/src/config.rs +++ b/crates/aeronet_steam/src/config.rs @@ -66,45 +66,45 @@ impl SessionConfig { }; vec![ - Entry::new_float(Key::FakePacketLossSend, self.fake_packet_loss_send * 100.0), - Entry::new_float(Key::FakePacketLossRecv, self.fake_packet_loss_recv * 100.0), - Entry::new_int32( - Key::FakePacketLagSend, - duration_to_ms(self.fake_packet_lag_send), - ), - Entry::new_int32( - Key::FakePacketLagRecv, - duration_to_ms(self.fake_packet_lag_recv), - ), - Entry::new_float( - Key::FakePacketReorderSend, - self.fake_packet_reorder_send * 100.0, - ), - Entry::new_float( - Key::FakePacketReorderRecv, - self.fake_packet_reorder_recv * 100.0, - ), - Entry::new_int32( - Key::FakePacketReorderTime, - duration_to_ms(self.fake_packet_reorder_time), - ), - Entry::new_float(Key::FakePacketDupSend, self.fake_packet_dup_send * 100.0), - Entry::new_float(Key::FakePacketDupRecv, self.fake_packet_dup_recv * 100.0), - Entry::new_int32( - Key::FakePacketDupTimeMax, - duration_to_ms(self.fake_packet_dup_time_max), - ), - Entry::new_int32(Key::TimeoutInitial, duration_to_ms(self.timeout_initial)), - Entry::new_int32( - Key::TimeoutConnected, - duration_to_ms(self.timeout_connected), - ), - Entry::new_int32(Key::SendBufferSize, usize_to_i32(self.send_buffer_size)), - Entry::new_int32(Key::SendRateMin, usize_to_i32(self.send_rate_min)), - Entry::new_int32(Key::SendRateMax, usize_to_i32(self.send_rate_max)), - Entry::new_int32(Key::MTUPacketSize, usize_to_i32(self.mtu_packet_size)), - Entry::new_int32(Key::SymmetricConnect, i32::from(self.symmetric_connect)), - Entry::new_int32(Key::LocalVirtualPort, self.local_virtual_port), + // Entry::new_float(Key::FakePacketLossSend, self.fake_packet_loss_send * 100.0), + // Entry::new_float(Key::FakePacketLossRecv, self.fake_packet_loss_recv * 100.0), + // Entry::new_int32( + // Key::FakePacketLagSend, + // duration_to_ms(self.fake_packet_lag_send), + // ), + // Entry::new_int32( + // Key::FakePacketLagRecv, + // duration_to_ms(self.fake_packet_lag_recv), + // ), + // Entry::new_float( + // Key::FakePacketReorderSend, + // self.fake_packet_reorder_send * 100.0, + // ), + // Entry::new_float( + // Key::FakePacketReorderRecv, + // self.fake_packet_reorder_recv * 100.0, + // ), + // Entry::new_int32( + // Key::FakePacketReorderTime, + // duration_to_ms(self.fake_packet_reorder_time), + // ), + // Entry::new_float(Key::FakePacketDupSend, self.fake_packet_dup_send * 100.0), + // Entry::new_float(Key::FakePacketDupRecv, self.fake_packet_dup_recv * 100.0), + // Entry::new_int32( + // Key::FakePacketDupTimeMax, + // duration_to_ms(self.fake_packet_dup_time_max), + // ), + // Entry::new_int32(Key::TimeoutInitial, duration_to_ms(self.timeout_initial)), + // Entry::new_int32( + // Key::TimeoutConnected, + // duration_to_ms(self.timeout_connected), + // ), + // Entry::new_int32(Key::SendBufferSize, usize_to_i32(self.send_buffer_size)), + // Entry::new_int32(Key::SendRateMin, usize_to_i32(self.send_rate_min)), + // Entry::new_int32(Key::SendRateMax, usize_to_i32(self.send_rate_max)), + // Entry::new_int32(Key::MTUPacketSize, usize_to_i32(self.mtu_packet_size)), + // Entry::new_int32(Key::SymmetricConnect, i32::from(self.symmetric_connect)), + // Entry::new_int32(Key::LocalVirtualPort, self.local_virtual_port), ] } } diff --git a/crates/aeronet_websocket/examples/websocket_client.rs b/crates/aeronet_websocket/examples/websocket_client.rs index 2830bc18..2f94d802 100644 --- a/crates/aeronet_websocket/examples/websocket_client.rs +++ b/crates/aeronet_websocket/examples/websocket_client.rs @@ -16,6 +16,7 @@ fn main() -> AppExit { App::new() .add_plugins((DefaultPlugins, EguiPlugin::default(), WebSocketClientPlugin)) .init_resource::() + .add_systems(Startup, setup_camera) .add_systems(Update, add_msgs_to_ui) .add_systems(EguiPrimaryContextPass, (global_ui, session_ui).chain()) .add_observer(on_connecting) @@ -33,6 +34,10 @@ struct SessionUi { log: Vec, } +fn setup_camera(mut commands: Commands) { + commands.spawn(Camera2d); +} + fn on_connecting(trigger: On, names: Query<&Name>, mut log: ResMut) { let target = trigger.event_target(); let name = names diff --git a/crates/aeronet_websocket/examples/websocket_server.rs b/crates/aeronet_websocket/examples/websocket_server.rs index d7cb0e49..c9e94e85 100644 --- a/crates/aeronet_websocket/examples/websocket_server.rs +++ b/crates/aeronet_websocket/examples/websocket_server.rs @@ -14,7 +14,7 @@ use { fn main() -> AppExit { App::new() .add_plugins((MinimalPlugins, LogPlugin::default(), WebSocketServerPlugin)) - .add_systems(Startup, open_server) + .add_systems(Startup, (setup_camera, open_server)) .add_systems(Update, reply) .add_observer(on_opened) .add_observer(on_closed) @@ -24,6 +24,10 @@ fn main() -> AppExit { .run() } +fn setup_camera(mut commands: Commands) { + commands.spawn(Camera2d); +} + fn server_config() -> ServerConfig { let identity = Identity::self_signed(["localhost", "127.0.0.1", "::1"]) .expect("all given SANs should be valid DNS names"); diff --git a/crates/aeronet_webtransport/examples/webtransport_client.rs b/crates/aeronet_webtransport/examples/webtransport_client.rs index 890b78b8..d2f9d82a 100644 --- a/crates/aeronet_webtransport/examples/webtransport_client.rs +++ b/crates/aeronet_webtransport/examples/webtransport_client.rs @@ -25,6 +25,7 @@ fn main() -> AppExit { WebTransportClientPlugin, )) .init_resource::() + .add_systems(Startup, setup_camera) .add_systems(Update, add_msgs_to_ui) .add_systems(EguiPrimaryContextPass, (global_ui, session_ui).chain()) .add_observer(on_connecting) @@ -42,6 +43,10 @@ struct SessionUi { log: Vec, } +fn setup_camera(mut commands: Commands) { + commands.spawn(Camera2d); +} + fn on_connecting(trigger: On, names: Query<&Name>, mut log: ResMut) { let target = trigger.event_target(); let name = names From f4a573db5da40ab6b8831c66b95548e628045c60 Mon Sep 17 00:00:00 2001 From: aecsocket Date: Fri, 17 Oct 2025 13:35:14 +0100 Subject: [PATCH 2/7] Don't use config options for Steam cause they're broken --- crates/aeronet_steam/src/config.rs | 95 +++++++++++++++++------------- 1 file changed, 53 insertions(+), 42 deletions(-) diff --git a/crates/aeronet_steam/src/config.rs b/crates/aeronet_steam/src/config.rs index 1e5d97bd..6cd9e98f 100644 --- a/crates/aeronet_steam/src/config.rs +++ b/crates/aeronet_steam/src/config.rs @@ -1,9 +1,16 @@ use {core::time::Duration, steamworks::networking_types::NetworkingConfigEntry}; -/// Configuration for establishing a Steam networking session. +/// **(CURRENTLY BROKEN)** Configuration for establishing a Steam networking session. /// /// Default values are obtained from [`steamnetworkingsockets.cpp`][sns]. /// +/// # Currently Broken +/// +/// Due to [steamworks-rs #169](https://github.com/Noxime/steamworks-rs/issues/169), +/// these configuration options currently do nothing. If you attempt to +/// re-enable the functionality and make a non-empty vector of config entries, +/// you will always receive an invalid handle and run into a Steam error. +/// /// [sns]: https://github.com/ValveSoftware/GameNetworkingSockets/blob/62b395172f157ca4f01eea3387d1131400f8d604/src/steamnetworkingsockets/clientlib/csteamnetworkingsockets.cpp#L43 #[derive(Debug, Clone)] #[allow( @@ -65,47 +72,51 @@ impl SessionConfig { NetworkingConfigEntry as Entry, NetworkingConfigValue as Key, }; - vec![ - // Entry::new_float(Key::FakePacketLossSend, self.fake_packet_loss_send * 100.0), - // Entry::new_float(Key::FakePacketLossRecv, self.fake_packet_loss_recv * 100.0), - // Entry::new_int32( - // Key::FakePacketLagSend, - // duration_to_ms(self.fake_packet_lag_send), - // ), - // Entry::new_int32( - // Key::FakePacketLagRecv, - // duration_to_ms(self.fake_packet_lag_recv), - // ), - // Entry::new_float( - // Key::FakePacketReorderSend, - // self.fake_packet_reorder_send * 100.0, - // ), - // Entry::new_float( - // Key::FakePacketReorderRecv, - // self.fake_packet_reorder_recv * 100.0, - // ), - // Entry::new_int32( - // Key::FakePacketReorderTime, - // duration_to_ms(self.fake_packet_reorder_time), - // ), - // Entry::new_float(Key::FakePacketDupSend, self.fake_packet_dup_send * 100.0), - // Entry::new_float(Key::FakePacketDupRecv, self.fake_packet_dup_recv * 100.0), - // Entry::new_int32( - // Key::FakePacketDupTimeMax, - // duration_to_ms(self.fake_packet_dup_time_max), - // ), - // Entry::new_int32(Key::TimeoutInitial, duration_to_ms(self.timeout_initial)), - // Entry::new_int32( - // Key::TimeoutConnected, - // duration_to_ms(self.timeout_connected), - // ), - // Entry::new_int32(Key::SendBufferSize, usize_to_i32(self.send_buffer_size)), - // Entry::new_int32(Key::SendRateMin, usize_to_i32(self.send_rate_min)), - // Entry::new_int32(Key::SendRateMax, usize_to_i32(self.send_rate_max)), - // Entry::new_int32(Key::MTUPacketSize, usize_to_i32(self.mtu_packet_size)), - // Entry::new_int32(Key::SymmetricConnect, i32::from(self.symmetric_connect)), - // Entry::new_int32(Key::LocalVirtualPort, self.local_virtual_port), - ] + let entries = vec![ + Entry::new_float(Key::FakePacketLossSend, self.fake_packet_loss_send * 100.0), + Entry::new_float(Key::FakePacketLossRecv, self.fake_packet_loss_recv * 100.0), + Entry::new_int32( + Key::FakePacketLagSend, + duration_to_ms(self.fake_packet_lag_send), + ), + Entry::new_int32( + Key::FakePacketLagRecv, + duration_to_ms(self.fake_packet_lag_recv), + ), + Entry::new_float( + Key::FakePacketReorderSend, + self.fake_packet_reorder_send * 100.0, + ), + Entry::new_float( + Key::FakePacketReorderRecv, + self.fake_packet_reorder_recv * 100.0, + ), + Entry::new_int32( + Key::FakePacketReorderTime, + duration_to_ms(self.fake_packet_reorder_time), + ), + Entry::new_float(Key::FakePacketDupSend, self.fake_packet_dup_send * 100.0), + Entry::new_float(Key::FakePacketDupRecv, self.fake_packet_dup_recv * 100.0), + Entry::new_int32( + Key::FakePacketDupTimeMax, + duration_to_ms(self.fake_packet_dup_time_max), + ), + Entry::new_int32(Key::TimeoutInitial, duration_to_ms(self.timeout_initial)), + Entry::new_int32( + Key::TimeoutConnected, + duration_to_ms(self.timeout_connected), + ), + Entry::new_int32(Key::SendBufferSize, usize_to_i32(self.send_buffer_size)), + Entry::new_int32(Key::SendRateMin, usize_to_i32(self.send_rate_min)), + Entry::new_int32(Key::SendRateMax, usize_to_i32(self.send_rate_max)), + Entry::new_int32(Key::MTUPacketSize, usize_to_i32(self.mtu_packet_size)), + Entry::new_int32(Key::SymmetricConnect, i32::from(self.symmetric_connect)), + Entry::new_int32(Key::LocalVirtualPort, self.local_virtual_port), + ]; + + // CURRENTLY BROKEN: return an empty vector instead + _ = entries; + Vec::new() } } From 6c6ffc6bb45e1f2d4aebb17f25e9b93170711091 Mon Sep 17 00:00:00 2001 From: aecsocket Date: Fri, 17 Oct 2025 13:41:00 +0100 Subject: [PATCH 3/7] fuck --- Cargo.toml | 12 ++++++------ crates/aeronet/Cargo.toml | 6 +++--- crates/aeronet_io/Cargo.toml | 2 +- crates/aeronet_replicon/Cargo.toml | 8 ++++---- crates/aeronet_steam/Cargo.toml | 4 ++-- crates/aeronet_transport/Cargo.toml | 26 +++++++++++++------------- crates/aeronet_websocket/Cargo.toml | 12 ++++++------ crates/aeronet_webtransport/Cargo.toml | 26 +++++++++++++------------- 8 files changed, 48 insertions(+), 48 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2e4c2bfa..92c25c6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,12 +11,12 @@ keywords = ["bevy", "gamedev", "network"] categories = ["game-development", "network-programming"] [workspace.dependencies] -aeronet = { path = "crates/aeronet", version = "0.17.0", default-features = false } -aeronet_io = { path = "crates/aeronet_io", version = "0.17.0", default-features = false } -aeronet_replicon = { path = "crates/aeronet_replicon", version = "0.17.0", default-features = false } -aeronet_transport = { path = "crates/aeronet_transport", version = "0.17.0", default-features = false } -aeronet_websocket = { path = "crates/aeronet_websocket", version = "0.17.0" } -aeronet_webtransport = { path = "crates/aeronet_webtransport", version = "0.17.0" } +aeronet = { path = "crates/aeronet", version = "0.17.1", default-features = false } +aeronet_io = { path = "crates/aeronet_io", version = "0.17.1", default-features = false } +aeronet_replicon = { path = "crates/aeronet_replicon", version = "0.17.1", default-features = false } +aeronet_transport = { path = "crates/aeronet_transport", version = "0.17.1", default-features = false } +aeronet_websocket = { path = "crates/aeronet_websocket", version = "0.17.1" } +aeronet_webtransport = { path = "crates/aeronet_webtransport", version = "0.17.1" } anyhow = { version = "1.0.97", default-features = false } arbitrary = { version = "1.3.2", features = ["derive"] } base64 = { version = "0.22.1" } diff --git a/crates/aeronet/Cargo.toml b/crates/aeronet/Cargo.toml index 0c1c25c5..53fadfa3 100644 --- a/crates/aeronet/Cargo.toml +++ b/crates/aeronet/Cargo.toml @@ -20,14 +20,14 @@ document-features = { workspace = true, optional = true } [features] default = ["std"] -# #Enable this when generating docs. +## Enable this when generating docs. document-features = [ "aeronet_transport/document-features", "dep:document-features", ] -# #Enables standard library support. +## Enables standard library support. std = ["aeronet_transport/std"] -# #Enables `aeronet_transport/visualizer`. +## Enables `aeronet_transport/visualizer`. visualizer = ["aeronet_transport/visualizer", "std"] [lints] diff --git a/crates/aeronet_io/Cargo.toml b/crates/aeronet_io/Cargo.toml index 2482ca23..84fd398e 100644 --- a/crates/aeronet_io/Cargo.toml +++ b/crates/aeronet_io/Cargo.toml @@ -34,7 +34,7 @@ bytes = { workspace = true, features = ["extra-platforms"] } [features] default = ["std"] -# #Enables standard library support. +## Enables standard library support. std = ["anyhow/std", "bevy_platform/std", "bytes/std", "log/std"] [lints] diff --git a/crates/aeronet_replicon/Cargo.toml b/crates/aeronet_replicon/Cargo.toml index f63d0d86..109458d0 100644 --- a/crates/aeronet_replicon/Cargo.toml +++ b/crates/aeronet_replicon/Cargo.toml @@ -26,13 +26,13 @@ log = { workspace = true } [features] default = ["std"] -# #Enables support for `bevy_replicon/client`. +## Enables support for `bevy_replicon/client`. client = ["bevy_replicon/client"] -# #Enable this when generating docs. +## Enable this when generating docs. document-features = ["dep:document-features"] -# #Enables support for `bevy_replicon/server`. +## Enables support for `bevy_replicon/server`. server = ["bevy_replicon/server"] -# #Enables standard library support. +## Enables standard library support. std = ["aeronet_transport/std"] [lints] diff --git a/crates/aeronet_steam/Cargo.toml b/crates/aeronet_steam/Cargo.toml index 8e721dd5..bc50a89f 100644 --- a/crates/aeronet_steam/Cargo.toml +++ b/crates/aeronet_steam/Cargo.toml @@ -49,9 +49,9 @@ bevy_egui = { workspace = true } steamworks = { workspace = true } [features] -# #Enables the `client` module. +## Enables the `client` module. client = [] -# #Enables the `server` module. +## Enables the `server` module. server = [] [lints] diff --git a/crates/aeronet_transport/Cargo.toml b/crates/aeronet_transport/Cargo.toml index 024986fd..8c8b49d5 100644 --- a/crates/aeronet_transport/Cargo.toml +++ b/crates/aeronet_transport/Cargo.toml @@ -51,11 +51,11 @@ typesize = { workspace = true, features = ["saturating_impls"] } [features] default = ["std"] -# #Allows generating arbitrary values of some types with [`arbitrary`], useful for fuzz testing. -# # -# # [`arbitrary`]: https://docs.rs/arbitrary +## Allows generating arbitrary values of some types with [`arbitrary`], useful for fuzz testing. +## +## [`arbitrary`]: https://docs.rs/arbitrary arbitrary = ["dep:arbitrary", "std"] -# #Enable this when generating docs. +## Enable this when generating docs. document-features = [ # "Wait - why the hell does `document-features` enable `bevy_winit`!?!?" # @@ -73,17 +73,17 @@ document-features = [ "bevy_winit/x11", "dep:document-features", ] -# #Allows serializing and deserializing some types with [`serde`]. -# # -# # [`serde`]: https://docs.rs/serde +## Allows serializing and deserializing some types with [`serde`]. +## +## [`serde`]: https://docs.rs/serde serde = ["dep:serde"] -# #Enables standard library support. +## Enables standard library support. std = ["aeronet_io/std"] -# #Allows using the `visualizer` module, which draws session statistics using [`bevy_egui`] and -# # [`egui_plot`]. -# # -# # [`bevy_egui`]: https://docs.rs/bevy_egui -# # [`egui_plot`]: https://docs.rs/egui_plot +## Allows using the `visualizer` module, which draws session statistics using [`bevy_egui`] and +## [`egui_plot`]. +## +## [`bevy_egui`]: https://docs.rs/bevy_egui +## [`egui_plot`]: https://docs.rs/egui_plot visualizer = [ "dep:bevy_egui", "dep:egui_plot", diff --git a/crates/aeronet_websocket/Cargo.toml b/crates/aeronet_websocket/Cargo.toml index e15b9f2d..ee59615f 100644 --- a/crates/aeronet_websocket/Cargo.toml +++ b/crates/aeronet_websocket/Cargo.toml @@ -66,15 +66,15 @@ web-sys = { workspace = true, features = [ [features] default = ["self-signed"] -# #Enables the `client` module. +## Enables the `client` module. client = [] -# #Enable this when generating docs. +## Enable this when generating docs. document-features = ["dep:document-features"] -# #Allows generating self-signed server certificates using [`rcgen`]. -# # -# # [`rcgen`]: https://docs.rs/rcgen +## Allows generating self-signed server certificates using [`rcgen`]. +## +## [`rcgen`]: https://docs.rs/rcgen self-signed = ["dep:rcgen"] -# #Enables the `server` module. +## Enables the `server` module. server = ["dep:tokio-rustls"] [lints] diff --git a/crates/aeronet_webtransport/Cargo.toml b/crates/aeronet_webtransport/Cargo.toml index dd21516f..89dbc3f3 100644 --- a/crates/aeronet_webtransport/Cargo.toml +++ b/crates/aeronet_webtransport/Cargo.toml @@ -66,23 +66,23 @@ xwt-web = { workspace = true } [features] default = ["self-signed"] -# #Enables the `client` module. +## Enables the `client` module. client = [] -# #Enables `wtransport/dangerous-configuration`, allowing you to use potentially dangerous -# # certificate validation configurations. -# # -# # You should not use dangerous configurations in production builds of your app. +## Enables `wtransport/dangerous-configuration`, allowing you to use potentially dangerous +## certificate validation configurations. +## +## You should not use dangerous configurations in production builds of your app. dangerous-configuration = ["wtransport/dangerous-configuration"] -# #Enable this when generating docs. +## Enable this when generating docs. document-features = ["dep:document-features"] -# #Enables `wtransport/self-signed`, allowing you to generate self-signed certificates easily for -# # use in a server. -# # -# # Note that, without explicitly allowing your server's self-signed certificate (or using -# # `dangerous-configuration` and disabling certificate validation), clients will not be able to -# # connect to a server with self-signed certificates. +## Enables `wtransport/self-signed`, allowing you to generate self-signed certificates easily for +## use in a server. +## +## Note that, without explicitly allowing your server's self-signed certificate (or using +## `dangerous-configuration` and disabling certificate validation), clients will not be able to +## connect to a server with self-signed certificates. self-signed = ["wtransport/self-signed"] -# #Enables the `server` module. +## Enables the `server` module. server = [] [lints] From d13a9b19c565e0995bbab841464c4222457f92fc Mon Sep 17 00:00:00 2001 From: aecsocket Date: Fri, 17 Oct 2025 13:44:10 +0100 Subject: [PATCH 4/7] update to 0.17.1 --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- crates/aeronet/Cargo.toml | 2 +- crates/aeronet_channel/Cargo.toml | 2 +- crates/aeronet_io/Cargo.toml | 2 +- crates/aeronet_replicon/Cargo.toml | 2 +- crates/aeronet_steam/Cargo.toml | 2 +- crates/aeronet_transport/Cargo.toml | 2 +- crates/aeronet_websocket/Cargo.toml | 2 +- crates/aeronet_webtransport/Cargo.toml | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da2b74d4..b5893e88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -92,7 +92,7 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aeronet" -version = "0.17.0" +version = "0.17.1" dependencies = [ "aeronet_io", "aeronet_transport", @@ -102,7 +102,7 @@ dependencies = [ [[package]] name = "aeronet_channel" -version = "0.17.0" +version = "0.17.1" dependencies = [ "aeronet_io", "bevy", @@ -120,7 +120,7 @@ dependencies = [ [[package]] name = "aeronet_io" -version = "0.17.0" +version = "0.17.1" dependencies = [ "anyhow", "bevy_app", @@ -134,7 +134,7 @@ dependencies = [ [[package]] name = "aeronet_replicon" -version = "0.17.0" +version = "0.17.1" dependencies = [ "aeronet_io", "aeronet_transport", @@ -150,7 +150,7 @@ dependencies = [ [[package]] name = "aeronet_steam" -version = "0.17.0" +version = "0.17.1" dependencies = [ "aeronet_io", "anyhow", @@ -170,7 +170,7 @@ dependencies = [ [[package]] name = "aeronet_transport" -version = "0.17.0" +version = "0.17.1" dependencies = [ "aeronet_io", "arbitrary", @@ -198,7 +198,7 @@ dependencies = [ [[package]] name = "aeronet_websocket" -version = "0.17.0" +version = "0.17.1" dependencies = [ "aeronet_io", "bevy", @@ -226,7 +226,7 @@ dependencies = [ [[package]] name = "aeronet_webtransport" -version = "0.17.0" +version = "0.17.1" dependencies = [ "aeronet_io", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 92c25c6b..f3e89c18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["crates/*", "examples"] [workspace.package] edition = "2024" -rust-version = "1.86.0" +rust-version = "1.88.0" repository = "https://github.com/aecsocket/aeronet" license = "MIT OR Apache-2.0" keywords = ["bevy", "gamedev", "network"] diff --git a/crates/aeronet/Cargo.toml b/crates/aeronet/Cargo.toml index 53fadfa3..5c6f905d 100644 --- a/crates/aeronet/Cargo.toml +++ b/crates/aeronet/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aeronet" -version = "0.17.0" +version = "0.17.1" edition.workspace = true rust-version.workspace = true description = "Low-level networking for Bevy" diff --git a/crates/aeronet_channel/Cargo.toml b/crates/aeronet_channel/Cargo.toml index aff48d14..4203c3a9 100644 --- a/crates/aeronet_channel/Cargo.toml +++ b/crates/aeronet_channel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aeronet_channel" -version = "0.17.0" +version = "0.17.1" edition.workspace = true description = "In-memory MPSC channel IO layer implementation for `aeronet`" repository.workspace = true diff --git a/crates/aeronet_io/Cargo.toml b/crates/aeronet_io/Cargo.toml index 84fd398e..b8b69b71 100644 --- a/crates/aeronet_io/Cargo.toml +++ b/crates/aeronet_io/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aeronet_io" -version = "0.17.0" +version = "0.17.1" edition.workspace = true rust-version.workspace = true description = "IO abstraction primitives for `aeronet`" diff --git a/crates/aeronet_replicon/Cargo.toml b/crates/aeronet_replicon/Cargo.toml index 109458d0..49bccd87 100644 --- a/crates/aeronet_replicon/Cargo.toml +++ b/crates/aeronet_replicon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aeronet_replicon" -version = "0.17.0" +version = "0.17.1" edition.workspace = true rust-version.workspace = true description = "`aeronet` backend implementation for `bevy_replicon`" diff --git a/crates/aeronet_steam/Cargo.toml b/crates/aeronet_steam/Cargo.toml index bc50a89f..9b789183 100644 --- a/crates/aeronet_steam/Cargo.toml +++ b/crates/aeronet_steam/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aeronet_steam" -version = "0.17.0" +version = "0.17.1" edition.workspace = true rust-version.workspace = true description = "Steam networking IO layer implementation for `aeronet`" diff --git a/crates/aeronet_transport/Cargo.toml b/crates/aeronet_transport/Cargo.toml index 8c8b49d5..5be1a820 100644 --- a/crates/aeronet_transport/Cargo.toml +++ b/crates/aeronet_transport/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aeronet_transport" -version = "0.17.0" +version = "0.17.1" edition.workspace = true rust-version.workspace = true description = "Transport layer implementation for `aeronet`" diff --git a/crates/aeronet_websocket/Cargo.toml b/crates/aeronet_websocket/Cargo.toml index ee59615f..dae12f1a 100644 --- a/crates/aeronet_websocket/Cargo.toml +++ b/crates/aeronet_websocket/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aeronet_websocket" -version = "0.17.0" +version = "0.17.1" edition.workspace = true rust-version.workspace = true description = "WebSocket IO layer implementation for `aeronet`" diff --git a/crates/aeronet_webtransport/Cargo.toml b/crates/aeronet_webtransport/Cargo.toml index 89dbc3f3..3357e0ce 100644 --- a/crates/aeronet_webtransport/Cargo.toml +++ b/crates/aeronet_webtransport/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aeronet_webtransport" -version = "0.17.0" +version = "0.17.1" edition.workspace = true rust-version.workspace = true description = "WebTransport IO layer implementation for `aeronet`" From e1b7c1b71b577cac0ac276ba693bcde3c5d6e1ec Mon Sep 17 00:00:00 2001 From: aecsocket Date: Fri, 17 Oct 2025 13:52:32 +0100 Subject: [PATCH 5/7] more rigorous clippy CI stuff --- .github/workflows/rust.yml | 4 ++-- crates/aeronet_steam/examples/steam_client.rs | 12 +++++------- .../aeronet_websocket/examples/websocket_client.rs | 12 +++++------- .../examples/webtransport_client.rs | 12 +++++------- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fcdf652e..c99e33b9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,7 +38,7 @@ jobs: with: components: clippy - uses: ./.github/actions/install-bevy-deps - - run: cargo clippy --target '${{ matrix.target }}' --workspace --all-features -- -Dwarnings + - run: cargo clippy --target '${{ matrix.target }}' --workspace --all-features --all-targets -- -Dwarnings doc: runs-on: ubuntu-latest @@ -65,7 +65,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: ./.github/actions/install-bevy-deps - - run: cargo check --target '${{ matrix.target }}' --workspace --all-features + - run: cargo check --target '${{ matrix.target }}' --workspace --all-features --all-targets check-fuzz: runs-on: ubuntu-latest diff --git a/crates/aeronet_steam/examples/steam_client.rs b/crates/aeronet_steam/examples/steam_client.rs index a31899e5..84e30feb 100644 --- a/crates/aeronet_steam/examples/steam_client.rs +++ b/crates/aeronet_steam/examples/steam_client.rs @@ -197,13 +197,11 @@ fn session_ui( }) .inner; - if send_msg { - if let Some(session) = &mut session { - let msg = mem::take(&mut ui_state.msg); - ui_state.log.push(format!("< {msg}")); - session.send.push(msg.into()); - ui.memory_mut(|m| m.request_focus(msg_resp.id)); - } + if send_msg && let Some(session) = &mut session { + let msg = mem::take(&mut ui_state.msg); + ui_state.log.push(format!("< {msg}")); + session.send.push(msg.into()); + ui.memory_mut(|m| m.request_focus(msg_resp.id)); } if ui.button("Disconnect").clicked() { diff --git a/crates/aeronet_websocket/examples/websocket_client.rs b/crates/aeronet_websocket/examples/websocket_client.rs index 2f94d802..0a962d89 100644 --- a/crates/aeronet_websocket/examples/websocket_client.rs +++ b/crates/aeronet_websocket/examples/websocket_client.rs @@ -173,13 +173,11 @@ fn session_ui( }) .inner; - if send_msg { - if let Some(session) = &mut session { - let msg = mem::take(&mut ui_state.msg); - ui_state.log.push(format!("< {msg}")); - session.send.push(msg.into()); - ui.memory_mut(|m| m.request_focus(msg_resp.id)); - } + if send_msg && let Some(session) = &mut session { + let msg = mem::take(&mut ui_state.msg); + ui_state.log.push(format!("< {msg}")); + session.send.push(msg.into()); + ui.memory_mut(|m| m.request_focus(msg_resp.id)); } if ui.button("Disconnect").clicked() { diff --git a/crates/aeronet_webtransport/examples/webtransport_client.rs b/crates/aeronet_webtransport/examples/webtransport_client.rs index d2f9d82a..918f2c4a 100644 --- a/crates/aeronet_webtransport/examples/webtransport_client.rs +++ b/crates/aeronet_webtransport/examples/webtransport_client.rs @@ -241,13 +241,11 @@ fn session_ui( }) .inner; - if send_msg { - if let Some(session) = &mut session { - let msg = mem::take(&mut ui_state.msg); - ui_state.log.push(format!("< {msg}")); - session.send.push(msg.into()); - ui.memory_mut(|m| m.request_focus(msg_resp.id)); - } + if send_msg && let Some(session) = &mut session { + let msg = mem::take(&mut ui_state.msg); + ui_state.log.push(format!("< {msg}")); + session.send.push(msg.into()); + ui.memory_mut(|m| m.request_focus(msg_resp.id)); } if ui.button("Disconnect").clicked() { From c58c42dc8164d5f62ec61458960b0b004f294961 Mon Sep 17 00:00:00 2001 From: aecsocket Date: Fri, 17 Oct 2025 13:53:07 +0100 Subject: [PATCH 6/7] fmt --- crates/aeronet_steam/src/config.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/aeronet_steam/src/config.rs b/crates/aeronet_steam/src/config.rs index 6cd9e98f..ebade38b 100644 --- a/crates/aeronet_steam/src/config.rs +++ b/crates/aeronet_steam/src/config.rs @@ -1,6 +1,7 @@ use {core::time::Duration, steamworks::networking_types::NetworkingConfigEntry}; -/// **(CURRENTLY BROKEN)** Configuration for establishing a Steam networking session. +/// **(CURRENTLY BROKEN)** Configuration for establishing a Steam networking +/// session. /// /// Default values are obtained from [`steamnetworkingsockets.cpp`][sns]. /// From 164c506e48be756d4c52c0173c40a28c7c49c797 Mon Sep 17 00:00:00 2001 From: aecsocket Date: Fri, 17 Oct 2025 14:35:28 +0100 Subject: [PATCH 7/7] fix ci --- Cargo.lock | 1 + crates/aeronet_steam/Cargo.toml | 1 + crates/aeronet_steam/examples/steam_client.rs | 9 +++++++++ crates/aeronet_steam/examples/steam_server.rs | 9 +++++++++ crates/aeronet_websocket/Cargo.toml | 1 + crates/aeronet_websocket/examples/websocket_server.rs | 9 +++++++++ .../aeronet_webtransport/examples/webtransport_server.rs | 9 +++++++++ 7 files changed, 39 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index b5893e88..6e76e3e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -161,6 +161,7 @@ dependencies = [ "bevy_platform", "blocking", "bytes", + "cfg-if", "derive_more", "oneshot", "steamworks", diff --git a/crates/aeronet_steam/Cargo.toml b/crates/aeronet_steam/Cargo.toml index 9b789183..588b9a87 100644 --- a/crates/aeronet_steam/Cargo.toml +++ b/crates/aeronet_steam/Cargo.toml @@ -44,6 +44,7 @@ tracing = { workspace = true } [dev-dependencies] bevy = { workspace = true } bevy_egui = { workspace = true } +cfg-if = { workspace = true } [target.'cfg(not(target_family = "wasm"))'.dependencies] steamworks = { workspace = true } diff --git a/crates/aeronet_steam/examples/steam_client.rs b/crates/aeronet_steam/examples/steam_client.rs index 84e30feb..8494733f 100644 --- a/crates/aeronet_steam/examples/steam_client.rs +++ b/crates/aeronet_steam/examples/steam_client.rs @@ -1,6 +1,13 @@ //! Example showing a Steam sockets client which can send and receive UTF-8 //! strings. +cfg_if::cfg_if! { + if #[cfg(target_family = "wasm")] { + fn main() { + panic!("not supported on WASM"); + } + } else { + use { aeronet_io::{ Session, SessionEndpoint, @@ -234,3 +241,5 @@ fn session_ui( Ok(()) } + +}} diff --git a/crates/aeronet_steam/examples/steam_server.rs b/crates/aeronet_steam/examples/steam_server.rs index eb62a129..3a6d2f7a 100644 --- a/crates/aeronet_steam/examples/steam_server.rs +++ b/crates/aeronet_steam/examples/steam_server.rs @@ -1,6 +1,13 @@ //! Example server using Steam which listens for clients sending strings and //! sends back a string reply. +cfg_if::cfg_if! { + if #[cfg(target_family = "wasm")] { + fn main() { + panic!("not supported on WASM"); + } + } else { + use { aeronet_io::{ Session, SessionEndpoint, @@ -129,3 +136,5 @@ fn reply(mut clients: Query<(Entity, &mut Session), With>) { } } } + +}} diff --git a/crates/aeronet_websocket/Cargo.toml b/crates/aeronet_websocket/Cargo.toml index dae12f1a..4d9018f8 100644 --- a/crates/aeronet_websocket/Cargo.toml +++ b/crates/aeronet_websocket/Cargo.toml @@ -43,6 +43,7 @@ tracing = { workspace = true } [dev-dependencies] bevy = { workspace = true } bevy_egui = { workspace = true } +cfg-if = { workspace = true } [target.'cfg(not(target_family = "wasm"))'.dependencies] rcgen = { workspace = true, optional = true } diff --git a/crates/aeronet_websocket/examples/websocket_server.rs b/crates/aeronet_websocket/examples/websocket_server.rs index c9e94e85..bf8dfd56 100644 --- a/crates/aeronet_websocket/examples/websocket_server.rs +++ b/crates/aeronet_websocket/examples/websocket_server.rs @@ -1,6 +1,13 @@ //! Example server using WebSocket which listens for clients sending strings //! and sends back a string reply. +cfg_if::cfg_if! { + if #[cfg(target_family = "wasm")] { + fn main() { + panic!("not supported on WASM"); + } + } else { + use { aeronet_io::{ Session, SessionEndpoint, @@ -105,3 +112,5 @@ fn reply(mut clients: Query<(Entity, &mut Session), With>) { } } } + +}} diff --git a/crates/aeronet_webtransport/examples/webtransport_server.rs b/crates/aeronet_webtransport/examples/webtransport_server.rs index 8487fba4..66287747 100644 --- a/crates/aeronet_webtransport/examples/webtransport_server.rs +++ b/crates/aeronet_webtransport/examples/webtransport_server.rs @@ -1,6 +1,13 @@ //! Example server using WebTransport which listens for clients sending strings //! and sends back a string reply. +cfg_if::cfg_if! { + if #[cfg(target_family = "wasm")] { + fn main() { + panic!("not supported on WASM"); + } + } else { + use { aeronet_io::{ Session, @@ -133,3 +140,5 @@ fn reply(mut clients: Query<(Entity, &mut Session), With>) { } } } + +}}