You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IronPython is regular Python but with the option of using .NET classes or DLL files (e.g. the TCAdmin SDK).
6
+
7
+
## Use .NET in IronPython
8
+
If you want to use any of the .NET classes, you will need to import them into the IronPython script like you would in Python. Before using any .NET classes, you will need to import the clr module, however.
9
+
This is an example of how to use the .NET WebClient class, so we can use the `DownloadFile()` method:
10
+
```py
11
+
from System.Net import WebClient
12
+
from System.IOimport Path
13
+
14
+
#Download the TCAdmin logo to the service's root directory
Script.WriteToConsole('Could not download the file. Error: {}'.format(e))
20
+
```
21
+
22
+
## Use the TCAdmin SDK
23
+
Before you can use the TCAdmin SDK (or any DLL files for that matter), you need to reference them first. This is done by using the `clr.AddReference()` method.
Copy file name to clipboardExpand all lines: docs/using-tcadmin/game-voice-configuration/variables.mdx
+31-10Lines changed: 31 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,23 +5,44 @@ sidebar_position: 16
5
5
6
6
# Variables
7
7
8
-
Variables allow you to have addtional values that the user can input when creating or configuring a service. These can be used in the game's configuration files (via the config editor) or in commandlines.
8
+
Variables are an important part of TCAdmin. They allow you to set predefined values for specific elements (e.g. settings in a configuration file) or the command line. You can also use variables in custom scripts.
9
+
If you want to use a variable in a configuration file or the commandline, you should use `$[DefaultVariableName]` or `![CustomVariable]`.
10
+
If you want to use a variable in a custom script, please see the documentation for [ThisService](/customizations/scripts/script-objects/this-service#custom-variables).
9
11
10
-
To use custom variables in the command line or in configuration use this format:
12
+
## Default Variables
13
+
All services have a few default variables configured. Some of these could be for the hostname, rcon password and private password.
11
14
12
-
```
13
-
![VariableName]
14
-
```
15
-
16
-
## Custom Variable
15
+
## Custom Variables
16
+
You can create your own variables for each of your game templates. This is done under the "Variables" tab in the game settings.
17
17
18
18
-`Variable Name` - The unformatted name of the variable. You should not change the name if this variable is already in use.
19
19
-`Default Value` - The default value for this variable. `For example 'changeme'.`
20
20
21
-
## Commandline Parameter Options
21
+
###Commandline Parameter Options
22
22
23
-
-`Useraccess` - Specify if the user is able to set the value of this variable when using the commandline builder.
23
+
-`Admin/Sub admin/Reseller/User/Server owner access` - Specify if the given role is able to set the value of this variable when using the commandline builder or executing a custom script.
24
24
-`Value is required` - Specify if the value is required.
25
25
-`Item Type` - Select the type of item that will be used to capture the user's input.
26
26
-`Parent Variable` - Select the item's parent value.
27
-
-`Parent Value` - The item will only be displayed if the parent variable has this value.
27
+
-`Parent Value` - The item will only be displayed if the parent variable has this value.
28
+
29
+
### Display formatting for File System ComboBox
30
+
Starting from TCAdmin 2.0.187.5, you have the ability to manipulate how a specific variable is shown to the user.
31
+
This is done using the 'Display Regex' and 'Display Format' fields.
32
+
33
+
The following is an example on how you could manipulate the value of a ComboBox that is generated based on folders in `backups/worlds/` on the game service.
34
+
The folders inside `backups/worlds/` are named based on the date and time they were created (%Y-%m-%d_%H%M%S):
35
+
- 2023-08-27_220030
36
+
- 2023-08-27_100030
37
+
- 2023-08-26_220030
38
+
39
+
If you want to manipulate how this is shown in the ComboBox, you can use regex to change how the values are shown:
0 commit comments