From ec3ff6d1a536057eb9cfe2bfde843d13c2c09d8c Mon Sep 17 00:00:00 2001 From: DrBot7 <46543473+DrBot7@users.noreply.github.com> Date: Wed, 13 Jan 2021 05:21:44 -0600 Subject: [PATCH] Timings - Move online-mode check --- cogs/timings.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/cogs/timings.py b/cogs/timings.py index 0192c98..df619ed 100644 --- a/cogs/timings.py +++ b/cogs/timings.py @@ -74,21 +74,6 @@ class Timings(commands.Cog): embed_var.add_field(name="❌ Invalid Configuration", value="At least one of your configuration files had an invalid data type.") - try: - online_mode = r1["timingsMaster"]["onlinemode"] - bungeecord = r1["timingsMaster"]["config"]["spigot"]["settings"]["bungeecord"] - velocity_online_mode = r1["timingsMaster"]["config"]["paper"]["settings"]["velocity-support"]["online-mode"] - velocity_enabled = r1["timingsMaster"]["config"]["paper"]["settings"]["velocity-support"]["enabled"] - - if not online_mode and bungeecord == "false" and (velocity_online_mode == "false" or velocity_enabled == "false"): - embed_var.add_field(name="❌ online-mode", - value="Enable this in [server.properties](http://bit.ly/servprop) for security.") - except KeyError: - unchecked = unchecked + 1 - except: - embed_var.add_field(name="❌ Invalid Configuration", - value="At least one of your configuration files had an invalid data type.") - try: timing_cost = int(r1["timingsMaster"]["system"]["timingcost"]) if timing_cost > 300: @@ -335,6 +320,21 @@ class Timings(commands.Cog): embed_var.add_field(name="❌ Invalid Configuration", value="At least one of your configuration files had an invalid data type.") + try: + online_mode = r1["timingsMaster"]["onlinemode"] + bungeecord = r1["timingsMaster"]["config"]["spigot"]["settings"]["bungeecord"] + velocity_online_mode = r1["timingsMaster"]["config"]["paper"]["settings"]["velocity-support"]["online-mode"] + velocity_enabled = r1["timingsMaster"]["config"]["paper"]["settings"]["velocity-support"]["enabled"] + + if not online_mode and bungeecord == "false" and (velocity_online_mode == "false" or velocity_enabled == "false"): + embed_var.add_field(name="❌ online-mode", + value="Enable this in [server.properties](http://bit.ly/servprop) for security.") + except KeyError: + unchecked = unchecked + 1 + except: + embed_var.add_field(name="❌ Invalid Configuration", + value="At least one of your configuration files had an invalid data type.") + try: network_compression_threshold = int( r1["timingsMaster"]["config"]["server.properties"]["network-compression-threshold"])