diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 251f413a..e0bba6bf 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1095,6 +1095,7 @@ typedef enum CL_SEARCHING, CL_DOWNLOADFILES, CL_ASKJOIN, + CL_LOADFILES, CL_WAITJOINRESPONSE, #ifdef JOININGAME CL_DOWNLOADSAVEGAME, @@ -1202,7 +1203,10 @@ static inline void CL_DrawConnectionStatus(void) break; #endif case CL_ASKFULLFILELIST: - cltext = M_GetText("This server has a LOT of files!"); + cltext = M_GetText("This server has a LOT of addons!"); + break; + case CL_LOADFILES: + cltext = M_GetText("Loading server addons..."); break; case CL_ASKJOIN: case CL_WAITJOINRESPONSE: @@ -1933,7 +1937,7 @@ static boolean CL_FinishedFileList(void) return false; } else if (i == 1) - cl_mode = CL_ASKJOIN; + cl_mode = CL_LOADFILES; else { // must download something @@ -2143,7 +2147,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic } if (!curl_transfers) - cl_mode = CL_ASKJOIN; // don't break case continue to cljoin request now + cl_mode = CL_LOADFILES; // don't break case continue to cljoin request now break; #endif @@ -2159,11 +2163,12 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic if (waitmore) break; // exit the case - cl_mode = CL_ASKJOIN; // don't break case continue to cljoin request now - /* FALLTHRU */ - + cl_mode = CL_LOADFILES; // don't break case continue to cljoin request now + break; + case CL_LOADFILES: + if (!CL_LoadServerFiles()) + break; case CL_ASKJOIN: - CL_LoadServerFiles(); #ifdef JOININGAME // prepare structures to save the file // WARNING: this can be useless in case of server not in GS_LEVEL diff --git a/src/d_netfil.c b/src/d_netfil.c index 821d2a5b..f65959dc 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -457,7 +457,7 @@ INT32 CL_CheckFiles(void) } // Load it now -void CL_LoadServerFiles(void) +boolean CL_LoadServerFiles(void) { INT32 i; @@ -473,6 +473,7 @@ void CL_LoadServerFiles(void) P_AddWadFile(fileneeded[i].filename); G_SetGameModified(true, false); fileneeded[i].status = FS_OPEN; + return false; } else if (fileneeded[i].status == FS_MD5SUMBAD) I_Error("Wrong version of file %s", fileneeded[i].filename); @@ -498,6 +499,7 @@ void CL_LoadServerFiles(void) fileneeded[i].status, s); } } + return true; } // Number of files to send diff --git a/src/d_netfil.h b/src/d_netfil.h index f37df371..3bc2d0d3 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -65,7 +65,7 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr, UINT16 fi void CL_PrepareDownloadSaveGame(const char *tmpsave); INT32 CL_CheckFiles(void); -void CL_LoadServerFiles(void); +boolean CL_LoadServerFiles(void); void SV_SendRam(INT32 node, void *data, size_t size, freemethod_t freemethod, UINT8 fileid);