Browse Source

Timings - Move online-mode check

pull/9/head
DrBot7 4 years ago
committed by GitHub
parent
commit
ec3ff6d1a5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      cogs/timings.py

30
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"])

Loading…
Cancel
Save