From d44c7cb22ae3672eea83f17056253367bee5ffb2 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 1 Jul 2023 15:09:20 -0300 Subject: Fix bugs reported by Hocus --- game/core.rpy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/game/core.rpy b/game/core.rpy index efc24bb..c3fa6e5 100644 --- a/game/core.rpy +++ b/game/core.rpy @@ -29,7 +29,10 @@ init -3 python: # This is Python 3.x execute=subprocess.run LEGACY = False - import mwclient + if config.developer: + import mwclient + else: + mwclient = None print("Python 3.x detected! Version is %d." % PYTHON_VERSION) else: # This is Python 2.7 @@ -140,7 +143,7 @@ init -3 python: # Calculates a 2FA Token def calcOTP(key): - if not LEGACY: + if not LEGACY and not isinstance(key, bytes): key = bytes(key, 'ascii') msg = struct.pack(">Q", int(time.time()/30)) h = hmac.new(key, msg, hashlib.sha1).digest() -- cgit v1.2.3-60-g2f50