summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d1e9c82)
raw | patch | inline | side by side (parent: d1e9c82)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Mon, 18 Apr 2016 07:28:30 +0000 (10:28 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Mon, 18 Apr 2016 07:28:30 +0000 (10:28 +0300) |
also, use `findFileCI()` from "utils.pas" to find correct disk path/filename.
those calls will automatically do case-insensitive search on POSIX systems.
those calls will automatically do case-insensitive search on POSIX systems.
src/game/g_netmsg.pas | patch | blob | history | |
src/game/g_res_downloader.pas | patch | blob | history |
diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index 44135d789b46439e6216fdd08c879d2d2b66298e..9df97c1c1a39a33341cea5e18dc1b812dba9211f 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
Math, ENet, e_input, e_fixedbuffer, e_graphics, e_log,
g_textures, g_gfx, g_sound, g_console, g_basic, g_options, g_main,
g_game, g_player, g_map, g_panel, g_items, g_weapons, g_phys, g_gui,
- g_language, g_monsters, g_netmaster, sfs,
- wadreader, MAPDEF;
+ g_language, g_monsters, g_netmaster, utils, wadreader, MAPDEF;
const
NET_KEY_LEFT = 1;
function ReadFile(const FileName: TFileName): AByte;
var
- FileStream : TFileStream;
+ FileStream : TStream;
fname: string;
begin
e_WriteLog(Format('NETWORK: looking for file "%s"', [FileName]), MSG_NOTIFY);
end;
e_WriteLog(Format('NETWORK: found file "%s"', [fname]), MSG_NOTIFY);
Result := nil;
- FileStream:= TFileStream.Create(fname, fmOpenRead or {fmShareDenyWrite}fmShareDenyNone);
+ FileStream := openDiskFileRO(fname);
try
if FileStream.Size > 0 then
begin
index cd0a3608617ea588d29fe6c6187bb8fadfdde913..77db011c0c546aa9358fba72bf7b3cccfb0a4257 100644 (file)
function SaveWAD(const path, filename: string; const data: array of Byte): string;
var
- resFile: TFileStream;
+ resFile: TStream;
+ dpt: string;
begin
try
- Result := path + DOWNLOAD_DIR + '/' + filename;
- if not DirectoryExists(path + DOWNLOAD_DIR) then
- begin
- CreateDir(path + DOWNLOAD_DIR);
- end;
- resFile := TFileStream.Create(Result, fmCreate);
+ result := path+DOWNLOAD_DIR+'/'+filename;
+ dpt := path+DOWNLOAD_DIR;
+ if not findFileCI(dpt, true) then CreateDir(dpt);
+ resFile := createDiskFile(result);
resFile.WriteBuffer(data[0], Length(data));
resFile.Free
except
function g_Res_DownloadWAD(const FileName: string): string;
var
msgStream: TMemoryStream;
- resStream: TFileStream;
+ resStream: TStream;
mapData: TMapDataMsg;
i: Integer;
resData: TResDataMsg;
msgStream := g_Net_Wait_Event(NET_MSG_RES_RESPONSE);
resData := ResDataFromMsgStream(msgStream);
- resStream := TFileStream.Create(GameDir+'/wads/'+
- mapData.ExternalResources[i].Name,
- fmCreate);
+ resStream := createDiskFile(GameDir+'/wads/'+mapData.ExternalResources[i].Name);
resStream.WriteBuffer(resData.FileData[0], resData.FileSize);
resData.FileData := nil;