mirror of
https://github.com/barronwaffles/dwc_network_server_emulator.git
synced 2026-08-28 13:54:15 -05:00
Updated DLC code to use list file
This commit is contained in:
1
dlc/A5FE/_list.txt
Normal file
1
dlc/A5FE/_list.txt
Normal file
@@ -0,0 +1 @@
|
||||
wifi_encode26.dat MgA2AE9V7l1XMP9mSDA* 116
|
||||
2
dlc/B2KJ/_list.txt
Normal file
2
dlc/B2KJ/_list.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
distribution110609.bin 24
|
||||
tweet111209.bin 2416
|
||||
Binary file not shown.
BIN
dlc/B2KJ/tweet111209.bin
Normal file
BIN
dlc/B2KJ/tweet111209.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
<EFBFBD><><CE8D><EFBFBD>'O<><4F>~>
|
||||
@@ -93,7 +93,7 @@ class NintendoNasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||
|
||||
# TODO: Cache all DLC information in a database instead of querying the folder.
|
||||
ret = ""
|
||||
dlcpath = "dlc/" + post["rhgamecd"]
|
||||
dlcpath = "dlc/" + post["gamecd"]
|
||||
dlc_contenttype = False
|
||||
|
||||
if action == "count":
|
||||
@@ -109,12 +109,10 @@ class NintendoNasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||
offset = int(post["offset"])
|
||||
|
||||
if os.path.exists(dlcpath):
|
||||
filelist = os.listdir(dlcpath)
|
||||
|
||||
if offset + num <= len(filelist):
|
||||
for file in filelist[offset:offset+num]:
|
||||
filesize = os.path.getsize(dlcpath + "/" + file)
|
||||
ret += "%s\t\t\t\t%d\r\n" % (file, filesize)
|
||||
# Look for a list file first.
|
||||
# If the list file exists, send the entire thing back to the client.
|
||||
if os.path.isfile(dlcpath + "/_list.txt"):
|
||||
ret = open(dlcpath + "/_list.txt", "rb").read()
|
||||
|
||||
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