Skip to content

Commit

Permalink
replace WorldDiff-based replication with a buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
UkoeHB committed Sep 20, 2023
1 parent 0f8f204 commit 8837099
Show file tree
Hide file tree
Showing 3 changed files with 347 additions and 203 deletions.
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bevy_renet::transport::client_connected;
use bevy_renet::{renet::RenetClient, transport::NetcodeClientPlugin, RenetClientPlugin};

use crate::{
replicon_core::{Mapper, NetworkTick, WorldDiff, REPLICATION_CHANNEL_ID},
replicon_core::{deserialize_to_world, Mapper, NetworkTick, REPLICATION_CHANNEL_ID},
Replication,
};

Expand Down Expand Up @@ -48,7 +48,7 @@ impl ClientPlugin {
fn diff_receiving_system(world: &mut World) {
world.resource_scope(|world, mut client: Mut<RenetClient>| {
while let Some(message) = client.receive_message(REPLICATION_CHANNEL_ID) {
WorldDiff::deserialize_to_world(world, message)
deserialize_to_world(world, message)
.expect("server should send only valid world diffs");
}
});
Expand Down
Loading

0 comments on commit 8837099

Please sign in to comment.