index 0bc531b481d3d18d9c4bd4a153ada3eac0130b2e..04048b693c983c558af1c61168f3948eee2c5823 100644 (file)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation, version 3 of the License ONLY.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
implementation
-uses g_language, sfs, utils, wadreader;
+uses g_language, sfs, utils, wadreader, g_game;
const DOWNLOAD_DIR = 'downloads';
SetLength(mapData.ExternalResources, 0);
g_Console_Add(Format(_lc[I_NET_MAP_DL], [FileName]));
e_WriteLog('Downloading map `' + FileName + '` from server', TMsgType.Notify);
+ g_Game_SetLoadingText(FileName + '...', 0, False);
MC_SEND_MapRequest();
msgStream := g_Net_Wait_Event(NET_MSG_MAP_RESPONSE);
begin
mapData := MapDataFromMsgStream(msgStream);
msgStream.Free;
- end;
+ end else
+ mapData.FileSize := 0;
for i := 0 to High(mapData.ExternalResources) do
begin
[mapData.ExternalResources[i].Name]));
e_WriteLog('Downloading Wad `' + mapData.ExternalResources[i].Name +
'` from server', TMsgType.Notify);
+ g_Game_SetLoadingText(mapData.ExternalResources[i].Name + '...', 0, False);
MC_SEND_ResRequest(mapData.ExternalResources[i].Name);
msgStream := g_Net_Wait_Event(NET_MSG_RES_RESPONSE);
+ if msgStream = nil then
+ continue;
+
resData := ResDataFromMsgStream(msgStream);
resStream := createDiskFile(GameDir+'/wads/'+mapData.ExternalResources[i].Name);
end;
Result := SaveWAD(MapsDir, ExtractFileName(FileName), mapData.FileData);
+ if mapData.FileSize = 0 then
+ DeleteFile(Result);
end;
end.