Main simulation class
More...
Inherits ILogBuilder, and INetPeerGroupCallbacks.
|
SimulationInput | GetInputForPlayer (int player) |
|
SimulationInput | GetInputByIndex (int index) |
|
bool | HasAnyActiveConnections () |
|
int | Update (double dt) |
| Forwards the Simulation based on the Delta Time More...
|
|
void | SetActiveScene (SceneRef scene) |
|
void | SendReliableData (int connection, int key, byte[] data) |
|
|
static IDeltaCompressor | GetDefaultDeltaCompressor () |
|
static IDeltaCompressor | GetDebugDeltaCompressor () |
|
|
Statistics | Stats = new Statistics() |
|
|
const int | DEFAULT_COMPRESSOR_OFFSET_BLOCK_SIZE = 3 |
|
const int | DEFAULT_COMPRESSOR_VALUE_BLOCK_SIZE = 6 |
|
|
virtual void | OnPlayerJoinedLeftInternalMessage (PlayerRef player, bool joined) |
|
virtual void | AfterUpdate () |
|
virtual void | NetworkConnected (NetConnection *connection) |
|
virtual void | NetworkDisconnected (NetConnection *connection) |
|
virtual void | NetworkReceiveDone () |
|
virtual void | NoSimulation () |
|
virtual int | BeforeSimulation () |
|
virtual void | BeforeTick () |
|
virtual void | AfterTick () |
|
virtual void | AfterSimulation () |
|
◆ Update()
Forwards the Simulation based on the Delta Time
- Parameters
-
dt | Delta Time used to forward the simulation |
- Returns
- How many Ticks executed on this Update
◆ Config
◆ DeltaTime
◆ IsClient
If this peer is a client. True for client peers in Server/Client topologies, and true for all peers in Shared Mode.
◆ IsFirstTick
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.
◆ IsForward
Use inside of FixedUpdateNetwork to determine if the tick currently being simulated has NOT previously been simulated locally.
◆ IsLastTick
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.
◆ IsLocalPlayerFirstExecution
bool IsLocalPlayerFirstExecution |
|
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.
◆ IsMasterClient
Only valid in Shared Mode. Indicates if this peer is flagged as the MasterClient, which means it is default StateAuthority
◆ IsPlayer
True for any peer that represents a human player. This is true for all peers except a dedicated server.
◆ IsResimulation
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.
◆ IsRunning
◆ IsServer
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).
◆ IsSinglePlayer
Indicates that this simulation is operating in Single Player mode, which is a Host that accepts no connections.
◆ LocalAddress
Bound Address of the internal socket
◆ Mode
Gets the SimulationModes flags for The type of network peer this simulation represents.
◆ ProjectConfig
◆ Stage
◆ Tick
The tick associated with the current state of networked objects, or the current simulation tick being processed (when evaluated during FixedUpdateNetwork).
◆ Topology
Indicates if a Server/Client or Shared Mode (relay server) topology is being used.