Main simulation class More...
Inherits ILogBuilder, and INetPeerGroupCallbacks.
Public Member Functions | |
SimulationInput | GetInputByIndex (int index) |
SimulationInput | GetInputForPlayer (int player) |
bool | HasAnyActiveConnections () |
void | SendReliableData (int connection, int key, byte[] data) |
void | SetActiveScene (SceneRef scene) |
int | Update (double dt) |
Forwards the Simulation based on the Delta Time More... | |
Static Public Member Functions | |
static IDeltaCompressor | GetDebugDeltaCompressor () |
static IDeltaCompressor | GetDefaultDeltaCompressor () |
Public Attributes | |
Statistics | Stats = new Statistics() |
Static Public Attributes | |
const int | DEFAULT_COMPRESSOR_OFFSET_BLOCK_SIZE = 3 |
const int | DEFAULT_COMPRESSOR_VALUE_BLOCK_SIZE = 6 |
static float | RELAY_SLACK = 2f |
1.0 = no slack, don't set under 1.0 2.0 = 100% extra slack 3.0 = 200% extra slack ... etc More... | |
Protected Member Functions | |
virtual void | AfterSimulation () |
virtual void | AfterTick () |
virtual void | AfterUpdate () |
virtual void | BeforeNetworkRecv () |
Called before NetworkRecv. More... | |
virtual int | BeforeSimulation () |
virtual void | BeforeTick () |
virtual void | NetworkConnected (NetConnection *connection) |
virtual void | NetworkDisconnected (NetConnection *connection) |
virtual void | NetworkReceiveDone () |
virtual void | NoSimulation () |
virtual void | OnPlayerJoinedLeftInternalMessage (PlayerRef player, bool joined) |
Properties | |
virtual IEnumerable< PlayerRef > | ActivePlayers [get] |
List of Active players in the Simulation More... | |
SimulationConfig | Config [get] |
The SimulationConfig file used by this Simulation. More... | |
float | DeltaTime [get] |
Gets the fixed tick time interval. Derived from the SimulationConfig.TickRate. More... | |
int | InputCount [get] |
float | InterpAlpha [get] |
SimulationSnapshot | InterpFrom [get] |
SimulationSnapshot | InterpTo [get] |
bool | IsClient [get] |
If this peer is a client. True for client peers in Server/Client topologies, and true for all peers in Shared Mode. More... | |
bool | IsFirstTick [get] |
Use in conjunction with IsResimulation/IsForward inside of FixedUpdateNetwork to determine if the current tick being simulated is the first tick of the resimulation or forward phase of the simulation loop. More... | |
bool | IsForward [get] |
Use inside of FixedUpdateNetwork to determine if the tick currently being simulated has NOT previously been simulated locally. More... | |
bool | IsLastTick [get] |
Use in conjunction with IsResimulation/IsForward inside of FixedUpdateNetwork to determine if the current tick being simulated is the last tick of the resimulation or forward phase of the simulation loop. More... | |
bool | IsLocalPlayerFirstExecution [get] |
True if the current stage of the simulation loop is Forward. False during resimulations. More... | |
bool | IsMasterClient [get] |
Only valid in Shared Mode. Indicates if this peer is flagged as the MasterClient, which means it is default StateAuthority More... | |
bool | IsPlayer [get] |
True for any peer that represents a human player. This is true for all peers except a dedicated server. More... | |
bool | IsResimulation [get] |
Use inside of FixedUpdateNetwork to determine if the tick currently being simulated has previously been simulated locally. Resimulation occurs in client prediction when new states arrive from the StateAuthority. Networked objects are set to the most current authority state tick, and simulations are repeated from that tick to the local current tick. More... | |
bool | IsRunning [get] |
Signal if the Simulation is currently running More... | |
bool | IsServer [get] |
If this peer is the server. True for the Server or Host peer in Server/Client topologies, and always false for all peers in Shared Mode (the relay is the server). More... | |
bool | IsShutdown [get] |
bool | IsSinglePlayer [get] |
Indicates that this simulation is operating in Single Player mode, which is a Host that accepts no connections. More... | |
abstract SimulationSnapshot | LatestServerState [get] |
NetAddress | LocalAddress [get] |
Bound Address of the internal socket More... | |
abstract PlayerRef | LocalPlayer [get] |
int | MaxConnections [get] |
SimulationModes | Mode [get] |
Gets the SimulationModes flags for The type of network peer this simulation represents. More... | |
NetConfig * | NetConfigPointer [get] |
NetworkProjectConfig | ProjectConfig [get] |
The NetworkProjectConfig file used by this Simulation. More... | |
SimulationSnapshot.IHistory | SnapshotHistory [get] |
SimulationStages | Stage [get] |
Gets the current SimulationStages value. More... | |
SimulationSnapshot | State [get] |
float | StateAlpha [get] |
SimulationSnapshot | StatePrevious [get] |
SimulationSnapshot | StateResume [get] |
Tick | Tick [get] |
The tick associated with the current state of networked objects, or the current simulation tick being processed (when evaluated during FixedUpdateNetwork). More... | |
SimulationConfig.Topologies | Topology [get] |
Indicates if a Server/Client or Shared Mode (relay server) topology is being used. More... | |
Main simulation class
|
protectedvirtual |
Called before NetworkRecv.
int Update | ( | double | dt | ) |
Forwards the Simulation based on the Delta Time
dt | Delta Time used to forward the simulation |
|
static |
1.0 = no slack, don't set under 1.0 2.0 = 100% extra slack 3.0 = 200% extra slack ... etc
|
get |
List of Active players in the Simulation
|
get |
The SimulationConfig file used by this Simulation.
|
get |
Gets the fixed tick time interval. Derived from the SimulationConfig.TickRate.
|
get |
If this peer is a client. True for client peers in Server/Client topologies, and true for all peers in Shared Mode.
|
get |
Use in conjunction with IsResimulation/IsForward inside of FixedUpdateNetwork to determine if the current tick being simulated is the first tick of the resimulation or forward phase of the simulation loop.
'Resimulation' describes simulating a tick that has been previously been simulated.
'Forward' describes simulating a tick that is being simulated for the first time locally.
'Prediction' describes simulating ticks higher than the most current known StateAuthority snapshot tick.
|
get |
Use inside of FixedUpdateNetwork to determine if the tick currently being simulated has NOT previously been simulated locally.
|
get |
Use in conjunction with IsResimulation/IsForward inside of FixedUpdateNetwork to determine if the current tick being simulated is the last tick of the resimulation or forward phase of the simulation loop.
'Resimulation' describes simulating a tick that has been previously been simulated.
'Forward' describes simulating a tick that is being simulated for the first time locally.
'Prediction' describes simulating ticks higher than the most current known StateAuthority snapshot tick.
|
get |
True if the current stage of the simulation loop is Forward. False during resimulations.
'Resimulation' describes simulating a tick that has been previously been simulated.
'Forward' describes simulating a tick that is being simulated for the first time locally.
'Prediction' describes simulating ticks higher than the most current known StateAuthority snapshot tick.
|
get |
Only valid in Shared Mode. Indicates if this peer is flagged as the MasterClient, which means it is default StateAuthority
|
get |
True for any peer that represents a human player. This is true for all peers except a dedicated server.
|
get |
Use inside of FixedUpdateNetwork to determine if the tick currently being simulated has previously been simulated locally. Resimulation occurs in client prediction when new states arrive from the StateAuthority. Networked objects are set to the most current authority state tick, and simulations are repeated from that tick to the local current tick.
|
get |
Signal if the Simulation is currently running
|
get |
If this peer is the server. True for the Server or Host peer in Server/Client topologies, and always false for all peers in Shared Mode (the relay is the server).
|
get |
Indicates that this simulation is operating in Single Player mode, which is a Host that accepts no connections.
|
get |
Bound Address of the internal socket
|
get |
Gets the SimulationModes flags for The type of network peer this simulation represents.
|
get |
The NetworkProjectConfig file used by this Simulation.
|
get |
Gets the current SimulationStages value.
|
get |
The tick associated with the current state of networked objects, or the current simulation tick being processed (when evaluated during FixedUpdateNetwork).
|
get |
Indicates if a Server/Client or Shared Mode (relay server) topology is being used.