1 (* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *)
15 {$INCLUDE ../shared/a_modes.inc}
18 interface
22 function g_Res_SearchSameWAD(const path, filename: AnsiString; const resMd5: TMD5Digest): AnsiString;
24 // download map wad from server (if necessary)
25 // download all required map resource wads too
26 // returns name of the map wad (relative to mapdir), or empty string on error
29 // call this before downloading a new map from a server
31 // returns original name, or replacement name
36 implementation
40 //const DOWNLOAD_DIR = 'downloads';
42 var
46 // call this before downloading a new map from a server
48 begin
54 // returns original name, or replacement name
56 var
58 begin
66 begin
73 function scanDir (dirName: AnsiString; baseName: AnsiString; const resMd5: TMD5Digest): AnsiString;
74 var
80 begin
87 // scan files
89 try
90 repeat
92 begin
94 begin
97 begin
101 begin
105 exit;
109 end
110 else
111 begin
113 begin
120 finally
124 // scan subdirs
126 begin
135 function g_Res_SearchResWad (asMap: Boolean; fname: AnsiString; const resMd5: TMD5Digest): AnsiString;
136 begin
138 //if not assigned(scannedDirs) then scannedDirs := THashStrInt.Create();
140 begin
142 end
143 else
144 begin
150 function g_Res_SearchSameWAD (const path, filename: AnsiString; const resMd5: TMD5Digest): AnsiString;
151 begin
157 var
164 begin
165 //SetLength(mapData.ExternalResources, 0);
170 try
172 except
175 try
177 except
182 try
186 //MC_SEND_MapRequest();
194 // find or download a map
197 begin
198 // download map
201 begin
204 exit;
207 try
209 except
212 exit;
215 try
217 except
221 exit;
225 begin
228 exit;
233 // download resources
235 begin
240 begin
241 // already here
244 end
245 else
246 begin
249 try
251 except
254 exit;
256 try
258 except
262 exit;
266 begin
269 exit;
274 finally