Adjust config for new fight system
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
2301a618eb
Commit
a079b25c14
@ -73,22 +73,29 @@ public class ArenaMode {
|
|||||||
|
|
||||||
private final String internalName;
|
private final String internalName;
|
||||||
private final String displayName;
|
private final String displayName;
|
||||||
|
private final String folder;
|
||||||
private final List<String> chatNames;
|
private final List<String> chatNames;
|
||||||
private final String serverJar;
|
private final String serverJar;
|
||||||
private final List<String> maps;
|
private final List<String> maps;
|
||||||
private final boolean historic;
|
private final boolean historic;
|
||||||
|
|
||||||
private final boolean ranked;
|
private final boolean ranked;
|
||||||
private final String schemType;
|
private final String schemType;
|
||||||
|
|
||||||
private ArenaMode(String internalName, Configuration config){
|
private ArenaMode(String internalName, Configuration config){
|
||||||
this.internalName = internalName;
|
this.internalName = internalName;
|
||||||
this.displayName = config.getString("displayName");
|
this.folder = config.getString("folder");
|
||||||
this.serverJar = config.getString("serverJar");
|
this.serverJar = config.getString("serverJar");
|
||||||
this.chatNames = config.getStringList("chatNames");
|
|
||||||
this.maps = config.getStringList("maps");
|
this.maps = config.getStringList("maps");
|
||||||
|
this.displayName = config.getString("displayName", internalName);
|
||||||
|
if(config.contains("chatNames"))
|
||||||
|
this.chatNames = config.getStringList("chatNames");
|
||||||
|
else
|
||||||
|
this.chatNames = Collections.emptyList();
|
||||||
this.historic = config.getBoolean("historic", false);
|
this.historic = config.getBoolean("historic", false);
|
||||||
|
this.schemType = config.getString("schemType", "").toLowerCase();
|
||||||
|
|
||||||
this.ranked = config.getBoolean("ranked", false);
|
this.ranked = config.getBoolean("ranked", false);
|
||||||
this.schemType = config.getString("schemType", null);
|
|
||||||
|
|
||||||
allModes.add(this);
|
allModes.add(this);
|
||||||
byInternal.put(internalName, this);
|
byInternal.put(internalName, this);
|
||||||
@ -96,8 +103,8 @@ public class ArenaMode {
|
|||||||
byChat.put(name.toLowerCase(), this);
|
byChat.put(name.toLowerCase(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(config.contains("checkSchemType"))
|
if(!this.schemType.equals(""))
|
||||||
byCheckSchemType.put(config.getString("checkSchemType").toLowerCase(), this);
|
byCheckSchemType.put(this.schemType, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInternalName() {
|
public String getInternalName() {
|
||||||
@ -120,6 +127,10 @@ public class ArenaMode {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getFolder() {
|
||||||
|
return folder;
|
||||||
|
}
|
||||||
|
|
||||||
public String getRandomMap(){
|
public String getRandomMap(){
|
||||||
return maps.get(random.nextInt(maps.size()));
|
return maps.get(random.nextInt(maps.size()));
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ public class SubserverSystem {
|
|||||||
|
|
||||||
//Copy world
|
//Copy world
|
||||||
try {
|
try {
|
||||||
new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getInternalName() + "/" + map, worldDir + mapName).start().waitFor();
|
new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getFolder() + "/" + map, worldDir + mapName).start().waitFor();
|
||||||
} catch (IOException | InterruptedException e) {
|
} catch (IOException | InterruptedException e) {
|
||||||
throw new SecurityException("Could not copy folder", e);
|
throw new SecurityException("Could not copy folder", e);
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren