Rewrite ThingParser usages.

This commit changes how the ThingParser is used throughout the code base. Instead of blindly filtering out null values, we're now throwing a new InvalidThingInputString exception. This exception is caught in an outer scope that has more context. The exception is then unwrapped and rethrown as a ConfigError with the additional context. In the outermost scope of (re)loading the config-file, the ConfigError is caught and printed, and then (re)loading stops gracefully.

We still need a proper way to handle loads/reloads consistently to get rid of the default command usage message, but this is a good step towards better usability in the face of user errors.

Fixes #478
This commit is contained in:
Andreas Troelsen
2018-08-05 23:14:01 +02:00
parent 924a419b47
commit cd82a89626
10 changed files with 238 additions and 140 deletions
+1
View File
@@ -15,6 +15,7 @@ These changes will (most likely) be included in the next version.
- The new per-arena setting `join-interrupt-timer` makes it possible to add a "delay" to the join and spec commands. If the player moves or takes damage during this delay, the command is interrupted. This should help prevent exploits on PvP servers.
- Right-clicking is now allowed in the lobby. This makes it possible to activate blocks like buttons and levers.
- Snow and ice no longer melts in arenas.
- Much of the parsing logic has been rewritten so that MobArena now logs more user-friendly errors when it encounters invalid values in the config-file.
Thanks to:
- PrinceIonia and Nesseley for help with test of dev builds