mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 10:15:52 +01:00
Updated SubCreator (markdown)
parent
7858695128
commit
0eac872048
@ -16,13 +16,10 @@ SubCreator is the program that creates SubServers for you. This page goes over h
|
||||
`Version` - Minecraft Version to update to (may be optional)<br><br>
|
||||
|
||||
|
||||
### SubCreator Templates
|
||||
## SubCreator Templates
|
||||
SubCreator Templates are pre-made server folders with some special properties. To create a template, all you need to do is create a new folder inside the Templates directory and drop whatever files you need inside. On the SubCreator side of things, below are optional files you can use to customize the installation.<br><br>
|
||||
|
||||
__subservers.client__:<br>
|
||||
This is an empty JSON file on the root folder, used to indicate that you would like SubServers.Client installed (for compatible server types only). It is filled with data on creation.<br><br>
|
||||
|
||||
__template.yml__:<br>
|
||||
### /template.yml
|
||||
This is a YAML file on the root folder, used to modify SubCreator's default configuration. This is it's full contents:<br>
|
||||
```yml
|
||||
Template:
|
||||
@ -32,10 +29,16 @@ Template:
|
||||
Build:
|
||||
Import:
|
||||
- OtherTemplate
|
||||
Replace:
|
||||
- '/myfile.yml'
|
||||
Replacements:
|
||||
'example': 'My Cool Variable!'
|
||||
Server-Type: 'CUSTOM'
|
||||
Use-Cache: true
|
||||
Install-Client: true
|
||||
Require-Version: false
|
||||
Can-Update: false
|
||||
Update-Files: false
|
||||
Executable: 'bash build.sh'
|
||||
Run-On-Finish: true
|
||||
Settings:
|
||||
@ -48,29 +51,66 @@ Template:
|
||||
`Icon` **[Item]**: Set the item icon of this template<br>
|
||||
`Build` **[Object]**: SubCreator build options<br>
|
||||
`Import` **[Enum Value List]**: Import and run other templates by name<br>
|
||||
`Replace` **[File Path List]**: Select files to replace variables in ([How?](https://github.com/ME1312/SubServers-2/wiki/SubCreator#Other-Files))<br>
|
||||
`Replacements` **[Object]**: Define custom variables for this build<br>
|
||||
`Server-Type` **[Enum Value]**: Set which [ServerType](https://dev.me1312.net/jenkins/job/SubServers%20Platform/javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Host/SubCreator.ServerType.html) this template will build<br>
|
||||
`Use-Cache` **[Boolean]**: Creates and forwards a valid cache directory to the script when true<br>
|
||||
`Require-Version` **[Boolean]**: Switches the `[Version]` field from optional to required<br>
|
||||
`Can-Update` **[Boolean]**: Signals that this template can update servers created by it<br>
|
||||
`Executable` **[File Path/String]**: A command to execute or the path to a script to execute. This value can use the following variables in addition to the system's own:<br>
|
||||
**->** `java`: The full path of the current java executable<br>
|
||||
**->** `mode`: The build mode requested (`CREATE` or `UPDATE`)<br>
|
||||
**->** `name`: The name of the new server<br>
|
||||
**->** `host`: The name of the host that was selected<br>
|
||||
**->** `template`: The name of the template being used<br>
|
||||
**->** `type`: The [ServerType](https://dev.me1312.net/jenkins/job/SubServers%20Platform/javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Host/SubCreator.ServerType.html) the template will create<br>
|
||||
**->** `version`: The minecraft version requested (may be empty)<br>
|
||||
**->** `sp_version`: The sponge build parsed by SubCreator (`FORGE` and `SPONGE` servers only)<br>
|
||||
**->** `mcf_version`: The forge build parsed by SubCreator (`FORGE` servers only)<br>
|
||||
**->** `address`: The bind address of the host<br>
|
||||
**->** `port`: The port number of the new server<br>
|
||||
**->** `cache`: The caching directory (only when `Use-Cache` is true)<br>
|
||||
`Executable` **[File Path/String]**: A command to execute or the path to a script to execute.<br>
|
||||
`Run-On-Finish` **[Boolean]**: Whether this subserver will be started after SubCreator finishes<br>
|
||||
`Settings` **[Object]**: Sets the default options for the subserver. Any setting from the `Servers` section of the [main configuration](https://github.com/ME1312/SubServers-2/wiki/Configuration#subserversserversyml-global-configuration) is valid here. Additionally, String values in this object can use the following variables:<br>
|
||||
**->** `$name$`: The name of the new server<br>
|
||||
**->** `$template$`: The name of the template that was used<br>
|
||||
**->** `$type$`: The [ServerType](https://dev.me1312.net/jenkins/job/SubServers%20Platform/javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Host/SubCreator.ServerType.html) the template will create<br>
|
||||
**->** `$version$`: The minecraft version requested<br>
|
||||
**->** `$address$`: The bind address of the host<br>
|
||||
**->** `$port$`: The port number of the new server<br>
|
||||
<br>
|
||||
`Settings` **[Object]**: Sets the default options for the subserver. Any setting from the `Servers` section of the [main configuration](https://github.com/ME1312/SubServers-2/wiki/Configuration#subserversserversyml-global-configuration) is valid here. Additionally, you can use variables for this object's strings using this format: `$variable$`.<br><br>
|
||||
|
||||
**Default Variables:**<br>
|
||||
The following default variables are available for use in the `Settings` section, File replacements, `Executable`, and in your build script:<br>
|
||||
**->** `player`: The UUID of the player who created this server (empty for CONSOLE)<br>
|
||||
**->** `name`: The name of the new server<br>
|
||||
**->** `host`: The name of the host that was selected<br>
|
||||
**->** `template`: The name of the template being used<br>
|
||||
**->** `type`: The [ServerType](https://dev.me1312.net/jenkins/job/SubServers%20Platform/javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Host/SubCreator.ServerType.html) the template will create<br>
|
||||
**->** `version`: The minecraft version requested (may be empty)<br>
|
||||
**->** `address`: The bind address of the host<br>
|
||||
**->** `port`: The port number of the new server<br>
|
||||
|
||||
**Scripting Variables:**<br>
|
||||
Additionally, the following variables are also available for use in `Executable` and your build script in addition to the system's own variables:<br>
|
||||
**->** `java`: The full path of the current java executable<br>
|
||||
**->** `mode`: The build mode requested (`CREATE` or `UPDATE`)<br>
|
||||
**->** `sp_version`: The sponge build parsed by SubCreator (`FORGE` and `SPONGE` servers only)<br>
|
||||
**->** `mcf_version`: The forge build parsed by SubCreator (`FORGE` servers only)<br>
|
||||
**->** `cache`: The caching directory (only when `Use-Cache` is true)<br><br>
|
||||
|
||||
### Other Files
|
||||
As you may have seen in the previous section, it is possible for SubCreator to make replacements for variables in completely unrelated files included with your template. Here are some things to note on that topic:
|
||||
* Aside from `/server.properties`, you have to opt-in a file to make replacements in it
|
||||
* Variables in these files use this format: `SubServers::variable`
|
||||
|
||||
<br>
|
||||
|
||||
**Selecting Files:**<br>
|
||||
That's great, you may be thinking to yourself, but how do you opt-in a file? Well, SubCreator uses the `Replace` build option and a format very similar to that of `.gitignore` files to accomplish this task.<br><br>
|
||||
|
||||
> `\`: Used to escape a character with special meaning<br>
|
||||
> `!`: Used to negate a previous include statement<br>
|
||||
> `/`: Used to match a full file path<br>
|
||||
> `[A-Z]`: Used to select a single character in the specified range (RegEx style)<br>
|
||||
> `?`: Used to select any single character, not including `/`<br>
|
||||
> `*`: Used to select any number of characters, but not `/`<br>
|
||||
> `**`: Used to select any number of characters, including `/`, at the beginning or at the end of an include statement
|
||||
|
||||
Formatting rules for file inclusion statements.<br><br>
|
||||
|
||||
```
|
||||
/permissions.yml
|
||||
```
|
||||
Selects `permissions.yml` on the root folder only.<br><br>
|
||||
|
||||
```
|
||||
config.yml
|
||||
```
|
||||
Selects all files named `config.yml`<br><br>
|
||||
|
||||
```
|
||||
!/plugins/ProblemPlugin/config.yml
|
||||
```
|
||||
Deselects the specific `config.yml` that exists in `/plugins/ProblemPlugin/`<br><br>
|
Loading…
Reference in New Issue
Block a user