diff --git a/entrypoint.sh b/entrypoint.sh index aa95ca8..b059b22 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,5 @@ #!/bin/bash +cd "$(dirname "$0")" if [[ -z "${CFG_DEV}" ]]; then echo Production mode diff --git a/titles/cxb/base.py b/titles/cxb/base.py index 89e9cc3..4a92ca6 100644 --- a/titles/cxb/base.py +++ b/titles/cxb/base.py @@ -530,7 +530,6 @@ class CxbBase: profile = self.data.profile.get_profile_index(0, uid, self.version) data1 = profile["data"] p = self.data.item.get_energy(uid) - energy = p["energy"] if not p: self.data.item.put_energy(uid, 5) @@ -543,6 +542,7 @@ class CxbBase: } array = [] + energy = p["energy"] newenergy = int(energy) + 5 self.data.item.put_energy(uid, newenergy) diff --git a/titles/cxb/index.py b/titles/cxb/index.py index 0ef8667..4011537 100644 --- a/titles/cxb/index.py +++ b/titles/cxb/index.py @@ -103,7 +103,7 @@ class CxbServlet(resource.Resource): else: self.logger.info(f"Ready on port {self.game_cfg.server.port}") - def render_POST(self, request: Request, version: int, endpoint: str): + def render_POST(self, request: Request): version = 0 internal_ver = 0 func_to_find = "" @@ -111,7 +111,10 @@ class CxbServlet(resource.Resource): subcmd = "" req_url = request.uri.decode() url_split = req_url.split("/") - req_bytes = request.content.getvalue() + try: + req_bytes = request.content.getvalue() + except: + req_bytes = request.content.read().decode("utf-8") try: req_json: Dict = json.loads(req_bytes)