> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksbaseroom.md).

# Class ksBaseRoom

Namespace: [KS.Reactor.Client](/reactor/api-reference/ks.reactor.client.md)\
Assembly: KSUnity.dll

Base class for rooms. Rooms are used to connect to server rooms. The room maintains simulation state that is regularly synced with the server.

```csharp
public abstract class ksBaseRoom
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† [ksBaseRoom](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksbaseroom.md)

#### Derived

[ksBaseRoom\<Player, Entity>](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksbaseroom-2.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Fields

### MAX\_SEND\_RATE <a href="#ks_reactor_client_ksbaseroom_max_send_rate" id="ks_reactor_client_ksbaseroom_max_send_rate"></a>

Maximum [SendRate](/reactor/api-reference/ks.reactor.client.md#KS_Reactor_Client_ksBaseRoom_602_SendRate) value.

```csharp
public const int MAX_SEND_RATE = 120
```

#### Field Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

### MIN\_SEND\_RATE <a href="#ks_reactor_client_ksbaseroom_min_send_rate" id="ks_reactor_client_ksbaseroom_min_send_rate"></a>

Minimum [SendRate](/reactor/api-reference/ks.reactor.client.md#KS_Reactor_Client_ksBaseRoom_602_SendRate) value.

```csharp
public const int MIN_SEND_RATE = 1
```

#### Field Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

### m\_connectionState <a href="#ks_reactor_client_ksbaseroom_m_connectionstate" id="ks_reactor_client_ksbaseroom_m_connectionstate"></a>

```csharp
protected ksConnectionStates m_connectionState
```

#### Field Value

[ksConnectionStates](/reactor/api-reference/ks.reactor/ks.reactor.ksconnectionstates.md)

## Properties

### Address <a href="#ks_reactor_client_ksbaseroom_address" id="ks_reactor_client_ksbaseroom_address"></a>

The host and port for the room. May change depending on the protocol selected.

```csharp
public ksAddress Address { get; }
```

#### Property Value

[ksAddress](/reactor/api-reference/ks.reactor/ks.reactor.ksaddress.md)

### ConnectionState <a href="#ks_reactor_client_ksbaseroom_connectionstate" id="ks_reactor_client_ksbaseroom_connectionstate"></a>

Get the connection state of the room.

```csharp
public ksConnectionStates ConnectionState { get; set; }
```

#### Property Value

[ksConnectionStates](/reactor/api-reference/ks.reactor/ks.reactor.ksconnectionstates.md)

### EnableUDPClientFrames <a href="#ks_reactor_client_ksbaseroom_enableudpclientframes" id="ks_reactor_client_ksbaseroom_enableudpclientframes"></a>

Send client frame data for entity state and timing data using UDP.

```csharp
public abstract bool EnableUDPClientFrames { get; set; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### Gravity <a href="#ks_reactor_client_ksbaseroom_gravity" id="ks_reactor_client_ksbaseroom_gravity"></a>

Gravity

```csharp
protected abstract ksVector3 Gravity { get; set; }
```

#### Property Value

[ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

### Id <a href="#ks_reactor_client_ksbaseroom_id" id="ks_reactor_client_ksbaseroom_id"></a>

Room id

```csharp
public uint Id { get; }
```

#### Property Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### IdleTime <a href="#ks_reactor_client_ksbaseroom_idletime" id="ks_reactor_client_ksbaseroom_idletime"></a>

Amount of time the player has been idle. Negative if the player is not idle.

```csharp
public abstract double IdleTime { get; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

### Info <a href="#ks_reactor_client_ksbaseroom_info" id="ks_reactor_client_ksbaseroom_info"></a>

Room info

```csharp
public abstract ksRoomInfo Info { get; }
```

#### Property Value

[ksRoomInfo](/reactor/api-reference/ks.reactor/ks.reactor.ksroominfo.md)

### InputAcknowledged <a href="#ks_reactor_client_ksbaseroom_inputacknowledged" id="ks_reactor_client_ksbaseroom_inputacknowledged"></a>

Has the server acknowledged receiving our first input?

```csharp
public abstract bool InputAcknowledged { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### IsConnected <a href="#ks_reactor_client_ksbaseroom_isconnected" id="ks_reactor_client_ksbaseroom_isconnected"></a>

Are we connected to the server?

```csharp
public abstract bool IsConnected { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### IsConnecting <a href="#ks_reactor_client_ksbaseroom_isconnecting" id="ks_reactor_client_ksbaseroom_isconnecting"></a>

Are we in the process of establishing a connection with the server?

```csharp
public abstract bool IsConnecting { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### IsDisconnecting <a href="#ks_reactor_client_ksbaseroom_isdisconnecting" id="ks_reactor_client_ksbaseroom_isdisconnecting"></a>

Are we disconnecting from the server?

```csharp
public abstract bool IsDisconnecting { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### IsIdle <a href="#ks_reactor_client_ksbaseroom_isidle" id="ks_reactor_client_ksbaseroom_isidle"></a>

Is the connection idle?

```csharp
public abstract bool IsIdle { get; set; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### Latency <a href="#ks_reactor_client_ksbaseroom_latency" id="ks_reactor_client_ksbaseroom_latency"></a>

Latency in milliseconds

```csharp
public abstract int Latency { get; }
```

#### Property Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

### LocalPlayerId <a href="#ks_reactor_client_ksbaseroom_localplayerid" id="ks_reactor_client_ksbaseroom_localplayerid"></a>

The local player id.

```csharp
public abstract uint LocalPlayerId { get; set; }
```

#### Property Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### Physics <a href="#ks_reactor_client_ksbaseroom_physics" id="ks_reactor_client_ksbaseroom_physics"></a>

Physics API

```csharp
public abstract ksBasePhysics Physics { get; }
```

#### Property Value

[ksBasePhysics](/reactor/api-reference/ks.reactor/ks.reactor.ksbasephysics.md)

### Protocol <a href="#ks_reactor_client_ksbaseroom_protocol" id="ks_reactor_client_ksbaseroom_protocol"></a>

Get / Set the connection protocol used for new connections.

```csharp
public abstract ksConnectionProtocols Protocol { get; set; }
```

#### Property Value

[ksConnectionProtocols](/reactor/api-reference/ks.reactor/ks.reactor.ksconnectionprotocols.md)

### RPCLatency <a href="#ks_reactor_client_ksbaseroom_rpclatency" id="ks_reactor_client_ksbaseroom_rpclatency"></a>

RPC Latency in milliseconds

```csharp
public abstract int RPCLatency { get; }
```

#### Property Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

### SuppressCannotCallRPCWarning <a href="#ks_reactor_client_ksbaseroom_suppresscannotcallrpcwarning" id="ks_reactor_client_ksbaseroom_suppresscannotcallrpcwarning"></a>

Should we suppress "Cannot call RPC" warnings when disconnected or disconnecting?

```csharp
public abstract bool SuppressCannotCallRPCWarning { get; set; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### Time <a href="#ks_reactor_client_ksbaseroom_time" id="ks_reactor_client_ksbaseroom_time"></a>

Server time and local frame delta.

```csharp
public abstract ksClientTime Time { get; }
```

#### Property Value

[ksClientTime](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksclienttime.md)

## Methods

### ApplyServerTimeScale(float) <a href="#ks_reactor_client_ksbaseroom_applyservertimescale_system_single" id="ks_reactor_client_ksbaseroom_applyservertimescale_system_single"></a>

Apply server time scale to the client.

```csharp
protected virtual void ApplyServerTimeScale(float timeScale)
```

#### Parameters

`timeScale` [float](https://learn.microsoft.com/dotnet/api/system.single)

### CallEntityRPC(ksBaseEntity, uint, params ksMultiType\[]) <a href="#ks_reactor_client_ksbaseroom_callentityrpc_ks_reactor_client_ksbaseentity_system_uint32_ks_reactor_k" id="ks_reactor_client_ksbaseroom_callentityrpc_ks_reactor_client_ksbaseentity_system_uint32_ks_reactor_k"></a>

Calls an entity function on the server. Does nothing if not connected to the server.

```csharp
public abstract void CallEntityRPC(ksBaseEntity entity, uint rpcId, params ksMultiType[] arguments)
```

#### Parameters

`entity` [ksBaseEntity](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksbaseentity.md)

Entity to call rpc on.

`rpcId` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Id of function to call on server.

`arguments` [ksMultiType](/reactor/api-reference/ks.reactor/ks.reactor.ksmultitype.md)\[]

arguments to send to server.

### DiagnoseConnectionFailure() <a href="#ks_reactor_client_ksbaseroom_diagnoseconnectionfailure" id="ks_reactor_client_ksbaseroom_diagnoseconnectionfailure"></a>

Diagnose Connection Failure to the server.

```csharp
public abstract string DiagnoseConnectionFailure()
```

#### Returns

[string](https://learn.microsoft.com/dotnet/api/system.string)

error message

### GetTime(uint) <a href="#ks_reactor_client_ksbaseroom_gettime_system_uint32" id="ks_reactor_client_ksbaseroom_gettime_system_uint32"></a>

Gets a player's time object. Each player who owns entities with the transform permission has time a time object that tracks their timing data which can be used to smooth motion for the entities they control.

```csharp
public abstract ksClientTime GetTime(uint playerId)
```

#### Parameters

`playerId` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Id of player to get the time object for. If zero, gets [Time](#KS_Reactor_Client_ksBaseRoom_Time).

#### Returns

[ksClientTime](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksclienttime.md)

The time object for the player, or [Time](#KS_Reactor_Client_ksBaseRoom_Time) if `playerId` was zero, or null if the player has no owned entities with the transform permission.

### GetTimeAdjuster\<T>() <a href="#ks_reactor_client_ksbaseroom_gettimeadjuster__1" id="ks_reactor_client_ksbaseroom_gettimeadjuster__1"></a>

```csharp
[Obsolete("Use casting with Time.Adjuster instead.")]
public abstract T GetTimeAdjuster<T>() where T : class, ksITimeAdjuster
```

#### Returns

T

#### Type Parameters

`T`

### InvokeRPC(uint, ksMultiType\[]) <a href="#ks_reactor_client_ksbaseroom_invokerpc_system_uint32_ks_reactor_ksmultitype" id="ks_reactor_client_ksbaseroom_invokerpc_system_uint32_ks_reactor_ksmultitype"></a>

Invoke managed RPCs on all room scripts.

```csharp
protected abstract bool InvokeRPC(uint rpcId, ksMultiType[] rpcArgs)
```

#### Parameters

`rpcId` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

RPC ID

`rpcArgs` [ksMultiType](/reactor/api-reference/ks.reactor/ks.reactor.ksmultitype.md)\[]

RPC arguments

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the method invoked any RPC handler

### RegisterConnectionFactory(ksConnectionProtocols, Factory) <a href="#ks_reactor_client_ksbaseroom_registerconnectionfactory_ks_reactor_ksconnectionprotocols_ks_reactor_c" id="ks_reactor_client_ksbaseroom_registerconnectionfactory_ks_reactor_ksconnectionprotocols_ks_reactor_c"></a>

Add a connection factory for a protocol. If a null factory is provided, then any existing factory with that protocol is removed.

```csharp
public static void RegisterConnectionFactory(ksConnectionProtocols protocol, ksConnection.Factory connectionFactory)
```

#### Parameters

`protocol` [ksConnectionProtocols](/reactor/api-reference/ks.reactor/ks.reactor.ksconnectionprotocols.md)

connection protocol

`connectionFactory` [ksConnection](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksconnection.md).[Factory](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksconnection/ks.reactor.client.ksconnection.factory.md)

connection factory

### OnStateChange <a href="#ks_reactor_client_ksbaseroom_onstatechange" id="ks_reactor_client_ksbaseroom_onstatechange"></a>

Events called when the connection state changes.

```csharp
public event ksBaseRoom.StateChangeHandler OnStateChange
```

#### Event Type

[ksBaseRoom](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksbaseroom.md).[StateChangeHandler](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksbaseroom/ks.reactor.client.ksbaseroom.statechangehandler.md)
