Merge pull request #8 from AdmiralCurtiss/master

Fixes to DLC Server.
This commit is contained in:
polaris-
2014-05-14 08:08:16 -04:00

View File

@@ -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