mirror of
https://github.com/barronwaffles/dwc_network_server_emulator.git
synced 2026-08-20 17:45:23 -05:00
Fix some small exceptions that sometimes occur
Mostly harmless
This commit is contained in:
@@ -283,7 +283,11 @@ class Gamestats(LineReceiver):
|
||||
data = ""
|
||||
keys = data_parsed['keys'].split('\x01')
|
||||
|
||||
profile_data = gs_query.parse_gamespy_message("\\prof\\" + profile['data'] + "\\final\\")
|
||||
profile_data = None
|
||||
|
||||
if 'data' in profile:
|
||||
profile_data = gs_query.parse_gamespy_message("\\prof\\" + profile['data'] + "\\final\\")
|
||||
|
||||
if profile_data != None:
|
||||
profile_data = profile_data[0][0]
|
||||
|
||||
|
||||
@@ -80,22 +80,23 @@ class NintendoNasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||
ret["returncd"] = "007"
|
||||
ret["statusdata"] = "Y"
|
||||
authtoken = self.server.db.generate_authtoken(post["userid"], post)
|
||||
|
||||
if post["svc"] == "9000" or post["svc"] == "9001": # DLC host = 9000
|
||||
ret["svchost"] = self.headers['host'] # in case the client's DNS isn't redirecting dls1.nintendowifi.net
|
||||
|
||||
# Brawl has 2 host headers which Apache chokes on, so only return the first one or else it won't work
|
||||
cindex = ret["svchost"].find(',')
|
||||
if cindex != -1:
|
||||
ret["svchost"] = ret["svchost"][:cindex]
|
||||
if 'svc' in post:
|
||||
if post["svc"] == "9000" or post["svc"] == "9001": # DLC host = 9000
|
||||
ret["svchost"] = self.headers['host'] # in case the client's DNS isn't redirecting dls1.nintendowifi.net
|
||||
|
||||
if post["svc"] == 9000:
|
||||
ret["token"] = authtoken
|
||||
else:
|
||||
# Brawl has 2 host headers which Apache chokes on, so only return the first one or else it won't work
|
||||
cindex = ret["svchost"].find(',')
|
||||
if cindex != -1:
|
||||
ret["svchost"] = ret["svchost"][:cindex]
|
||||
|
||||
if post["svc"] == 9000:
|
||||
ret["token"] = authtoken
|
||||
else:
|
||||
ret["servicetoken"] = authtoken
|
||||
elif post["svc"] == "0000": # Pokemon requests this for some things
|
||||
ret["servicetoken"] = authtoken
|
||||
elif post["svc"] == "0000": # Pokemon requests this for some things
|
||||
ret["servicetoken"] = authtoken
|
||||
ret["svchost"] = "n/a"
|
||||
ret["svchost"] = "n/a"
|
||||
|
||||
logger.log(logging.DEBUG, "svcloc response to %s", self.client_address)
|
||||
logger.log(logging.DEBUG, ret)
|
||||
|
||||
Reference in New Issue
Block a user