From 0c96b6a7e629103e2b7e84793fcddafee223a678 Mon Sep 17 00:00:00 2001 From: Silvris <58583688+Silvris@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:52:53 -0500 Subject: [PATCH] shift plando pickle hack --- Utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Utils.py b/Utils.py index d6709431d32c..91eea33d97b7 100644 --- a/Utils.py +++ b/Utils.py @@ -423,7 +423,7 @@ def find_class(self, module: str, name: str) -> type: if module == "NetUtils" and name in {"NetworkItem", "ClientStatus", "Hint", "SlotType", "NetworkSlot"}: return getattr(self.net_utils_module, name) # Options and Plando are unpickled by WebHost -> Generate - if module == "worlds.generic" and name in {"PlandoItem", "PlandoConnection"}: + if module == "worlds.generic" and name == "PlandoItem": if not self.generic_properties_module: self.generic_properties_module = importlib.import_module("worlds.generic") return getattr(self.generic_properties_module, name) @@ -436,6 +436,8 @@ def find_class(self, module: str, name: str) -> type: obj = getattr(mod, name) if issubclass(obj, self.options_module.Option): return obj + elif issubclass(obj, self.options_module.PlandoConnection): + return obj # Forbid everything else. raise pickle.UnpicklingError(f"global '{module}.{name}' is forbidden")