Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.
/ DF Public archive

Commit

Permalink
Game/Net: Fix client map hash
Browse files Browse the repository at this point in the history
  • Loading branch information
binarymaster committed Jan 8, 2016
1 parent 4242b24 commit d2b0e2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions DF Sources/g_game.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3578,10 +3578,12 @@ function g_Game_StartMap(Map: String; Force: Boolean = False): Boolean;
if Pos(':\', Map) > 0 then
begin
g_ProcessResourceStr(Map, @NewWAD, nil, @ResName);
gWADHash := MD5File(MapsDir + NewWAD);
if g_Game_IsServer then
g_Game_LoadWAD(NewWAD)
else
begin
gWADHash := MD5File(MapsDir + NewWAD);
g_Game_LoadWAD(NewWAD);
end else
// hash recieved in MC_RECV_GameEvent -> NET_EV_MAPSTART
g_Game_ClientWAD(NewWAD, gWADHash);
end else
ResName := Map;
Expand Down
1 change: 1 addition & 0 deletions DF Sources/g_netmsg.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,7 @@ procedure MC_RECV_GameEvent(P: Pointer);
g_Game_ClearLoading();
g_Game_StopAllSounds(True);

gWADHash := EvHash;
if not g_Game_StartMap(EvParm, True) then
begin
if Pos(':\', EvParm) = 0 then
Expand Down
7 changes: 5 additions & 2 deletions DF Sources/g_res_downloader.pas
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ function g_Res_DownloadWAD(const FileName: string): string;
MC_SEND_MapRequest();

msgStream := g_Net_Wait_Event(NET_MSG_MAP_RESPONSE);
mapData := MapDataFromMsgStream(msgStream);
msgStream.Free;
if msgStream <> nil then
begin
mapData := MapDataFromMsgStream(msgStream);
msgStream.Free;
end;

for i := 0 to High(mapData.ExternalResources) do
begin
Expand Down

0 comments on commit d2b0e2f

Please sign in to comment.