diff --git a/CHANGELOG.md b/CHANGELOG.md index b3a1cc88..76e569e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,16 @@ # Changelog -## --- [4.1.4] - 2023/TBD +## --- [4.2.0] - 2023/TBD ### New features TBD ### Bug fixes - PWA: Removed the custom offline page in favour of browser default ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/607)) - Fix hidden servers appearing visible on public mobile status page ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/612)) +- Correctly handle if a server returns a string instead of json data on socket ping ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/614)) +### Refactor +TBD ### Tweaks - Polish/Enhance display for InApp Documentation ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/613)) +- Add get_users command to Crafty's console ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/620)) ### Lang TBD

diff --git a/app/classes/minecraft/mc_ping.py b/app/classes/minecraft/mc_ping.py index 51fcaa2c..c5cb9916 100644 --- a/app/classes/minecraft/mc_ping.py +++ b/app/classes/minecraft/mc_ping.py @@ -16,6 +16,12 @@ logger = logging.getLogger(__name__) class Server: def __init__(self, data): + if isinstance(data, str): + logger.error( + "Failed to calculate stats. Expected object. " + f"Server returned string: {data}" + ) + return self.description = data.get("description") # print(self.description) if isinstance(self.description, dict): diff --git a/app/classes/shared/command.py b/app/classes/shared/command.py index 26fdd2f0..cebe76b7 100644 --- a/app/classes/shared/command.py +++ b/app/classes/shared/command.py @@ -92,6 +92,9 @@ class MainPrompt(cmd.Cmd): self.controller.users.update_user(user_id, {"password": new_pass}) + def do_get_users(self, _line): + Console.info(self.controller.users.get_all_usernames()) + @staticmethod def do_threads(_line): for thread in threading.enumerate():