From: DeaDDooMER Date: Thu, 7 Nov 2019 14:57:23 +0000 (+0300) Subject: do not save/receive absolute paths in saves/network X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=a9242ada9520415f028a0bfd983c04ad13857abd;p=d2df-sdl.git do not save/receive absolute paths in saves/network --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 63fc317..1e518ce 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -4693,7 +4693,7 @@ begin //if newResPath = '' then begin //g_Game_SetLoadingText(_lc[I_LOAD_DL_RES], 0, False); - newResPath := g_Res_DownloadMapWAD(WadName, gWADHash); + newResPath := g_Res_DownloadMapWAD(ExtractFileName(WadName), gWADHash); if newResPath = '' then begin g_FatalError(_lc[I_NET_ERR_HASH]); diff --git a/src/game/g_net.pas b/src/game/g_net.pas index 2e00600..74de6ec 100644 --- a/src/game/g_net.pas +++ b/src/game/g_net.pas @@ -681,7 +681,7 @@ begin // packet type trans_omsg.Write(Byte(NTF_SERVER_MAP_INFO)); // map wad name - trans_omsg.Write(gGameSettings.WAD); + trans_omsg.Write(ExtractFileName(gGameSettings.WAD)); // map wad md5 trans_omsg.Write(md5); // map wad size diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 484f8bb..52e7ae6 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -825,18 +825,14 @@ begin end; procedure MH_SEND_Info(ID: Byte); -var - Map: string; begin - Map := g_ExtractFileName(gMapInfo.Map); - NetOut.Clear(); NetOut.Write(Byte(NET_MSG_INFO)); NetOut.Write(ID); NetOut.Write(NetClients[ID].Player); - NetOut.Write(gGameSettings.WAD); - NetOut.Write(Map); + NetOut.Write(ExtractFileName(gGameSettings.WAD)); + NetOut.Write(g_ExtractFileName(gMapInfo.Map)); NetOut.Write(gWADHash); NetOut.Write(gGameSettings.GameMode); NetOut.Write(gGameSettings.GoalLimit); diff --git a/src/game/g_saveload.pas b/src/game/g_saveload.pas index 09f5076..80fcbfc 100644 --- a/src/game/g_saveload.pas +++ b/src/game/g_saveload.pas @@ -180,7 +180,7 @@ begin //if (Length(gCurrentMapFileName) <> 0) then e_LogWritefln('SAVE: current map is ''%s''...', [gCurrentMapFileName]); utils.writeStr(st, gCurrentMapFileName); // Ïóòü ê êàðòå - utils.writeStr(st, gGameSettings.WAD); + utils.writeStr(st, ExtractFileName(gGameSettings.WAD)); // Èìÿ êàðòû utils.writeStr(st, g_ExtractFileName(gMapInfo.Map)); // Êîëè÷åñòâî èãðîêîâ