Skip to content

Commit

Permalink
shift plando pickle hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvris committed Oct 13, 2024
1 parent f2ac937 commit 0c96b6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")

Expand Down

0 comments on commit 0c96b6a

Please sign in to comment.