mirror of
https://github.com/barronwaffles/dwc_network_server_emulator.git
synced 2026-09-30 05:47:30 -05:00
Fixes #129.
This commit is contained in:
@@ -239,17 +239,18 @@ class NasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||
# Look for a list file first.
|
||||
# If the list file exists, send the entire thing back to the client.
|
||||
if os.path.isfile(os.path.join(dlcpath, "_list.txt")):
|
||||
ret = self.filter_list(safeloadfi("_list.txt"), attr1, attr2, attr3, num, offset)
|
||||
|
||||
# Don't try to filter any further if the list is empty.
|
||||
if ret.strip() != "":
|
||||
# this is super game-specific, but we need to handle gen 5 mystery gifts properly somehow
|
||||
if post["gamecd"].startswith("IRA") and attr1.startswith("MYSTERY"):
|
||||
ret = self.filter_list_g5_mystery_gift(ret, post["rhgamecd"])
|
||||
ret = self.filter_list_by_date(ret, post["token"])
|
||||
|
||||
if post["gamecd"] in gamecodes_return_random_file:
|
||||
ret = self.filter_list_by_date(ret, post["token"])
|
||||
if post["gamecd"].startswith("IRA") and attr1.startswith("MYSTERY"):
|
||||
# Pokemon BW Mystery Gifts, until we have a better solution for that
|
||||
ret = self.filter_list(safeloadfi("_list.txt"), attr1, attr2, attr3)
|
||||
ret = self.filter_list_g5_mystery_gift(ret, post["rhgamecd"])
|
||||
ret = self.filter_list_by_date(ret, post["token"])
|
||||
elif post["gamecd"] in gamecodes_return_random_file:
|
||||
# Pokemon Gen 4 Mystery Gifts, same here
|
||||
ret = self.filter_list(safeloadfi("_list.txt"), attr1, attr2, attr3)
|
||||
ret = self.filter_list_by_date(ret, post["token"])
|
||||
else:
|
||||
# default case for most games
|
||||
ret = self.filter_list(safeloadfi("_list.txt"), attr1, attr2, attr3, num, offset)
|
||||
|
||||
if action == "contents":
|
||||
# Get only the base filename just in case there is a path involved somewhere in the filename string.
|
||||
|
||||
Reference in New Issue
Block a user