> 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.server/ks.reactor.server.ksicluster.md).

# Interface ksICluster

Namespace: [KS.Reactor.Server](/reactor/api-reference/ks.reactor.server.md)\
Assembly: KSReactor.dll

Public interface for Room clusters.

```csharp
public interface ksICluster
```

## Properties

### Exists <a href="#ks_reactor_server_ksicluster_exists" id="ks_reactor_server_ksicluster_exists"></a>

True if the room was launched as part of a cluster. False if it was launched as a stand-alone room.

```csharp
bool Exists { get; }
```

#### Property Value

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

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

Cluster connection state

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

#### Property Value

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

### OnRPC <a href="#ks_reactor_server_ksicluster_onrpc" id="ks_reactor_server_ksicluster_onrpc"></a>

Register a cluster RPC handler;

```csharp
ksEventMap<ksClusterEvents.RPCHandler> OnRPC { get; }
```

#### Property Value

ksEventMap<[ksClusterEvents](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksclusterevents.md).[RPCHandler](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksclusterevents/ks.reactor.server.ksclusterevents.rpchandler.md)>

### PersistentPropertiesEnabled <a href="#ks_reactor_server_ksicluster_persistentpropertiesenabled" id="ks_reactor_server_ksicluster_persistentpropertiesenabled"></a>

True if persistent properties are enabled and the cluster is connected. If false, cluster properties will be cache-only and will not persist once the cluster is shutdown.

```csharp
bool PersistentPropertiesEnabled { get; }
```

#### Property Value

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

## Methods

### CallRoomRPC(uint, params ksMultiType\[]) <a href="#ks_reactor_server_ksicluster_callroomrpc_system_uint32_ks_reactor_ksmultitype" id="ks_reactor_server_ksicluster_callroomrpc_system_uint32_ks_reactor_ksmultitype"></a>

Send an RPC request to all cluster rooms The result is returned and completed immediately. Error is null if the request was not sent otherwise it contains a string explaining why the request was not sent.

```csharp
void CallRoomRPC(uint rpcId, params ksMultiType[] args)
```

#### Parameters

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

RPC ID

`args` ksMultiType\[]

RPC arguments

### CallRoomRPC(IEnumerable\<uint>, uint, params ksMultiType\[]) <a href="#ks_reactor_server_ksicluster_callroomrpc_system_collections_generic_ienumerable_system_uint32__syste" id="ks_reactor_server_ksicluster_callroomrpc_system_collections_generic_ienumerable_system_uint32__syste"></a>

Send an RPC request to a list of rooms. The result is returned and completed immediately. Error is null if the request was not sent otherwise it contains a string explaining why the request was not sent.

```csharp
void CallRoomRPC(IEnumerable<uint> roomIds, uint rpcId, params ksMultiType[] args)
```

#### Parameters

`roomIds` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)<[uint](https://learn.microsoft.com/dotnet/api/system.uint32)>

list of room IDs

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

RPC ID

`args` ksMultiType\[]

RPC arguments

### CallRoomRPC(string, uint, params ksMultiType\[]) <a href="#ks_reactor_server_ksicluster_callroomrpc_system_string_system_uint32_ks_reactor_ksmultitype" id="ks_reactor_server_ksicluster_callroomrpc_system_string_system_uint32_ks_reactor_ksmultitype"></a>

Send an RPC request to rooms that match a tag. The result is returned and completed immediately. Error is null if the request was not sent otherwise it contains a string explaining why the request was not sent.

```csharp
void CallRoomRPC(string tag, uint rpcId, params ksMultiType[] args)
```

#### Parameters

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

Tag

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

RPC ID

`args` ksMultiType\[]

RPC arguments

### CallRoomRPC(IEnumerable\<string>, uint, params ksMultiType\[]) <a href="#ks_reactor_server_ksicluster_callroomrpc_system_collections_generic_ienumerable_system_string__syste" id="ks_reactor_server_ksicluster_callroomrpc_system_collections_generic_ienumerable_system_string__syste"></a>

Send an RPC request to rooms that match at least one tag in a list of tags. The result is returned and completed immediately. Error is null if the request was not sent otherwise it contains a string explaining why the request was not sent.

```csharp
void CallRoomRPC(IEnumerable<string> tags, uint rpcId, params ksMultiType[] args)
```

#### Parameters

`tags` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)>

Tags

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

RPC ID

`args` ksMultiType\[]

RPC arguments

### DeleteProperty(string, DeleteCache) <a href="#ks_reactor_server_ksicluster_deleteproperty_system_string_ks_reactor_ksclusterproperty_deletecache" id="ks_reactor_server_ksicluster_deleteproperty_system_string_ks_reactor_ksclusterproperty_deletecache"></a>

Send a request to the cluster to delete a property.

```csharp
ksAsyncResult<Dictionary<string, ksMultiType>> DeleteProperty(string key, ksClusterProperty.DeleteCache caching = DeleteCache.STORE)
```

#### Parameters

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

property key

`caching` ksClusterProperty.DeleteCache

Cache delete rule (Default STORE)

#### Returns

ksAsyncResult<[Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), ksMultiType>>

aysnc result

### GetProperty(string, ReadCache) <a href="#ks_reactor_server_ksicluster_getproperty_system_string_ks_reactor_ksclusterproperty_readcache" id="ks_reactor_server_ksicluster_getproperty_system_string_ks_reactor_ksclusterproperty_readcache"></a>

Send a request to the cluster to get a property.

```csharp
ksAsyncResult<Dictionary<string, ksMultiType>> GetProperty(string key, ksClusterProperty.ReadCache caching = ReadCache.HIT)
```

#### Parameters

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

property key

`caching` ksClusterProperty.ReadCache

Cache read rule (Default HIT)

#### Returns

ksAsyncResult<[Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), ksMultiType>>

aysnc result

### GetRoomInfo(IEnumerable\<string>) <a href="#ks_reactor_server_ksicluster_getroominfo_system_collections_generic_ienumerable_system_string" id="ks_reactor_server_ksicluster_getroominfo_system_collections_generic_ienumerable_system_string"></a>

Request room information for rooms that match at least one tag in a list of tags.

```csharp
ksAsyncResult<List<ksRoomInfo>> GetRoomInfo(IEnumerable<string> tags)
```

#### Parameters

`tags` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)>

tag list

#### Returns

ksAsyncResult<[List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)\<ksRoomInfo>>

aysnc result

### GetRoomInfo(params string\[]) <a href="#ks_reactor_server_ksicluster_getroominfo_system_string" id="ks_reactor_server_ksicluster_getroominfo_system_string"></a>

Request room information for rooms that match at least one tag in a list of tags.

```csharp
ksAsyncResult<List<ksRoomInfo>> GetRoomInfo(params string[] tags)
```

#### Parameters

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

#### Returns

ksAsyncResult<[List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)\<ksRoomInfo>>

aysnc result

### SetProperty(string, ksMultiType, WriteCache) <a href="#ks_reactor_server_ksicluster_setproperty_system_string_ks_reactor_ksmultitype_ks_reactor_ksclusterpr" id="ks_reactor_server_ksicluster_setproperty_system_string_ks_reactor_ksmultitype_ks_reactor_ksclusterpr"></a>

Send a request to the cluster to set a property.

```csharp
ksAsyncResult<Dictionary<string, ksMultiType>> SetProperty(string key, ksMultiType value, ksClusterProperty.WriteCache caching = WriteCache.STORE)
```

#### Parameters

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

property key

`value` ksMultiType

property value

`caching` ksClusterProperty.WriteCache

Cache write rule (Default STORE)

#### Returns

ksAsyncResult<[Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), ksMultiType>>

aysnc result

### SetProperty(Dictionary\<string, ksMultiType>, WriteCache) <a href="#ks_reactor_server_ksicluster_setproperty_system_collections_generic_dictionary_system_string_ks_reac" id="ks_reactor_server_ksicluster_setproperty_system_collections_generic_dictionary_system_string_ks_reac"></a>

Send a batch request to the cluster to set properties.

```csharp
ksAsyncResult<Dictionary<string, ksMultiType>> SetProperty(Dictionary<string, ksMultiType> properties, ksClusterProperty.WriteCache caching = WriteCache.STORE)
```

#### Parameters

`properties` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), ksMultiType>

property key value pairs

`caching` ksClusterProperty.WriteCache

Cache write rule (Default STORE)

#### Returns

ksAsyncResult<[Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), ksMultiType>>

aysnc result

### StartRoom(string, string, string, ksJSON, IEnumerable\<string>) <a href="#ks_reactor_server_ksicluster_startroom_system_string_system_string_system_string_ks_reactor_ksjson_s" id="ks_reactor_server_ksicluster_startroom_system_string_system_string_system_string_ks_reactor_ksjson_s"></a>

Request the cluster start a new room.

```csharp
ksAsyncResult<ksRoomInfo> StartRoom(string name, string sceneName, string roomType, ksJSON publicData = null, IEnumerable<string> publicTags = null)
```

#### Parameters

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

room name

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

scene name

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

room type

`publicData` ksJSON

The room's [PublicData](/reactor/api-reference/ks.reactor/ks.reactor.ksroominfo.md#KS_Reactor_ksRoomInfo_PublicData) that is part of the response to [GetRoomInfo](#KS_Reactor_Server_ksICluster_GetRoomInfo_System_Collections_Generic_IEnumerable_7bSystem_String_7d_) calls, and, for public rooms, is also part of the response when client's call ksReactor.GetServers. A room can get its own [ksRoomInfo](/reactor/api-reference/ks.reactor/ks.reactor.ksroominfo.md) from [Info](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksiserverroom.md#KS_Reactor_Server_ksIServerRoom_Info). Defaults to null.

`publicTags` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)>

The room's [PublicTags](/reactor/api-reference/ks.reactor/ks.reactor.ksroominfo.md#KS_Reactor_ksRoomInfo_PublicTags) that is part of the response to [GetRoomInfo](#KS_Reactor_Server_ksICluster_GetRoomInfo_System_Collections_Generic_IEnumerable_7bSystem_String_7d_) calls, and, for public rooms, is also part of the response when client's call ksReactor.GetServers. A room can get its own [ksRoomInfo](/reactor/api-reference/ks.reactor/ks.reactor.ksroominfo.md) from [Info](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksiserverroom.md#KS_Reactor_Server_ksIServerRoom_Info). Cluster API calls can filter rooms by their tags. Defaults to null.

#### Returns

ksAsyncResult\<ksRoomInfo>

aysnc result

### StartRoom(string, string, string, ksJSON, params string\[]) <a href="#ks_reactor_server_ksicluster_startroom_system_string_system_string_system_string_ks_reactor_ksjson_s" id="ks_reactor_server_ksicluster_startroom_system_string_system_string_system_string_ks_reactor_ksjson_s"></a>

Request the cluster start a new room.

```csharp
ksAsyncResult<ksRoomInfo> StartRoom(string name, string sceneName, string roomType, ksJSON publicData = null, params string[] publicTags)
```

#### Parameters

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

room name

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

scene name

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

room type

`publicData` ksJSON

The room's [PublicData](/reactor/api-reference/ks.reactor/ks.reactor.ksroominfo.md#KS_Reactor_ksRoomInfo_PublicData) that is part of the response to [GetRoomInfo](#KS_Reactor_Server_ksICluster_GetRoomInfo_System_Collections_Generic_IEnumerable_7bSystem_String_7d_) calls, and, for public rooms, is also part of the response when client's call ksReactor.GetServers. A room can get its own [ksRoomInfo](/reactor/api-reference/ks.reactor/ks.reactor.ksroominfo.md) from [Info](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksiserverroom.md#KS_Reactor_Server_ksIServerRoom_Info). Defaults to null.

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

The room's [PublicTags](/reactor/api-reference/ks.reactor/ks.reactor.ksroominfo.md#KS_Reactor_ksRoomInfo_PublicTags) that is part of the response to [GetRoomInfo](#KS_Reactor_Server_ksICluster_GetRoomInfo_System_Collections_Generic_IEnumerable_7bSystem_String_7d_) calls, and, for public rooms, is also part of the response when client's call ksReactor.GetServers. A room can get its own [ksRoomInfo](/reactor/api-reference/ks.reactor/ks.reactor.ksroominfo.md) from [Info](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksiserverroom.md#KS_Reactor_Server_ksIServerRoom_Info). Cluster API calls can filter rooms by their tags. Defaults to null.

#### Returns

ksAsyncResult\<ksRoomInfo>

aysnc result

### StopRoom(params uint\[]) <a href="#ks_reactor_server_ksicluster_stoproom_system_uint32" id="ks_reactor_server_ksicluster_stoproom_system_uint32"></a>

Send a request to the cluster to stop a group of rooms. The result is returned and completed immediately. Error is null if the request was not sent otherwise it contains a string explaining why the request was not sent.

```csharp
ksAsyncResult StopRoom(params uint[] roomIds)
```

#### Parameters

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

Room Ids

#### Returns

ksAsyncResult

aysnc result
