From e0aeb2ac2139e540d7290b376c7d03588c1e75cc Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Tue, 14 Nov 2023 22:08:09 -0500 Subject: [PATCH] sao: fix temp responses --- titles/sao/base.py | 4 ++-- titles/sao/index.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/titles/sao/base.py b/titles/sao/base.py index 24a3c2a..f6bb449 100644 --- a/titles/sao/base.py +++ b/titles/sao/base.py @@ -944,7 +944,7 @@ class SaoBase: def handle_d5fe(self, header: SaoRequestHeader, request: bytes) -> bytes: # master_data/get_m_gasha_medal_shop_items - return SaoNoopResponse(header.cmd + 1) + return SaoNoopResponse(header.cmd + 1).make() def handle_d604(self, header: SaoRequestHeader, request: bytes) -> bytes: # master_data_2/get_m_res_earn_campaign_shops @@ -970,4 +970,4 @@ class SaoBase: def handle_d606(self, header: SaoRequestHeader, request: bytes) -> bytes: # master_data_2/get_m_res_earn_campaign_shop_items - return SaoNoopResponse(header.cmd + 1) \ No newline at end of file + return SaoNoopResponse(header.cmd + 1).make() \ No newline at end of file diff --git a/titles/sao/index.py b/titles/sao/index.py index be7c3cf..a6ca141 100644 --- a/titles/sao/index.py +++ b/titles/sao/index.py @@ -119,6 +119,12 @@ class SaoServlet(BaseServlet): self.logger.info(f"{endpoint} - {cmd_str} request") self.logger.debug(f"Request: {req_raw.hex()}") resp = handler(req_header, req_data) + + if resp is None: + resp = SaoNoopResponse(req_header.cmd + 1).make() + + elif issubclass(resp, SaoBaseResponse): + resp = resp.make() self.logger.debug(f"Response: {resp.hex()}")