Documentation Index
Fetch the complete documentation index at: https://mintlify.com/FarlandsModdingTeam/TerbinProyect/llms.txt
Use this file to discover all available pages before exploring further.
ServiceConfiguration is a static handler class that provides IPC access to Terbin’s persistent key-value configuration store. The store is backed by a Dictionary<string, string> serialized to config/config.json and managed by Manager.Configuration. Every other service in TerbinService reads configuration paths through this manager at runtime, so routes updated here take effect immediately on the next call.
UpdateRute (
CodeServices.Create) is present in the source but its [TerbinExecutable] attribute is commented out in the current codebase. The attribute line reads //[TerbinExecutable((byte)CodeServices.Create, (byte)CodeServicesSection.Rute)]. Only ReadRute is actively registered and callable over IPC.Configuration Keys
The following keys are defined as constants inTerbinConfiguration and are recognized by Manager.Configuration:
| Key constant | String value | Description | Auto-detected? |
|---|---|---|---|
TerbinConfiguration.RUTE_FARLANDS | rute_farlands | Absolute path to the Farlands game installation directory. | Yes — via ManagerFarlands.GetRuteSteamFarlands() |
TerbinConfiguration.RUTE_INSTANCES | rute_instances | Directory where Terbin stores all game instance subdirectories. | Yes — defaults to ~/Documents/TerbinInstances |
TerbinConfiguration.RUTE_STORAGE_PLUGINS | rute_plugins | Directory where downloaded plugin archives are stored. | Yes — defaults to ~/Documents/TerbinStorage |
TerbinConfiguration.RUTE_STEAM | rute_steam | Absolute path to the Steam installation. | No — must be set manually |
TerbinConfiguration.RUTE_PROTON | rute_proton | Absolute path to the Proton installation used to run the game on Linux. | No — must be set manually |
TerbinConfiguration.RUTE_PROTON_TMP | rute_proton_tmp | Temporary directory used by Proton at runtime. | No — must be set manually |
On first startup,
Manager.Configuration calls setPredeterminatedConfig() which auto-detects and persists rute_farlands, rute_instances, and rute_plugins. The Steam and Proton keys have no automatic defaults. Until they are explicitly set via UpdateRute, calling ReadRute for those keys will cause Manager.Configuration.GetConfg to throw an unhandled exception (the predeterminated lookup returns null, and GetConfg throws rather than returning null). The source also notes a TODO to manage Steam/Proton installation state and to move instances when their path changes.Operations
ReadRute — (CodeServices.Read, CodeServicesSection.Rute)
ReadRute — (CodeServices.Read, CodeServicesSection.Rute)
Reads the configured path value for a given configuration key. Internally calls
Manager.Configuration.GetConfg(keyRute). If the key is not in the stored dictionary, the manager attempts getPredeterminatedAndSave to fill in a default for the three auto-detected keys.Action bytes: (byte)CodeServices.Read, (byte)CodeServicesSection.Rute = 50Request Payload
The configuration key to read, encoded as a length-prefixed UTF-16 char array using
Serialineitor.SerializeArray<char>. Use one of the string constants from the table above (e.g., "rute_farlands").Response Payload
The responseStatus field indicates the result:CodeStatus | Meaning |
|---|---|
Succes | Key found. The payload is a length-prefixed UTF-16 char array of the configured path. |
AccesNullOrNotExist | The key was present in the dictionary but resolved to null. In practice this is not reached for the three auto-detected keys (they always have a default), and for the Steam/Proton keys GetConfg throws rather than returning null — so avoid calling ReadRute for rute_steam, rute_proton, or rute_proton_tmp before they have been set via UpdateRute. |
ErrorNotPayload | The request payload was empty or the deserialized key string was empty. |
Present only when
Status == Succes. The configured path value as a length-prefixed UTF-16 char array. Reconstruct the string with new string(Serialineitor.DeserializeArray<char>(ref bytes)).Example
UpdateRute — (CodeServices.Create, CodeServicesSection.Rute)
UpdateRute — (CodeServices.Create, CodeServicesSection.Rute)
Updates or inserts a configuration key-value pair. Internally calls
Manager.Configuration.SetConfig(keyRute, newRute), which reads the current dictionary, sets data[keyRute] = newRute, and saves it back with JSonUtil.Save. After saving, OnChangeConfig is fired on a background task (100 ms delay) so other internal components can react to the change.Action bytes (when enabled): (byte)CodeServices.Create, (byte)CodeServicesSection.Rute = 50Request Payload
The configuration key to write, encoded as a length-prefixed UTF-16 char array.
The new path value, encoded as a length-prefixed UTF-16 char array.
Response
The response carries only aCodeStatus field (no payload body):CodeStatus | Meaning |
|---|---|
Succes | Key updated and persisted successfully (CodeAcessJSonSave.Succes). |
SerializeError | The config dictionary could not be serialized to JSON (CodeAcessJSonSave.ErrorSerialize). |
AccesNullOrNotExist | Any other failure result from SetConfig. |
ErrorNotPayload | The request payload was empty or newRute deserialized to null. |
Example
Reading All Known Keys
Because there is noReadAll operation for configuration, clients that need to display the full configuration state must issue one ReadRute request per key. The complete set of known keys is: