From fbe9a7659d615a00428f7b7c6e4e450fb2698ce7 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 28 Feb 2022 22:57:16 -0500 Subject: [PATCH] Few updates to MC bedrock ping --- app/classes/minecraft/stats.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/classes/minecraft/stats.py b/app/classes/minecraft/stats.py index 895ebf37..d203957d 100644 --- a/app/classes/minecraft/stats.py +++ b/app/classes/minecraft/stats.py @@ -170,16 +170,17 @@ class Stats: except Exception as e: server_icon = False logger.info(f"Unable to read the server icon : {e}") - + print('in raw stats') ping_data = { 'online': ping_obj['server_player_count'], 'max': ping_obj['server_player_max'], - 'players': online_stats.get('players', 0), + 'players': 0, 'server_description': ping_obj['server_edition'], 'server_version': ping_obj['server_version_name'], 'server_icon': server_icon } + return ping_data def get_server_players(self, server_id): @@ -359,7 +360,7 @@ class Stats: server_icon = False logger.info(f"Unable to read the server icon : {e}") - + print(ping_data) server_stats = { 'id': server_id, @@ -372,16 +373,16 @@ class Stats: 'world_size': self.get_world_size(world_path), 'server_port': server_port, 'int_ping_results': int_data, - 'online': ping_data['server_player_count'], - 'max': ping_data['server_player_max'], + 'online': ping_data['online'], + 'max': ping_data['max'], 'players': 0, - 'server_description': ping_data['server_edition'], - 'server_version': ping_data['server_version_name'], + 'server_description': ping_data['server_description'], + 'server_version': ping_data['server_version'], 'server_icon': server_icon } else: server_stats = { - 'id': server_id, + 'id': server_id, 'started': server_obj.get_start_time(), 'running': server_obj.check_running(), 'cpu': p_stats.get('cpu_usage', 0),