Skip to main content

Crate fortress_rollback

Crate fortress_rollback 

Source
Expand description

§Fortress Rollback (formerly GGRS)

Fortress Rollback

Fortress Rollback is a fortified, verified reimagination of the GGPO network SDK written in 100% safe Rust. The callback-style API from the original library has been replaced with a simple request-driven control flow. Instead of registering callback functions, Fortress Rollback (previously GGRS) returns a list of requests for the user to fulfill.

Re-exports§

pub use checksum::compute_checksum;
pub use checksum::compute_checksum_fletcher16;
pub use checksum::fletcher16;
pub use checksum::hash_bytes_fnv1a;

Modules§

checksum
State checksum utilities for rollback networking.
hash
Deterministic hashing utilities.
prelude
Convenient re-exports for common usage.
rle
Internal run-length encoding module for network compression.
rng
Internal random number generator module based on PCG32.
telemetry
Structured telemetry pipeline for specification violations.

Macros§

assert_invariants
Macro for checking invariants and panicking if violated (debug only).
assert_no_violations
Asserts that no violations have been collected.
assert_violation
Asserts that a violation of the specified kind was collected.
debug_check_invariants
Macro for conditionally checking invariants in debug builds.
handle_requests
Macro to simplify handling FortressRequest variants in a game loop.
report_violation
Macro for reporting specification violations with location tracking.
report_violation_to
Macro for reporting specification violations through a session’s observer.
safe_frame_add
Safely adds a value to a Frame, reporting a violation if overflow would occur.
safe_frame_sub
Safely subtracts a value from a Frame, reporting a violation if overflow would occur.
try_check_invariants
Macro for checking invariants and returning a Result.

Structs§

BlankPrediction
A prediction strategy that always returns the default (blank) input.
ChaosConfig
Configuration for network chaos simulation.
ChaosConfigBuilder
Builder for ChaosConfig.
ChaosSocket
A socket wrapper that injects configurable network chaos.
ChaosStats
Statistics about chaos socket behavior.
Frame
A frame is a single step of game execution.
GameStateAccessor
A read-only accessor for the T that the user previously saved into a GameStateCell.
GameStateCell
A thread-safe cell for saving and loading game states during rollback.
IndexOutOfBounds
Represents an index out of bounds error with full context.
InputQueueConfig
Configuration for input queue sizing.
Message
A messages that NonBlockingSocket sends and receives. When implementing NonBlockingSocket, you should deserialize received messages into this Message type and pass them.
NetworkStats
The NetworkStats struct contains statistics about the current session.
P2PSession
A P2PSession provides all functionality to connect to remote clients in a peer-to-peer fashion, exchange inputs and handle the gamestate by saving, loading and advancing.
PlayerHandle
A unique identifier for a player or spectator in a session.
PlayerRegistry
Registry tracking all players and their connection states.
ProtocolConfig
Configuration for network protocol behavior.
RepeatLastConfirmed
The default prediction strategy: repeat the last confirmed input.
SessionBuilder
The SessionBuilder builds all Fortress Rollback Sessions.
SmallVec
A Vec-like container that can store a small number of elements inline.
SpectatorConfig
Configuration for spectator sessions.
SpectatorSession
SpectatorSession provides all functionality to connect to a remote host in a peer-to-peer fashion.
SyncConfig
Configuration for the synchronization protocol.
SyncTestSession
During a SyncTestSession, Fortress Rollback will simulate a rollback every frame and resimulate the last n states, where n is the given check distance.
TimeSyncConfig
Configuration for time synchronization behavior.
UdpNonBlockingSocket
A simple non-blocking UDP socket to use with Fortress Rollback Sessions. Listens to 0.0.0.0 on a given port.

Enums§

DeltaDecodeReason
Represents why a delta decode operation failed.
DesyncDetection
Desync detection by comparing checksums between peers.
FortressError
This enum contains all error messages this library can return. Most API functions will generally return a Result<(), FortressError>.
FortressEvent
Notifications that you can receive from the session. Handling them is up to the user.
FortressRequest
Requests that you can receive from the session. Handling them is mandatory.
InputStatus
InputStatus will always be given together with player inputs when requested to advance the frame.
InternalErrorKind
Specific internal error kinds with structured data.
InvalidFrameReason
Represents why a frame was invalid.
InvalidRequestKind
Represents why a request was invalid.
PlayerType
Defines the three types of players that Fortress Rollback considers:
RleDecodeReason
Represents why an RLE decode operation failed.
SaveMode
Controls how game states are saved for rollback.
SerializationErrorKind
Represents why serialization failed.
SessionState
A session is always in one of these states. You can query the current state of a session via current_state.
SocketErrorKind
Represents why a socket operation failed.
SyncHealth
Health status of synchronization with a remote peer.

Constants§

NULL_FRAME
Internally, -1 represents no frame / invalid frame.

Traits§

Config
Compile time parameterization for sessions.
NonBlockingSocket
A trait for integrating custom socket implementations with Fortress Rollback.
PredictionStrategy
Defines the strategy used to predict inputs when we haven’t received the actual input yet.

Type Aliases§

FortressResult
A specialized Result type for Fortress Rollback operations.
InputVec
Stack-allocated vector type for player inputs.