Skip to content

Commit 272a19c

Browse files
committed
fix: Some bugfixes
1 parent 86564df commit 272a19c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ shadow = "8.3.5"
77

88
# utilities
99
slf4md = "1.0.1"
10-
distributor = "4.0.2"
10+
distributor = "4.1.0"
1111
gson = "2.11.0"
1212
filestore = "2.1.0"
1313
cloud-core = "2.0.0"

src/main/java/com/xpdustry/domination/DominationPlugin.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void onInit() {
6969
Distributor.get().getEventBus().subscribe(EventType.PlayEvent.class, this, event -> {
7070
this.loader.setFile(getDirectory()
7171
.resolve("maps")
72-
.resolve(Vars.state.map.name() + ".json")
72+
.resolve(sanitizeFileName(Vars.state.map.name()) + ".json")
7373
.toFile());
7474
this.loader.set(new ArrayList<>());
7575
this.loader.load();
@@ -118,4 +118,8 @@ public MindustryCommandManager<CommandSender> getServerCommandManager() {
118118
public MindustryCommandManager<CommandSender> getClientCommandManager() {
119119
return clientCommands;
120120
}
121+
122+
private String sanitizeFileName(final String input) {
123+
return input.replaceAll("[<>:\"/|?*]", "_");
124+
}
121125
}

0 commit comments

Comments
 (0)