This PR cleans up the code in timings.py and migrates most of the timings checks into a yaml file. The goal is to make it easier to set up analysis for timings, while also keeping the code clean. Still have a few options to add to the yaml file, but I felt it was at a good point to PR.
version
determines what minecraft version to check to make sure the timings report is on the latest version of minecraft.
servers
checks what server is being used (through the server jar version) from top to bottom. In the current yml file, it checks to see if the server jar is yatopia. If the server jar is not yatopia, then it iterates and checks if the server jar is paper, etc.
servers:
- name: "yatopia"
prefix: "❌ "
value: |-
Yatopia is prone to bugs.
Consider using [Purpur](https://ci.pl3x.net/job/Purpur/).
- name: "paper" # the name of the server jar
prefix: "||❌ " # the prefix to use before the field name
suffix: "||" # the suffix to use after the field name
value: |- # the value which is used as the field value
||Purpur has more optimizations but is generally less supported.
Consider using [Purpur](https://ci.pl3x.net/job/Purpur/).||
plugins
is where all the plugin checks are stored. plugins are nested based on the server jar ( this is checked through the config file). Using expressions
you can have different fields pop up depending on different values
plugins:
paper: # checks for the `paper.yml` config to see if the following plugins should be added
ClearLag: # name of the plugin (used in field name) aka a dictionary
prefix: "⚠ " # prefix to use for the field name (suffix option can be added)
value: |- # field value
Plugins that claim to remove lag actually cause more lag.
Remove ClearLag.
PhantomSMP: # a list of expressions
- expressions: # inside the expressions option there are a list of expressions. Each expression is checked from top to bottom, compared using AND
- paper["world-settings"]["default"]["phantoms-only-attack-insomniacs"] == "false" # basically an if statement in the form of a string
prefix: "⚠ "
value: |-
You probably don't need PhantomSMP as Paper already has its features.
Remove PhantomSMP.
- expressions: # if the earlier expression fails, then the next one will be checked
- paper["world-settings"]["default"]["phantoms-only-attack-insomniacs"] == "true"
prefix: "⚠ "
value: |-
You probably don't need PhantomSMP as Paper already has its features.
Enable phantoms-only-attack-insomniacs in [paper.yml](http://bit.ly/paperconf).
purpur:
SilkSpawners:
prefix: "⚠ "
value: |-
You probably don't need SilkSpawners as Purpur already has its features.
Remove SilkSpawners.
config
is where all the config checks are stored. the options are nested based on what config they come from, but they don't necessarily need to be from that config. They follow the same concept and logic as the plugins
option.
config:
server.properties: # the config file the option is based on (options don't rely on this, this is mostly just for organizational purposes)
online-mode: # the option name
- expressions: # inside the expressions option there are a list of expressions. Each expression is checked from top to bottom, compared using AND
- not server_properties["online-mode"] # if online-mode in server_properties is false, AND
- spigot["settings"]["bungeecord"] == "false" # bungeecord is false, AND
- paper["settings"]["velocity-support"]["online-mode"] == "false" or paper["settings"]["velocity-support"]["enabled"] == "false" # velocity-support.online-mode is false OR velocity-support.enabled is false THEN
prefix: "❌ " # use this prefix
value: "Enable this in [server.properties](http://bit.ly/servprop) for security." #use this value
network-compression-threshold:
- expressions: # if at least one of these expressions fails, try the next pair of expressions
- int(server_properties["network-compression-threshold"]) <= 256
- spigot["settings"]["bungeecord"] == "false"
prefix: "❌ "
value: "Increase this in [server.properties](http://bit.ly/servprop). Recommended: 512."
- expressions: # if all these expressions are true
- int(server_properties["network-compression-threshold"]) != -1
- spigot["settings"]["bungeecord"] == "true"
prefix: "❌ " # use this prefix
value: "Set this to -1 in [server.properties](http://bit.ly/servprop) for a bungee server like yours." # and use this value