-
- Notifications
You must be signed in to change notification settings - Fork 1
Advanced server usage
To use MCSMT well, you must first master the configuration file syntax. Actually it's not that difficult. This article introduces the server, which is the configuration file of the server.gen module. The default name is config.json.
The following is a standard config.json
[ [ "resource", [ "default" ], "output", 0 ], [ "resource", [ "recursive" ], "output", 1 ] ]
Based on the above two information, please guess the content of the generated index client.json.
So, the real result is - this:
{ "output": [ [ "resource/1.default", "CF83E1357EEFF1542850D66D66D8007D620E4050B5715DC83F4A921d36ce9CE47D0D13C5D85FF8318D2F63B93BD4741A538327AF9222 7DA3E " ], [ "resource/1.recursive", "CF83E1357EEFF1542850D66D66D8007D620E4050B5715DC83F4A921d36ce9CE47D0D13C5D85FF8318D2F63B93BD4741A538327AF9222 7DA3E " ] ], "output/subfolder": [ [ "resource/subfolder/2.recursive", "CF83E1357EEFF1542850D66D66D8007D620E4050B5715DC83F4A921d36ce9CE47D0D13C5D85FF8318D2F63B93BD4741A538327AF9222 7DA3E " ] ] }I don’t know how you guessed it, but let’s get to the point.
The configuration file is a json file, which reads config.json in the current path (working directory) by default. You can also generate one using the quick generator mentioned on the homepage. But our main purpose today is to briefly introduce it, so that you can write.
The body of the configuration file is a list containing multiple entries.
MCSMT will search for files according to the rules specified in the entry and add them to the final generated index file.
Items are a list, contained within the body. There are four values in the entry, the last of which can be ignored.
The following is the explanation, valid value, and default value corresponding to the value of the entry.
| Subscript | Definition | Type | Valid values | Default values |
|---|---|---|---|---|
| 0 | Resource path | String | Valid folder path | None, required |
| 1 | Allowed suffix | String list | File suffix, without dot, does not support wildcards, does not support regular expressions | None, required |
| 2 | Destination path | String | Valid folder path | None, required |
| 3 | Whether to recurse | Boolean | Valid Boolean value | 0 |