Class NetickEngine
- Namespace
- Netick
- Assembly
- Netick.dll
public sealed class NetickEngine
- Inheritance
-
NetickEngine
- Inherited Members
Constructors
NetickEngine()
public NetickEngine()
Fields
ClientSimulationCallbacks
public readonly List<IClientSimulationCallbacks> ClientSimulationCallbacks
Field Value
SimulatedLossIn
public float SimulatedLossIn
Field Value
SimulatedLossOut
public float SimulatedLossOut
Field Value
Properties
AuthoritativeTick
public Tick AuthoritativeTick { get; }
Property Value
Client
public Client Client { get; }
Property Value
ClientSimulation
public ClientSimulation ClientSimulation { get; }
Property Value
Config
public NetickConfigData Config { get; }
Property Value
ConnectedClients
A list containing all connected clients currently.
Note: if you want the clients + the server, use ConnectedPlayers.
public IReadOnlyList<ServerConnection> ConnectedClients { get; }
Property Value
ConnectedPlayers
A list containing all connected clients currently, in addition to the server.
Note: if you only want the clients, use ConnectedClients.
public IReadOnlyList<NetworkPlayer> ConnectedPlayers { get; }
Property Value
CurrentRpcCaller
public NetworkPlayer CurrentRpcCaller { get; }
Property Value
CurrentRpcSource
public NetworkConnection CurrentRpcSource { get; }
Property Value
Entities
public IReadOnlyDictionary<int, Entity> Entities { get; }
Property Value
FixedDeltaTime
Time period between simulation ticks.
public float FixedDeltaTime { get; }
Property Value
InKBps
Incoming data in kilobytes per second (KBps).
public float InKBps { get; }
Property Value
InPacketLoss
[Client Only] Estimation of incoming packets that are being lost. Value ranges between 0.0 and 1.0, with 1.0 meaning all packets are being lost.
public float InPacketLoss { get; }
Property Value
InputEnabled
public bool InputEnabled { get; set; }
Property Value
InterestManagement
public InterestManagement InterestManagement { get; }
Property Value
InterpolationDelay
[Client Only] Interpolation delay in seconds.
public float InterpolationDelay { get; }
Property Value
IsClient
public bool IsClient { get; }
Property Value
IsConnected
[Client Only] Returns true if this client is currently connected to a server.
public bool IsConnected { get; }
Property Value
IsIMEnabled
public bool IsIMEnabled { get; }
Property Value
IsInvokingNetworkRender
public bool IsInvokingNetworkRender { get; }
Property Value
IsResimulating
Returns true if we are currently resimulating a previous input/tick of the past. On the server, it always returns false since only the clients resimulate.
public bool IsResimulating { get; }
Property Value
IsRunning
public bool IsRunning { get; }
Property Value
IsServer
public bool IsServer { get; }
Property Value
LagCompensation
public INetickComponent LagCompensation { get; }
Property Value
LocalInterpolation
public LocalInterpolation LocalInterpolation { get; }
Property Value
LocalPeer
public NetworkPeer LocalPeer { get; }
Property Value
LocalPlayer
public NetworkPeer LocalPlayer { get; }
Property Value
MaxClients
public int MaxClients { get; }
Property Value
Monitor
public Monitor Monitor { get; }
Property Value
Name
public string Name { get; }
Property Value
OnPostNetworkStart
public Action OnPostNetworkStart { get; set; }
Property Value
OnTickEnd
public Action OnTickEnd { get; set; }
Property Value
OnTickStart
public Action OnTickStart { get; set; }
Property Value
OutKBps
Outgoing data in kilobytes per second (KBps).
public float OutKBps { get; }
Property Value
OutPacketLoss
[Client Only] Estimation of outgoing packets that are being lost. Value ranges between 0.0 and 1.0, with 1.0 meaning all packets are being lost.
public float OutPacketLoss { get; }
Property Value
Port
public int Port { get; }
Property Value
PostNetworkFixedUpdate
public Action PostNetworkFixedUpdate { get; set; }
Property Value
PostResimulation
public Action PostResimulation { get; set; }
Property Value
PostRollback
public Action PostRollback { get; set; }
Property Value
PreClientResimulation
public Action PreClientResimulation { get; set; }
Property Value
PreNetworkFixedUpdate
public Action PreNetworkFixedUpdate { get; set; }
Property Value
PreResimulation
public Action PreResimulation { get; set; }
Property Value
PreRollback
public Action PreRollback { get; set; }
Property Value
PredictedTick
public Tick PredictedTick { get; }
Property Value
RTT
[Client Only] The round-trip time (RTT) of the client in seconds.
public double RTT { get; }
Property Value
RemoteInterpolation
public RemoteInterpolation RemoteInterpolation { get; }
Property Value
Server
public Server Server { get; }
Property Value
ServerEndPoint
[Client Only] The IPEndPoint of the server you are connected to. Returns null if you are not connected to any server, or if you are the server.
public IEndPoint ServerEndPoint { get; }
Property Value
ServerSimulation
public ServerSimulation ServerSimulation { get; }
Property Value
Simulate
public bool Simulate { get; set; }
Property Value
Simulation
public Simulation Simulation { get; }
Property Value
SimulationTick
public Tick SimulationTick { get; }
Property Value
SnapshotTick
public Tick SnapshotTick { get; }
Property Value
StartMode
public NetickStartMode StartMode { get; }
Property Value
Tick
public Tick Tick { get; }
Property Value
Timer
public SimulationClock Timer { get; }
Property Value
Transport
public NetworkTransport Transport { get; }
Property Value
UserObject
public object UserObject { get; set; }
Property Value
Methods
AttachBehaviour(INetickScript)
Attachs a INetickScript to the simulation.
public void AttachBehaviour(INetickScript behaviour)
Parameters
behaviour
INetickScript
ClientAddEntity(INetickEntity, int, int, NetworkPlayer, bool, NetickEntityMeta)
public void ClientAddEntity(INetickEntity entity, int id, int worldIndex, NetworkPlayer player, bool wasUnliked, NetickEntityMeta meta)
Parameters
entity
INetickEntityid
intworldIndex
intplayer
NetworkPlayerwasUnliked
boolmeta
NetickEntityMeta
ClientAddUnlinkedEntity(Entity, int, int)
public void ClientAddUnlinkedEntity(Entity entity, int id, int worldIndex)
Parameters
Connect(int, string, byte[], int)
public void Connect(int port, string ip, byte[] connectionData = null, int connectionDataLength = 0)
Parameters
CreateAndLinkEntityLocal(INetickEntity)
public Entity CreateAndLinkEntityLocal(INetickEntity userEntity)
Parameters
userEntity
INetickEntity
Returns
CreateEntity(int)
public Entity CreateEntity(int stateSizeWords)
Parameters
stateSizeWords
int
Returns
DeattachBehaviour(INetickScript)
Deattachs a INetickScript from the simulation.
public void DeattachBehaviour(INetickScript behaviour)
Parameters
behaviour
INetickScript
DestroyEntity(Entity, bool, bool)
public void DestroyEntity(Entity entity, bool instant, bool freeMemory)
Parameters
DisconnectFromServer()
[Client Only] Disconnects this client from the server.
public void DisconnectFromServer()
DisconnectHost()
public void DisconnectHost()
FetchInput<T>(out T, ref bool, Entity, int)
public bool FetchInput<T>(out T input, ref bool isDuplicated, Entity entity, int localPlayerIndex) where T : unmanaged
Parameters
Returns
Type Parameters
T
~NetickEngine()
protected ~NetickEngine()
GetBehaviourOrder(Type)
public int GetBehaviourOrder(Type type)
Parameters
type
Type
Returns
GetEntityMeta(Entity)
public NetickEntityMeta* GetEntityMeta(Entity entity)
Parameters
entity
Entity
Returns
GetEntityUserMeta(Entity)
public byte* GetEntityUserMeta(Entity entity)
Parameters
entity
Entity
Returns
- byte*
GetInput<T>(int)
public T GetInput<T>(int index = 0) where T : unmanaged
Parameters
index
int
Returns
- T
Type Parameters
T
InvokeOnPlayerConnectedForHost()
public void InvokeOnPlayerConnectedForHost()
Kick(ServerConnection)
public void Kick(ServerConnection connection)
Parameters
connection
ServerConnection
LinkEntity(INetickEntity, Entity)
public Entity LinkEntity(INetickEntity userEntity, Entity entity)
Parameters
userEntity
INetickEntityentity
Entity
Returns
Render()
Call this to invoke NetworkRender on simulated entities. This might not be needed if you are running a headless build.
public void Render()
ResetForSceneSwitch()
public void ResetForSceneSwitch()
ServerAddEntity(NetworkPlayer, INetickEntity)
public void ServerAddEntity(NetworkPlayer inputSource, INetickEntity obj)
Parameters
inputSource
NetworkPlayerobj
INetickEntity
SetEntityMetaDirty(Entity)
public void SetEntityMetaDirty(Entity entity)
Parameters
entity
Entity
SetEntityUserMetaDirty(Entity, int*)
public void SetEntityUserMetaDirty(Entity entity, int* userData)
Parameters
SetInput<T>(T, int)
public void SetInput<T>(T input, int index = 0) where T : unmanaged
Parameters
input
Tindex
int
Type Parameters
T
Shutdown()
public void Shutdown()
Start(string, int, NetickStartMode, IGameEngine, NetickConfigData, NetworkTransport, ReflectionData, INetickLogger, IMemoryAllocator)
public void Start(string name, int serverPort, NetickStartMode startMode, IGameEngine gameEngine, NetickConfigData config, NetworkTransport transport, ReflectionData reflectionData, INetickLogger logger, IMemoryAllocator allocator)
Parameters
name
stringserverPort
intstartMode
NetickStartModegameEngine
IGameEngineconfig
NetickConfigDatatransport
NetworkTransportreflectionData
ReflectionDatalogger
INetickLoggerallocator
IMemoryAllocator
Update(float, float)
Update Netick's logic.
public void Update(float deltaTime, float timeScale)