DEADSOFTWARE

do not save/receive absolute paths in saves/network
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Thu, 7 Nov 2019 14:57:23 +0000 (17:57 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Thu, 7 Nov 2019 14:57:23 +0000 (17:57 +0300)
src/game/g_game.pas
src/game/g_net.pas
src/game/g_netmsg.pas
src/game/g_saveload.pas

index 63fc317b1a3718b5258c9cd0cd3a566f45e03a6b..1e518ce8b4e2b0aed7d561d4d3c755e9abf13546 100644 (file)
@@ -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]);
index 2e00600ae3ffea0f7dc03ddbe2655724718bba28..74de6ec26d76f08cd8004763828bfd4550709018 100644 (file)
@@ -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
index 484f8bb2d0641fd8e131b552a50f92bf6df82eda..52e7ae64e0fa0d563a40b52ca1e1fb076e9b89b3 100644 (file)
@@ -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);
index 09f5076c9b919fc95d9f96a09f672f20193bc24b..80fcbfc50dfd6520c42267454f7dce596895b309 100644 (file)
@@ -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));
       // Êîëè÷åñòâî èãðîêîâ