From 9b6a3d5482a59f859f0087aa74f5681d2cb24101 Mon Sep 17 00:00:00 2001 From: GermaniumSystem Date: Fri, 28 Jun 2019 01:43:14 -0400 Subject: [PATCH] Remove species whitelist The unknown species crash was fixed on 19-06-26, exactly 3 years after the initial bug report was opened. The fix has since gone from 1.4.3 unstable beta 2 to 1.4.3 stable. There's even a (relatively) user-friendly error message now. --- plugins/species_whitelist.py | 56 ------------------------------------ 1 file changed, 56 deletions(-) delete mode 100644 plugins/species_whitelist.py diff --git a/plugins/species_whitelist.py b/plugins/species_whitelist.py deleted file mode 100644 index 6805169..0000000 --- a/plugins/species_whitelist.py +++ /dev/null @@ -1,56 +0,0 @@ -""" -StarryPy species whitelist plugin - -Prevents players with unknown species from joining the server. -This is necessary due to a year+ old "bug" detailed here: -https://community.playstarbound.com/threads/119569/ - -Original Authors: GermaniumSystem -""" - -from base_plugin import BasePlugin -from data_parser import ConnectFailure -from packets import packets -from pparser import build_packet - - - -class SpeciesWhitelist(BasePlugin): - name = "species_whitelist" - depends = ["player_manager"] - default_config = {"enabled": False, - "allowed_species": [ - "apex", - "avian", - "glitch", - "floran", - "human", - "hylotl", - "penguin", - "novakid" - ]} - - - def activate(self): - super().activate() - self.enabled = self.config.get_plugin_config(self.name)["enabled"] - self.allowed_species = self.config.get_plugin_config(self.name)["allowed_species"] - - - def on_client_connect(self, data, connection): - if not self.enabled: - return True - species = data['parsed']['species'] - if species not in self.allowed_species: - self.logger.warn("Aborting connection - player's species ({}) " - "is not in whitelist.".format(species)) - rejection_packet = build_packet(packets['connect_failure'], - ConnectFailure.build(dict(reason="^red;Connection " - "aborted!\n\n^orange;Your species ({}) is not " - "allowed on this server.\n^green;Please use a " - "different character.".format(species)))) - yield from connection.raw_write(rejection_packet) - connection.die() - return False - return True -