For the complete documentation index, see llms.txt. This page is also available as Markdown.

Interface ksIServerEntity

Namespace: KS.Reactor.Server Assembly: KSReactor.dll

Public interface for server entities. An entity is an object in the scene.

public interface ksIServerEntity : ksIEntity

Implements

ksIEntity

Properties

CollisionFilter

Determines which entities to collide with and notify of collision/overlap events. Setting this will set the collision filter on all colliders with UseEntityCollisionFilter set to true. Setting to null will throw ArgumentNullException.

ksCollisionFilter CollisionFilter { get; set; }

Property Value

ksCollisionFilter

DestroyOnOwnerDisconnect

Should the entity be destroyed when its owner disconnects?

bool DestroyOnOwnerDisconnect { get; set; }

Property Value

bool

OnRPC

Invoked when a player calls an RPC on the entity. Indexed by RPC id.

Property Value

ksEventMap<ksServerEvents.RPCHandler>

OnValidateOwnerProperty

Invoked to validate a property update from the entity's owner. If any of the handlers return FAIL or ABORT the property update will not be applied.

Property Value

ksEvent<ksServerEvents.PropertyValidator>

OnValidateOwnerTransform

Invoked to validate a transform update from the entity's owner. If any of the handlers return FAIL or ABORT the transform update will not be applied.

Property Value

ksEvent<ksServerEvents.TransformValidator>

Owner

Owner of PlayerController

Property Value

ksIServerPlayer

OwnerPermissions

Owner permission flags.

Property Value

ksOwnerPermissions

PhysXActor

Get/Set the PhysX actor

Property Value

pxActor

PhysicsMaterial

Determines the friction and resitution of attached colliders. Setting this will set the material on all colliders with UseEntityPhysicsMaterial set to true.

Property Value

ksPhysicsMaterial

PlayerController

Player controller

Property Value

ksPlayerController

Room

Room the entity is in.

Property Value

ksIServerRoom

Scripts

List of scripts attached to the entity.

Property Value

ksScriptList<ksIServerEntity, ksServerEntityScript>

SyncGroup

Get/Set the sync group for this entity

Property Value

uint

Transform

Transform

Property Value

ksTransform

Transform2D

2D Transform

Property Value

ksTransform2D

Methods

CallRPC(uint, params ksMultiType[])

Calls an RPC on this entity. All players who can see this entity will receive the RPC.

Parameters

rpcId uint

arguments ksMultiType[]

arguments

CallRPC(ksIServerPlayer, uint, params ksMultiType[])

Calls a function on this entity for a player.

Parameters

player ksIServerPlayer

player to call the RPC on.

rpcId uint

rpcId of function to call on client.

arguments ksMultiType[]

arguments to send to the client.

CallRPC(IList<ksIServerPlayer>, uint, params ksMultiType[])

Calls a function on this entity for a group of players.

Parameters

players IList<ksIServerPlayer>

players to call the RPC on.

rpcId uint

rpcId of function to call on client.

arguments ksMultiType[]

arguments to send to the client.

Destroy()

Destroys this entity.

RegisterRPC(uint, RPCHandler)

Register an RPC

Parameters

rpcId uint

RPC Id

rpcHandler ksServerEvents.RPCHandler

RPC handler delegate

RemoveController(bool)

Removes the player controller from this entity. If the owner has no permissions and

If false and the owner has no permission, removes their ownership.

Parameters

keepOwnership bool

SetController(ksPlayerController, ksIServerPlayer)

Sets the player controller on this entity and informs the owner of the controller.

Parameters

controller ksPlayerController

controller to control this entity.

owner ksIServerPlayer

owner who will control this entity.

SetOwner(ksIServerPlayer, ksOwnerPermissions)

Sets an entity's owner and the owner permissions. If the entity has a player controller, removes it.

Parameters

owner ksIServerPlayer

The player who owns the entity.

permissions ksOwnerPermissions

Flags that determine what the owner can do with the entity. If owner is null, this value is ignored and OwnerPermissions will be set to NONE.

SetOwner(ksIServerPlayer, ksPlayerController, ksOwnerPermissions)

Sets an entity's owner, player controller, and the owner permissions.

Parameters

owner ksIServerPlayer

The player who owns the entity.

controller ksPlayerController

The player controller to set. If owner is null, this must also be null.

permissions ksOwnerPermissions

Flags that determine what the owner can do with the entity. If owner is null, this value is ignored and OwnerPermissions will be set to NONE.

UnregisterRPC(uint, RPCHandler)

Unregister an RPC

Parameters

rpcId uint

RPC Id

rpcHandler ksServerEvents.RPCHandler

RPC handler delegate

UpdateScale()

If the transform's scale is dirty, finds and updates the scale on all colliders attached to the entity.

OnCollision

Invoked when this entity collides with another.

Event Type

ksServerEvents.CollisionHandler

OnContactLost

Invoked when this entity loses contact with another.

Event Type

ksServerEvents.OverlapHandler

OnContactUpdate

Invoked every frame this entity remains in contact with another. Not invoked if both entities are asleep.

Event Type

ksServerEvents.CollisionHandler

OnDestroy

Invoked when the entity is destroyed.

Event Type

ksServerEvents.DestroyHandler

OnOverlapEnd

Invoked when the entity stops overlapping another.

Event Type

ksServerEvents.OverlapHandler

OnOverlapStart

Invoked when the entity starts overlapping another.

Event Type

ksServerEvents.OverlapHandler

OnSleep

Invoked when the entity falls asleep in the physics system.

Event Type

ksServerEvents.SleepStateChangeHandler

OnWake

Invoked when the entity awakens in the physics system.

Event Type

ksServerEvents.SleepStateChangeHandler

Last updated