Add config to exclude mods from syncing/info
This commit is contained in:
parent
8233174487
commit
2cbfbe8047
3 changed files with 9 additions and 5 deletions
|
@ -135,7 +135,7 @@ public class AutoSync {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean didRegisterAdditionalMods = false;
|
private static boolean didRegisterAdditionalMods = false;
|
||||||
//we call this from HelloClient on the Srérver to prepare transfer
|
//we call this from HelloClient on the Server to prepare transfer
|
||||||
protected static void loadSyncFolder() {
|
protected static void loadSyncFolder() {
|
||||||
if (Configs.SERVER_CONFIG.isOfferingFiles()) {
|
if (Configs.SERVER_CONFIG.isOfferingFiles()) {
|
||||||
syncFolderDescriptions.forEach(desc -> desc.loadCache());
|
syncFolderDescriptions.forEach(desc -> desc.loadCache());
|
||||||
|
|
|
@ -16,6 +16,7 @@ import ru.bclib.api.dataexchange.DataHandlerDescriptor;
|
||||||
import ru.bclib.api.dataexchange.handler.autosync.AutoSyncID.WithContentOverride;
|
import ru.bclib.api.dataexchange.handler.autosync.AutoSyncID.WithContentOverride;
|
||||||
import ru.bclib.api.dataexchange.handler.autosync.SyncFolderDescriptor.SubFile;
|
import ru.bclib.api.dataexchange.handler.autosync.SyncFolderDescriptor.SubFile;
|
||||||
import ru.bclib.config.Configs;
|
import ru.bclib.config.Configs;
|
||||||
|
import ru.bclib.config.ServerConfig;
|
||||||
import ru.bclib.gui.screens.ModListScreen;
|
import ru.bclib.gui.screens.ModListScreen;
|
||||||
import ru.bclib.gui.screens.ProgressScreen;
|
import ru.bclib.gui.screens.ProgressScreen;
|
||||||
import ru.bclib.gui.screens.SyncFilesScreen;
|
import ru.bclib.gui.screens.SyncFilesScreen;
|
||||||
|
@ -91,6 +92,11 @@ public class HelloClient extends DataHandler.FromServer {
|
||||||
.collect(Collectors.toList())
|
.collect(Collectors.toList())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mods = mods
|
||||||
|
.stream()
|
||||||
|
.filter(entry -> !Configs.SERVER_CONFIG.get(ServerConfig.EXCLUDED_MODS).contains(entry))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
//write Plugin Versions
|
//write Plugin Versions
|
||||||
buf.writeInt(mods.size());
|
buf.writeInt(mods.size());
|
||||||
|
|
|
@ -16,6 +16,7 @@ public class ServerConfig extends NamedPathConfig {
|
||||||
|
|
||||||
|
|
||||||
public static final ConfigToken<List<String>> ADDITIONAL_MODS = ConfigToken.StringArray(new ArrayList<>(0), "additionalMods", AutoSync.SYNC_CATEGORY);
|
public static final ConfigToken<List<String>> ADDITIONAL_MODS = ConfigToken.StringArray(new ArrayList<>(0), "additionalMods", AutoSync.SYNC_CATEGORY);
|
||||||
|
public static final ConfigToken<List<String>> EXCLUDED_MODS = ConfigToken.StringArray(new ArrayList<>(0), "excludeMods", AutoSync.SYNC_CATEGORY);
|
||||||
|
|
||||||
|
|
||||||
public ServerConfig() {
|
public ServerConfig() {
|
||||||
|
@ -45,8 +46,5 @@ public class ServerConfig extends NamedPathConfig {
|
||||||
public boolean isOfferingInfosForMods() {
|
public boolean isOfferingInfosForMods() {
|
||||||
return get(SEND_ALL_MOD_INFO) /*&& isAllowingAutoSync()*/;
|
return get(SEND_ALL_MOD_INFO) /*&& isAllowingAutoSync()*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] additionalModsForSync() {
|
|
||||||
return new String[0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue