Added svcloc to NAS

This commit is contained in:
polaris
2014-05-14 07:32:03 -04:00
committed by Admiral H. Curtiss
parent 359f4eb3e8
commit ed38b0c823

View File

@@ -80,6 +80,21 @@ class NintendoNasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
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
ret["returncd"] = "007"
ret["statusdata"] = "Y"
ret["svchost"] = "dls1.nintendowifi.net"
authtoken = self.server.db.generate_authtoken(post["userid"], post)
ret["token"] = authtoken
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 self.path == "/pr":
length = int(self.headers['content-length'])
post = self.str_to_dict(self.rfile.read(length))
@@ -100,7 +115,6 @@ class NintendoNasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
action = post["action"]
# TODO: Cache all DLC information in a database instead of querying the folder.
ret = ""
dlcpath = "dlc/" + post["gamecd"]
dlc_contenttype = False