Represents a Quantum runtime match, holding the references to Game, its Frames (game state) and Simulator, and implements (together with Simulator) the predict/rollback logic, time control and input management. Single use, so whenever a Session is shutdown (or disconnected), it can't be reused anymore and a new one must be instantiated.
More...
|
| DeterministicSession (DeterministicSessionArgs args) |
| Validates a few conditions to assert the session object has coherent settings. After construction, session is ready to Join/Start a game. More...
|
|
void | AddPlayer (int playerSlot, Byte[] data) |
| Attempts to add a local player slot to have input controlled by the session. Fails is local slot is already used, or if the server/plugin does not have an available PlayerRef. More...
|
|
void | ApplyTimeOffset (Double time) |
| Legacy method to manually add time to the internal Simulator. Not used anymore by the standard SDK, but available to legacy projects. More...
|
|
void | Destroy () |
| Terminates the game/session, Disposing all buffers and objects. More...
|
|
void | GetLocalConfigs (out DeterministicSessionConfig sessionConfig, out Byte[] runtimeConfig) |
| Retrieves the local copies of the main configs. More...
|
|
Boolean | IsFrameVerified (int frame) |
| true if the latest confirmed/verified frame is equals or larger then this. More...
|
|
Boolean | IsLocalPlayer (PlayerRef player) |
| true if this global PlayerRef is controlled by the local session. More...
|
|
bool | IsPlayerLocal (PlayerRef player) |
| Tests whereas this PlayerRef is controlled by this local client/session. More...
|
|
bool | IsPlayerSlotLocal (int playerSlot) |
| Checks if this local player slot is currently in use (local slots can be added/removed dynamically). More...
|
|
void | Join (String id) |
| Sends the Join protocol message to server/plugin. If successful, a start protocol message (and optionally a snapshot) will be received and the session will start to be updated. Sessions are always joined as spectators (starting on Quantum 3.0), and adding local players that can have input polled for is a dynamic operation done after session start. More...
|
|
void | RemovePlayer (Int32 playerSlot) |
| Attempts to remove a local player slot from the session. Fails is local slot is not currently in use. More...
|
|
void | ResetReplay (DeterministicFrame frame) |
| Resets the session to the specified frame for replay purposes. More...
|
|
void | Resync (Byte[] frameData, Int32 frameNumber) |
| Resynchronizes the session based on the provided frame data and frame number. More...
|
|
void | Resync (DeterministicFrame frame) |
| Resynchronizes the session to the specified frame. More...
|
|
DeterministicCommandSendResult | SendCommand (Int32 playerSlot, DeterministicCommand command) |
| Includes command for local prediction, and sends to server (in online games) for confirmation. Fails if this slot is not in use by the local session/client. Server protects against all forms of spoofing in online games. More...
|
|
void | SendGameResult (Byte[] data) |
| Supports sending one game result during one session per client. Send this based on timing and simulation data of a verified frame to make results be comparable. Data can be any format but the size must be below Protocol.GameResult.MaxSize. Zip compress Json for example to reduce the size. More...
|
|
void | SetPlayerData (int playerSlot, Byte[] data) |
| Previously could be called multiple times to send custom data relative to a player. AddPlayer replaces it, and can only be called once for a specific slot. More...
|
|
bool | TryGetLocalPlayer (int playerSlot, out PlayerRef player) |
| Returns true and fills in the corresponding global PlayerRef if playerSlot is a valid local slot, for which the session can send input. More...
|
|
void | Update (Double? deltaTime=null) |
| Called to move the simulation forward (poll local input, decode confirmed, simulate verified and predicted frames). When passing a delta time, the internal Stopwatch is ignored. More...
|
|
|
Double | AccumulatedTime [get] |
| Remaining accumulated time after all frames forward (both verified and predicted) have been simulated. Usually less than a full delta-time (defined by update rate), and used to compute the interpolation alpha. Can be above delta-time if the current session is temporarily lagging behind and can not simulate forward the full prediction (depending on settings). More...
|
|
DeterministicCommandSerializer | CommandSerializer [get] |
| Local instance of specialized serializer that can pack/unpack DeterministicCommands to/from byte[]s. More...
|
|
FP | DeltaTime [get] |
| Fixed-point delta-time as defined by DeterministicConfig's UpdateFPS (1/UpdateFPS). More...
|
|
Double | DeltaTimeDouble [get] |
| Double version of delta-time as defined by DeterministicConfig's UpdateFPS (1/UpdateFPS). More...
|
|
DeterministicFrame? | FramePredicted [get] |
| Quick accessor to the latest locally predicted copy of the game state. More...
|
|
DeterministicFrame? | FramePredictedPrevious [get] |
| Quick accessor to the second latest locally predicted copy of the game state. Used for accurate visual interpolation of transforms (or any other data) between this and the Predicted frame. More...
|
|
DeterministicFrame? | FrameVerified [get] |
| Quick accessor to the forward-only verified data (simulated with confirmed inputs from server in online games). Can be used as source of truth, as this does not include predicted data. More...
|
|
IDeterministicGame | Game [get] |
| The matching game instance, which holds the Frames (game state) and other accessory logic entry points for a predict/rollback match. More...
|
|
DeterministicGameMode | GameMode [get] |
| Possible modes are online/multiplayer, local or replay. More...
|
|
Int32 | InitialTick [get] |
| Normally zero (0) for most game clients. Can be set to a specific value if a local copy for initial frame snapshot data is provided (normally used occasionally in case of quick rejoinining a room). More...
|
|
DeterministicTickInput.Pool | InputPool [get] |
| Accessor to the pool of input objects. More...
|
|
byte[] | IntitialFrameData [get] |
| Serialized local copy for initial frame snapshot data, if provided when starting a new session (normally used occasionally in case of quick rejoinining a room). More...
|
|
Boolean | IsInterpolatable [get] |
| If the session provides previous states for interpolation. More...
|
|
Boolean | IsLocal [get] |
| true for replays and local games (single player or split screen/couch-local). false for online games. More...
|
|
Boolean | IsLockstep [get] |
| Legacy mode in which frames are only simulated forward with input delay, and no prediction is ever performed. In the past this was the default approach for classic RTS games. More...
|
|
Boolean | IsOnline [get] |
| true for online games. false for replays and local games (single player or split screen/couch-local). More...
|
|
Boolean | IsPaused [get] |
| Temporarily true only for a session that has just been started (Start message arrived from server) while waiting for a snapshot to arrive. More...
|
|
Boolean | IsPredicted [get] |
| true when not using legacy lockstep mode. Means frames will be predicted and rolled back. More...
|
|
Boolean | IsReplay [get] |
| true when GameMode is Replay (input comes from replay provider). More...
|
|
Boolean | IsReplayFinished [get] |
| true when the final input in the replay stream has been consumed to simulate forward a verified frame. More...
|
|
Boolean | IsSpectating [get] |
| Always true once session is started. false if at least one player is controlled by the local session. More...
|
|
Boolean | IsStalling [get] |
| true if simulation is being clamped at max prediction (rollback window). Happens normally when input confirmations from server are disrupted (network loss or very high ping times). More...
|
|
Int32 | LocalInputOffset [get] |
| Current value for the dynamically-adjusted input delay (independent for each client). Starts at the initial offset on DeterministicConfig (defaults to 0), and grows with RTT. More...
|
|
Int32 | MaxVerifiedTicksPerUpdate [get, set] |
| Limit the maximum number of verified ticks computed per update. Default is int.MaxValue. More...
|
|
DeterministicPlatformInfo | PlatformInfo [get] |
| Cached info about the local device platform (some OS and hardware available specs). More...
|
|
Int32 | PlayerCount [get] |
| Total/max number of PlayerRefs this particular session instance comprises of. This is not the number of connected players, but rather the total number. More...
|
|
Int32 | PredictedFrames [get] |
| Stats: Number of predicted frames simulated during the last call to Update(). More...
|
|
DeterministicFrame? | PreviousUpdateFramePredicted [get] |
| Quick accessor to the latest simulated copy of the Frame that was last-Predicted during the previous main session update. Used to calculate transform view error for smoothed correction. More...
|
|
IDeterministicReplayProvider | ReplayProvider [get] |
| When running replays, input comes from the provider/container. Replay input streams can com from file, memory, or a network stream (custom). More...
|
|
Int32 | RollbackWindow [get] |
| Max number of frames/ticks the session is allowed to predict. Can be set at DeterministicConfig. More...
|
|
IDisposable | Runner [get, set] |
| Runner is the wrapper for session/game that can be attached to Unity, a .Net console app, or a Quantum Custom Server Plugin. More...
|
|
Byte[] | RuntimeConfig [get] |
| Serialized local copy of the game/session custom RuntimeConfig instance (received from the photon server). Since this has been received from server, it's the same in all instances. More...
|
|
DeterministicSessionConfig | SessionConfig [get] |
| Local copy of the server-provided main set of settings, controlling update rate, input adjustment and other important control values. Since this has been received from server, it's the same set of values in all instances. More...
|
|
Int32 | SimulationRate [get] |
| Fixed rate at which the game is simulated (verified frames). Can be set at DeterministicConfig. More...
|
|
Double | SimulationTimeElasped [get] |
| Stats: Precise time in seconds used by the last call to Update(). Includes all session internal input handling, rollbacks, verified and predicted frames simulation. More...
|
|
double | SpectatingOffsetSec [get, set] |
| Specify the offset in sec that the simulation will run behind in Spectator mode. Value must be negative or 0. Default is -1 sec. More...
|
|
DeterministicStats | Stats [get] |
| Copy of local runtime stats (stores the last Update values for simulation time, number of frames simulated, etc). Used by the QuantumStatsUI to show these in runtime on Unity. More...
|
|
Double | TimeScale [get] |
| Current time-dilation delta-time scale. Tf time-dilation settings allow it, server will reduce this to slow down games when some clients have very high ping (reducing the number of predictions). More...
|
|
Represents a Quantum runtime match, holding the references to Game, its Frames (game state) and Simulator, and implements (together with Simulator) the predict/rollback logic, time control and input management. Single use, so whenever a Session is shutdown (or disconnected), it can't be reused anymore and a new one must be instantiated.