Skip to content

Commit

Permalink
v0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gschup committed Nov 10, 2023
1 parent f1593f9 commit 0161634
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_ggrs"
version = "0.13.0"
version = "0.14.0"
authors = ["Georg Schuppe <georg.schuppe@gmail.com>"]
edition = "2021"
description = "Bevy plugin for the GGRS P2P rollback networking library"
Expand All @@ -20,8 +20,8 @@ bevy = { version = "0.12", default-features = false }
bytemuck = { version = "1.7", features=["derive"]}
instant = { version = "0.1", optional = true }
log = "0.4"
#ggrs = { version= "0.9.4", features=["sync-send"]}
ggrs = { git = "/~https://github.com/gschup/ggrs", features=["sync-send"]}
ggrs = { version= "0.10.0", features=["sync-send"]}
#ggrs = { git = "/~https://github.com/gschup/ggrs", features=["sync-send"]}

[dev-dependencies]
bevy = { version = "0.12", default-features = true }
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub mod prelude {
snapshot::prelude::*, AddRollbackCommandExtension, GgrsApp, GgrsConfig, GgrsPlugin,
GgrsSchedule, GgrsTime, PlayerInputs, ReadInputs, Rollback, Session,
};
pub use ggrs::{GGRSEvent as GgrsEvent, PlayerType, SessionBuilder};
pub use ggrs::{GgrsEvent, PlayerType, SessionBuilder};
}

/// A sensible default [GGRS Config](`ggrs::Config`) type suitable for most applications.
Expand Down
14 changes: 7 additions & 7 deletions src/schedule_systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
};
use bevy::{prelude::*, utils::Duration};
use ggrs::{
Config, GGRSError, GGRSRequest, P2PSession, SessionState, SpectatorSession, SyncTestSession,
Config, GgrsError, GgrsRequest, P2PSession, SessionState, SpectatorSession, SyncTestSession,
};

pub(crate) fn run_ggrs_schedules<T: Config>(world: &mut World) {
Expand Down Expand Up @@ -104,7 +104,7 @@ pub(crate) fn run_spectator<T: Config>(world: &mut World, mut sess: SpectatorSes

match requests {
Some(Ok(requests)) => handle_requests(requests, world),
Some(Err(GGRSError::PredictionThreshold)) => {
Some(Err(GgrsError::PredictionThreshold)) => {
info!("P2PSpectatorSession: Waiting for input from host.")
}
Some(Err(e)) => warn!("{e}"),
Expand Down Expand Up @@ -137,15 +137,15 @@ pub(crate) fn run_p2p<C: Config>(world: &mut World, mut sess: P2PSession<C>) {

match requests {
Some(Ok(requests)) => handle_requests(requests, world),
Some(Err(GGRSError::PredictionThreshold)) => {
Some(Err(GgrsError::PredictionThreshold)) => {
info!("Skipping a frame: PredictionThreshold.")
}
Some(Err(e)) => warn!("{e}"),
None => {}
}
}

pub(crate) fn handle_requests<T: Config>(requests: Vec<GGRSRequest<T>>, world: &mut World) {
pub(crate) fn handle_requests<T: Config>(requests: Vec<GgrsRequest<T>>, world: &mut World) {
let _span = bevy::utils::tracing::info_span!("ggrs", name = "HandleRequests").entered();

// Extracting schedules before processing requests to avoid repeated remove/insert operations
Expand Down Expand Up @@ -198,7 +198,7 @@ pub(crate) fn handle_requests<T: Config>(requests: Vec<GGRSRequest<T>>, world: &
}

match request {
GGRSRequest::SaveGameState { cell, frame } => {
GgrsRequest::SaveGameState { cell, frame } => {
let _span =
bevy::utils::tracing::info_span!("schedule", name = "SaveWorld").entered();
debug!("saving snapshot for frame {frame}");
Expand All @@ -213,7 +213,7 @@ pub(crate) fn handle_requests<T: Config>(requests: Vec<GGRSRequest<T>>, world: &
// we don't really use the buffer provided by GGRS
cell.save(frame, None, checksum);
}
GGRSRequest::LoadGameState { frame, .. } => {
GgrsRequest::LoadGameState { frame, .. } => {
let _span =
bevy::utils::tracing::info_span!("schedule", name = "LoadWorld").entered();
// we don't really use the buffer provided by GGRS
Expand All @@ -226,7 +226,7 @@ pub(crate) fn handle_requests<T: Config>(requests: Vec<GGRSRequest<T>>, world: &

load_world_schedule.run(world);
}
GGRSRequest::AdvanceFrame { inputs } => {
GgrsRequest::AdvanceFrame { inputs } => {
let _span =
bevy::utils::tracing::info_span!("schedule", name = "AdvanceWorld").entered();
let mut frame_count = world
Expand Down

0 comments on commit 0161634

Please sign in to comment.