Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for preserving file structure when using redirectors not just taking top level folder #307

Open
MikeClarkeGames opened this issue Aug 2, 2023 · 0 comments

Comments

@MikeClarkeGames
Copy link

MikeClarkeGames commented Aug 2, 2023

Serversync Version: 4.1.0

Minecraft Version: 1.20.1

Issue: If you have a set of files that are in a folder, and you want to redirect that to another folder structure but preserve the structure of all the folders further down the chain, this, I believe, is currently not supported. Here is an example to make it clear:

I have a "clientconfig" directory on the server. In that directory, I have a config file, but I also have a folder under that - in this case "presencefootsteps", and in that directory there's another config json. So I have:
clientconfig/iris.properties
clientconfig/presencefootsteps/userconfig.json

In the server.json file, I want to specify to redirect (and use push mode) so to keep the overall structure, so I'd like:
config/iris.properties
config/presencefootsteps/userconfig.json

My example config file test for this example above:
{
"general": {
"push_client_mods": true,
"sync_mode": 2
},
"connection": {
"port": 25566,
"buffer": 65536
},
"rules": {
"directories": [
{
"path": "mods",
"mode": "mirror"
},
{
"path": "clientconfig",
"mode": "push"
}
],
"files": {
"include": [
"mods/",
"clientshaderpacks/
",
"clientconfig/"
],
"ignore": [
"
/serversync-.jar",
"**/serversync-
.cfg"
],
"redirect": [
{ "pattern": "clientshaderpacks/", "redirectTo": "shaderpacks" },
{ "pattern": "clienttexturepacks/
", "redirectTo": "texturepacks" },
{ "pattern": "clientresourcepacks/", "redirectTo": "resourcepacks" },
{ "pattern": "clientconfig/
", "redirectTo": "config/" } #Note that the / here is not supported.
]
}
},
"misc": {
"locale": "en_CA"
}

P.S. This little script has saved me countless hours with clients not having to mess around downloading mods manually (and most importantly me having to explain how to do this!), I cannot stress enough how much I love the work you have done here, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants