diff --git a/nintendo_nas_server.py b/nintendo_nas_server.py index 043dbc3..77ae260 100644 --- a/nintendo_nas_server.py +++ b/nintendo_nas_server.py @@ -70,6 +70,15 @@ class NintendoNasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler): logger.log(logging.DEBUG, ret) self.wfile.write(self.dict_to_str(ret)) + + elif action == "SVCLOC": + ret["returncd"] = "007" + ret["statusdata"] = "Y" + ret["svchost"] = "dls1.nintendowifi.net" + + logger.log(logging.DEBUG, "SVCLOC response to %s", self.client_address) + logger.log(logging.DEBUG, ret) + self.wfile.write(self.dict_to_str(ret)) elif action == "SVCLOC" or action == "svcloc": # Get service based on service id number if post["svc"] == "9000": # DLC host = 9000 @@ -115,6 +124,10 @@ class NintendoNasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler): if os.path.exists(dlcpath): count = len(os.listdir(dlcpath)) + + # the above counts the file list as a file too, subtract that again if it exists + if os.path.isfile(dlcpath + "/_list.txt"): + count -= 1 ret = "%d" % count