From 758372108b63c3dfccc45fb7ec87e66239da238f Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Sun, 17 Jul 2022 20:07:34 +0200 Subject: [PATCH] Added more config. --- README.md | 7 +++++++ core/src/main/java/nl/andrewl/aos_core/config/Config.java | 2 ++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 3c26081..4a63218 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # ace-of-shades-2 A simple 3D voxel-based shooter inspired by Ace of Spades. + +## Configuration +Both the client and server use a similar style of YAML-based configuration, where upon booting up, the program will look for a configuration file in the current working directory with one of the following names: `configuration`, `config`, `cfg`, ending in either `.yaml` or `.yml`. Alternatively, you can provide the path to a configuration file at a different location via a single command-line argument. For example: +```bash +java -jar server.jar /path/to/my/custom/config.yaml +``` +If no configuration file is found, and none is explicitly provided, then a set of default configuration options is loaded. diff --git a/core/src/main/java/nl/andrewl/aos_core/config/Config.java b/core/src/main/java/nl/andrewl/aos_core/config/Config.java index becf25a..289c272 100644 --- a/core/src/main/java/nl/andrewl/aos_core/config/Config.java +++ b/core/src/main/java/nl/andrewl/aos_core/config/Config.java @@ -49,6 +49,8 @@ public final class Config { public static List getCommonConfigPaths() { List paths = new ArrayList<>(); + paths.add(Path.of("configuration.yaml")); + paths.add(Path.of("configuration.yml")); paths.add(Path.of("config.yaml")); paths.add(Path.of("config.yml")); paths.add(Path.of("cfg.yaml"));