From 016163476daa7da14db87a1a66618fbf42c79b79 Mon Sep 17 00:00:00 2001 From: Georg Schuppe Date: Fri, 10 Nov 2023 10:15:42 +0100 Subject: [PATCH] v0.14.0 --- Cargo.toml | 6 +++--- src/lib.rs | 2 +- src/schedule_systems.rs | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e24544d..fedfea7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_ggrs" -version = "0.13.0" +version = "0.14.0" authors = ["Georg Schuppe "] edition = "2021" description = "Bevy plugin for the GGRS P2P rollback networking library" @@ -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 } diff --git a/src/lib.rs b/src/lib.rs index 5f3f4fb..ce56973 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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. diff --git a/src/schedule_systems.rs b/src/schedule_systems.rs index 46bbc07..22d6d66 100644 --- a/src/schedule_systems.rs +++ b/src/schedule_systems.rs @@ -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(world: &mut World) { @@ -104,7 +104,7 @@ pub(crate) fn run_spectator(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}"), @@ -137,7 +137,7 @@ pub(crate) fn run_p2p(world: &mut World, mut sess: P2PSession) { 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}"), @@ -145,7 +145,7 @@ pub(crate) fn run_p2p(world: &mut World, mut sess: P2PSession) { } } -pub(crate) fn handle_requests(requests: Vec>, world: &mut World) { +pub(crate) fn handle_requests(requests: Vec>, 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 @@ -198,7 +198,7 @@ pub(crate) fn handle_requests(requests: Vec>, 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}"); @@ -213,7 +213,7 @@ pub(crate) fn handle_requests(requests: Vec>, 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 @@ -226,7 +226,7 @@ pub(crate) fn handle_requests(requests: Vec>, 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