> 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.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler.md).

# Class ksServerScriptCompiler

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

This class compiles the KSServerRuntime project.

```csharp
public class ksServerScriptCompiler
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksServerScriptCompiler](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler.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

### CompileCallback <a href="#ks_reactor_client_unity_editor_ksserverscriptcompiler_compilecallback" id="ks_reactor_client_unity_editor_ksserverscriptcompiler_compilecallback"></a>

Sets a custom compile callback to use in place of the default callbacks. The callback regigstered will be invoked in a standalone thread.

```csharp
public static ksServerScriptCompiler.CustomCompileCallback CompileCallback
```

#### Field Value

[ksServerScriptCompiler](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler.md).[CustomCompileCallback](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler/ks.reactor.client.unity.editor.ksserverscriptcompiler.customcompilecallback.md)

## Properties

### Instance <a href="#ks_reactor_client_unity_editor_ksserverscriptcompiler_instance" id="ks_reactor_client_unity_editor_ksserverscriptcompiler_instance"></a>

Singleton instance

```csharp
public static ksServerScriptCompiler Instance { get; }
```

#### Property Value

[ksServerScriptCompiler](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler.md)

### IsCompiling <a href="#ks_reactor_client_unity_editor_ksserverscriptcompiler_iscompiling" id="ks_reactor_client_unity_editor_ksserverscriptcompiler_iscompiling"></a>

Is the server runtime compiling?

```csharp
public bool IsCompiling { get; }
```

#### Property Value

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

## Methods

### BuildServerRuntime(bool, CompileCompleteHandler, Configurations, bool) <a href="#ks_reactor_client_unity_editor_ksserverscriptcompiler_buildserverruntime_system_boolean_ks_reactor_c" id="ks_reactor_client_unity_editor_ksserverscriptcompiler_buildserverruntime_system_boolean_ks_reactor_c"></a>

Builds the serverruntime asyncronously.

```csharp
public void BuildServerRuntime(bool rebuild = false, ksServerScriptCompiler.CompileCompleteHandler callback = null, ksServerScriptCompiler.Configurations configuration = Configurations.LOCAL_RELEASE, bool restartServers = true)
```

#### Parameters

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

If true, will force a rebuild.

`callback` [ksServerScriptCompiler](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler.md).[CompileCompleteHandler](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler/ks.reactor.client.unity.editor.ksserverscriptcompiler.compilecompletehandler.md)

Called when compile finishes.

`configuration` [ksServerScriptCompiler](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler.md).[Configurations](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler/ks.reactor.client.unity.editor.ksserverscriptcompiler.configurations.md)

Build configuration.

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

Restart servers after building.

### BuildServerRuntimeSync(bool, Configurations, bool) <a href="#ks_reactor_client_unity_editor_ksserverscriptcompiler_buildserverruntimesync_system_boolean_ks_react" id="ks_reactor_client_unity_editor_ksserverscriptcompiler_buildserverruntimesync_system_boolean_ks_react"></a>

Builds the serverruntime syncronously.

```csharp
public ksServerScriptCompiler.CompileResults BuildServerRuntimeSync(bool rebuild = false, ksServerScriptCompiler.Configurations configuration = Configurations.LOCAL_RELEASE, bool restartServers = true)
```

#### Parameters

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

If true, will force a rebuild.

`configuration` [ksServerScriptCompiler](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler.md).[Configurations](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler/ks.reactor.client.unity.editor.ksserverscriptcompiler.configurations.md)

Build configuration.

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

Restart servers after building.

#### Returns

[ksServerScriptCompiler](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler.md).[CompileResults](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler/ks.reactor.client.unity.editor.ksserverscriptcompiler.compileresults.md)

Compile result
