hypherionmc / hypherionmc/MaintenanceMode

[BUG] Allowed users config field does not work

Open
#12 2 comments 0 reactions 0 assignees View on GitHub
Type: Bug
Dominant language
Java
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
The allowed users setting in the mmode.json config does not seem to be interpreted correctly when the config is reloaded. Either that or it is unknown how to use it (I could not find anything on the docs). It throws an error when the field is populated with any name. Additionally, when the server is rebooted, this config issue causes all `/maintenance` commands to fail.

**To Reproduce**
Steps to reproduce the behavior:
1. Try to populate "allowedUsers" in config.
2. `/maintenance reload`

**Expected behavior**
The mod should update according to the config and allow in users with the names populated in the array.

**Notes**
I think it would be easier to just allow operators into the server during maintenance. This doesn't seem to be a feature currently as I got kicked from my own server and couldn't rejoin when I activated maintenance.

**Versions (DO NOT USE "LATEST"! I STEAL YOUR KNEE CAPS!):**
- Version: 1.20.1, 1.3.1 Universal Jar
- Modloader: Forge 1.20.1-47.4.1
- Java Version: unknown as it is a server

**Crash Report**
```
[09:40:48] [Config-Watcher/INFO] [CraterLib/]: Sending Reload Event for: mmode.json
[09:40:48] [Config-Watcher/ERROR] [CraterLib/]: Config Watcher Error
shadow.hypherionmc.moonconfig.core.conversion.InvalidValueException: Unexpected element of type class java.lang.String for field allowedUsers
at shadow.hypherionmc.moonconfig.core.conversion.ObjectConverter.convertConfigsToObject(ObjectConverter.java:433) ~[CraterLib-Forge-1.20-2.1.5.jar%23268!/:2.1.5] {re:classloading}
at shadow.hypherionmc.moonconfig.core.conversion.ObjectConverter.convertToObject(ObjectConverter.java:286) ~[CraterLib-Forge-1.20-2.1.5.jar%23268!/:2.1.5] {re:classloading}
at shadow.hypherionmc.moonconfig.core.conversion.ObjectConverter.toObject(ObjectConverter.java:99) ~[CraterLib-Forge-1.20-2.1.5.jar%23268!/:2.1.5] {re:classloading}
at com.hypherionmc.craterlib.core.config.formats.JsonConfigFormat.readConfig(JsonConfigFormat.java:33) ~[CraterLib-Forge-1.20-2.1.5.jar%23268!/:2.1.5] {re:classloading}
at com.hypherionmc.craterlib.core.config.AbstractConfig.readConfig(AbstractConfig.java:63) ~[CraterLib-Forge-1.20-2.1.5.jar%23268!/:2.1.5] {re:classloading}
at com.hypherionmc.mmode.config.MaintenanceModeConfig.configReloaded(MaintenanceModeConfig.java:120) ~[MaintenanceMode-Universal-1.3.1.jar%23312!/:1.3.1] {re:classloading}
at com.hypherionmc.craterlib.core.config.ConfigController.lambda$register_config$1(ConfigController.java:52) ~[CraterLib-Forge-1.20-2.1.5.jar%23268!/:2.1.5] {re:classloading}
at shadow.hypherionmc.moonconfig.core.file.FileWatcher$WatcherThread.run(FileWatcher.java:182) ~[CraterLib-Forge-1.20-2.1.5.jar%23268!/:2.1.5] {re:classloading}```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.