@@ -105,7 +105,7 @@ For implementation details see [`ServerChannel`](shared::backend::channels::Serv
105105### Tick rate
106106
107107By default, updates are not sent every frame in order to save bandwidth. Replication runs
108- in [`ServerSystems::Send`] whenever the [`ServerTick`](server ::server_tick::ServerTick) resource
108+ in [`ServerSystems::Send`] whenever the [`ServerTick`](shared::replication::send ::server_tick::ServerTick) resource
109109changes and if the state is [`ServerState::Running`].
110110
111111By default, the tick is incremented in [`FixedPostUpdate`] each time [`FixedMain`](bevy::app::FixedMain)
@@ -283,6 +283,8 @@ These messages will appear on server as [`FromClient`] wrapper message that
283283contains sender ID and the message.
284284
285285```
286+ # #[cfg(all(feature = "client", feature = "server"))]
287+ # {
286288# use bevy::{prelude::*, state::app::StatesPlugin};
287289# use bevy_replicon::prelude::*;
288290# use serde::{Deserialize, Serialize};
@@ -312,6 +314,7 @@ fn receive(mut pings: MessageReader<FromClient<Ping>>) {
312314
313315#[derive(Message, Deserialize, Serialize)]
314316struct Ping;
317+ # }
315318```
316319
317320If a message contains an entity, implement
@@ -327,6 +330,8 @@ Alternatively, you can use events with a similar API. First, you need to registe
327330using [`ClientEventAppExt::add_client_event`], and then use [`ClientTriggerExt::client_trigger`].
328331
329332```
333+ # #[cfg(all(feature = "client", feature = "server"))]
334+ # {
330335# use bevy::{prelude::*, state::app::StatesPlugin};
331336# use bevy_replicon::prelude::*;
332337# use serde::{Deserialize, Serialize};
@@ -345,6 +350,7 @@ fn receive(ping: On<FromClient<Ping>>) {
345350}
346351# #[derive(Event, Deserialize, Serialize)]
347352# struct Ping;
353+ # }
348354```
349355
350356For events with entities inside use [`ClientEventAppExt::add_mapped_client_event`].
@@ -358,6 +364,8 @@ and send it from server using [`ToClients`]. This wrapper contains send paramete
358364and the message itself.
359365
360366```
367+ # #[cfg(all(feature = "client", feature = "server"))]
368+ # {
361369# use bevy::{prelude::*, state::app::StatesPlugin};
362370# use bevy_replicon::prelude::*;
363371# use serde::{Deserialize, Serialize};
@@ -390,6 +398,7 @@ fn receive(mut pongs: MessageReader<Pong>) {
390398
391399#[derive(Message, Deserialize, Serialize)]
392400struct Pong;
401+ # }
393402```
394403
395404Just like for client messages, we provide [`ServerMessageAppExt::add_mapped_server_message`]
@@ -727,11 +736,13 @@ pub mod prelude {
727736
728737 #[ cfg( feature = "server" ) ]
729738 #[ expect( deprecated, reason = "Re-export of deprecated aliases" ) ]
730- pub use super :: server:: {
731- AuthorizedClient , PriorityMap , ServerPlugin , ServerSystems ,
732- message:: ServerMessagePlugin ,
733- visibility:: {
734- AppVisibilityExt , ComponentScope , FilterScope , SingleComponent , VisibilityFilter ,
739+ pub use super :: {
740+ server:: { AuthorizedClient , ServerPlugin , ServerSystems , message:: ServerMessagePlugin } ,
741+ shared:: replication:: send:: {
742+ priority_map:: PriorityMap ,
743+ visibility:: {
744+ AppVisibilityExt , ComponentScope , FilterScope , SingleComponent , VisibilityFilter ,
745+ } ,
735746 } ,
736747 } ;
737748
0 commit comments