Open ghost opened 5 years ago
The engine explicitly checks if there is more than one dot, so this is probably intentional behavior but not to block files with more than one dot, rather to prevent it from matching the wrong part of a filename to an extension.
The function IsSafeFileToDownload
should check what the filename ends with. The function COM_LastFileExtension
should do fine for this, just remember that this function returns everything after the dot, not including the dot.
Separate logic will be needed for the cases that check for complete filenames (e.g. halflife.wad
).
This does not have how to be removed from IsSafeFileToDownload, is for client security can not receive files with. (dot), otherwise anyone can throw files on the player outside the game goldsrc (/../../)
A separate check already exists for that:
if ( !Q_strstr(lwrfilename, "\\")
&& !Q_strstr(lwrfilename, ":")
&& !Q_strstr(lwrfilename, "..")
&& !Q_strstr(lwrfilename, "~")
&& lwrfilename[0] != '/' )
{
yes , and why not a fast download and implementation in Netchan_CreateFileFragments
As it comes to Netchan_CreateFileFragments
that allows downloading files during the game (without PF_Precache _*
) (the client supports the download during the game with the exceptions from IsSafeFileToDownload. Cfg. bat. dll etc..)
There is a restrictive for downloading files during the game in SV_BeginFileDownload_f
, which is very good
If the client allows the download during the game, why not use the Netchan_CreateFileFragments
function in the server (at that I did not think so far, anyway it is a good idea to do in a module)
If required content has a dot (
.
) in their name, the engine will classify them as an invalid file type and prevent the download, even if they're legitimate.As a result, upon joining the client will crash due to missing models.
Tested on Earth's Special Forces 1.2.3 and Half-Life under Proton.