Expand description
§Fortress Rollback (formerly GGRS)
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
FortressRequestvariants 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§
- Blank
Prediction - A prediction strategy that always returns the default (blank) input.
- Chaos
Config - Configuration for network chaos simulation.
- Chaos
Config Builder - Builder for
ChaosConfig. - Chaos
Socket - A socket wrapper that injects configurable network chaos.
- Chaos
Stats - Statistics about chaos socket behavior.
- Frame
- A frame is a single step of game execution.
- Game
State Accessor - A read-only accessor for the
Tthat the user previously saved into a GameStateCell. - Game
State Cell - A thread-safe cell for saving and loading game states during rollback.
- Index
OutOf Bounds - Represents an index out of bounds error with full context.
- Input
Queue Config - Configuration for input queue sizing.
- Message
- A messages that
NonBlockingSocketsends and receives. When implementingNonBlockingSocket, you should deserialize received messages into thisMessagetype and pass them. - Network
Stats - The
NetworkStatsstruct contains statistics about the current session. - P2PSession
- A
P2PSessionprovides all functionality to connect to remote clients in a peer-to-peer fashion, exchange inputs and handle the gamestate by saving, loading and advancing. - Player
Handle - A unique identifier for a player or spectator in a session.
- Player
Registry - Registry tracking all players and their connection states.
- Protocol
Config - Configuration for network protocol behavior.
- Repeat
Last Confirmed - The default prediction strategy: repeat the last confirmed input.
- Session
Builder - The
SessionBuilderbuilds all Fortress Rollback Sessions. - Small
Vec - A
Vec-like container that can store a small number of elements inline. - Spectator
Config - Configuration for spectator sessions.
- Spectator
Session SpectatorSessionprovides all functionality to connect to a remote host in a peer-to-peer fashion.- Sync
Config - Configuration for the synchronization protocol.
- Sync
Test Session - During a
SyncTestSession, Fortress Rollback will simulate a rollback every frame and resimulate the last n states, where n is the given check distance. - Time
Sync Config - Configuration for time synchronization behavior.
- UdpNon
Blocking Socket - A simple non-blocking UDP socket to use with Fortress Rollback Sessions. Listens to 0.0.0.0 on a given port.
Enums§
- Delta
Decode Reason - Represents why a delta decode operation failed.
- Desync
Detection - Desync detection by comparing checksums between peers.
- Fortress
Error - This enum contains all error messages this library can return. Most API functions will generally return a
Result<(), FortressError>. - Fortress
Event - Notifications that you can receive from the session. Handling them is up to the user.
- Fortress
Request - Requests that you can receive from the session. Handling them is mandatory.
- Input
Status InputStatuswill always be given together with player inputs when requested to advance the frame.- Internal
Error Kind - Specific internal error kinds with structured data.
- Invalid
Frame Reason - Represents why a frame was invalid.
- Invalid
Request Kind - Represents why a request was invalid.
- Player
Type - Defines the three types of players that Fortress Rollback considers:
- RleDecode
Reason - Represents why an RLE decode operation failed.
- Save
Mode - Controls how game states are saved for rollback.
- Serialization
Error Kind - Represents why serialization failed.
- Session
State - A session is always in one of these states. You can query the current state of a session via
current_state. - Socket
Error Kind - Represents why a socket operation failed.
- Sync
Health - 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.
- NonBlocking
Socket - A trait for integrating custom socket implementations with Fortress Rollback.
- Prediction
Strategy - Defines the strategy used to predict inputs when we haven’t received the actual input yet.
Type Aliases§
- Fortress
Result - A specialized
Resulttype for Fortress Rollback operations. - Input
Vec - Stack-allocated vector type for player inputs.