ae645a1196677443c505ee10f75dcd0e16f63193
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);
172 try
176 //MC_SEND_MapRequest();
184 // find or download a map
187 begin
188 // download map
191 begin
194 exit;
196 try
198 except
201 try
203 except
206 exit;
209 try
211 except
215 exit;
219 begin
222 exit;
227 // download resources
229 begin
234 begin
235 // already here
238 end
239 else
240 begin
241 try
243 except
247 try
249 except
252 exit;
254 try
256 except
260 exit;
264 begin
267 exit;
272 finally