Class EntitySyncServer
The sync server creates the threads, the client repository and entity repositories.
It transmits the streamer callbacks to the network layer.
It will also transfer callbacks from network layer to streamer, for e.g. updating entity position when net owner is implemented.
Inheritance
System.Object
EntitySyncServer
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: AltV.Net.EntitySync.dll
Syntax
public class EntitySyncServer
Constructors
|
Improve this Doc
View Source
EntitySyncServer(UInt64, Func<UInt64, Int32>, Func<UInt64, Boolean>, Func<UInt64, IClientRepository, NetworkLayer>, Func<IEntity, UInt64, UInt64>, Func<UInt64, UInt64, UInt64, UInt64>, Func<UInt64, SpatialPartition>, IIdProvider<UInt64>)
Declaration
public EntitySyncServer(ulong threadCount, Func<ulong, int> syncRate, Func<ulong, bool> netOwnerEvents, Func<ulong, IClientRepository, NetworkLayer> createNetworkLayer, Func<IEntity, ulong, ulong> entityThreadId, Func<ulong, ulong, ulong, ulong> entityIdAndTypeThreadId, Func<ulong, SpatialPartition> createSpatialPartition, IIdProvider<ulong> idProvider)
Parameters
Type |
Name |
Description |
System.UInt64 |
threadCount |
|
System.Func<System.UInt64, System.Int32> |
syncRate |
|
System.Func<System.UInt64, System.Boolean> |
netOwnerEvents |
|
System.Func<System.UInt64, IClientRepository, NetworkLayer> |
createNetworkLayer |
|
System.Func<IEntity, System.UInt64, System.UInt64> |
entityThreadId |
|
System.Func<System.UInt64, System.UInt64, System.UInt64, System.UInt64> |
entityIdAndTypeThreadId |
|
System.Func<System.UInt64, SpatialPartition> |
createSpatialPartition |
|
IIdProvider<System.UInt64> |
idProvider |
|
Methods
|
Improve this Doc
View Source
AddEntity(IEntity)
Declaration
public void AddEntity(IEntity entity)
Parameters
Type |
Name |
Description |
IEntity |
entity |
|
|
Improve this Doc
View Source
CreateEntity(UInt64, Vector3, Int32, UInt32, IDictionary<String, Object>)
Declaration
public IEntity CreateEntity(ulong type, Vector3 position, int dimension, uint range, IDictionary<string, object> data)
Parameters
Type |
Name |
Description |
System.UInt64 |
type |
|
System.Numerics.Vector3 |
position |
|
System.Int32 |
dimension |
|
System.UInt32 |
range |
|
System.Collections.Generic.IDictionary<System.String, System.Object> |
data |
|
Returns
|
Improve this Doc
View Source
CreateEntity(UInt64, UInt64, Vector3, Int32, UInt32, IDictionary<String, Object>)
Declaration
public IEntity CreateEntity(ulong id, ulong type, Vector3 position, int dimension, uint range, IDictionary<string, object> data)
Parameters
Type |
Name |
Description |
System.UInt64 |
id |
|
System.UInt64 |
type |
|
System.Numerics.Vector3 |
position |
|
System.Int32 |
dimension |
|
System.UInt32 |
range |
|
System.Collections.Generic.IDictionary<System.String, System.Object> |
data |
|
Returns
|
Improve this Doc
View Source
FindEntities(Vector3, Int32)
Declaration
public List<IEntity> FindEntities(Vector3 position, int dimension)
Parameters
Type |
Name |
Description |
System.Numerics.Vector3 |
position |
|
System.Int32 |
dimension |
|
Returns
Type |
Description |
System.Collections.Generic.List<IEntity> |
|
|
Improve this Doc
View Source
GetAllEntities()
Declaration
public IEnumerable<IEntity> GetAllEntities()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IEntity> |
|
|
Improve this Doc
View Source
RemoveEntity(IEntity)
Declaration
public void RemoveEntity(IEntity entity)
Parameters
Type |
Name |
Description |
IEntity |
entity |
|
|
Improve this Doc
View Source
RemoveEntity(UInt64, UInt64)
Declaration
public void RemoveEntity(ulong id, ulong type)
Parameters
Type |
Name |
Description |
System.UInt64 |
id |
|
System.UInt64 |
type |
|
|
Improve this Doc
View Source
ResetEntityData(IEntity, String)
Declaration
public void ResetEntityData(IEntity entity, string key)
Parameters
Type |
Name |
Description |
IEntity |
entity |
|
System.String |
key |
|
|
Improve this Doc
View Source
Stop()
Declaration
|
Improve this Doc
View Source
TryGetEntity(UInt64, UInt64, out IEntity)
Declaration
public bool TryGetEntity(ulong id, ulong type, out IEntity entity)
Parameters
Type |
Name |
Description |
System.UInt64 |
id |
|
System.UInt64 |
type |
|
IEntity |
entity |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
UpdateEntity(IEntity)
Declaration
public void UpdateEntity(IEntity entity)
Parameters
Type |
Name |
Description |
IEntity |
entity |
|
|
Improve this Doc
View Source
UpdateEntityData(IEntity, String, Object)
Declaration
public void UpdateEntityData(IEntity entity, string key, object value)
Parameters
Type |
Name |
Description |
IEntity |
entity |
|
System.String |
key |
|
System.Object |
value |
|