private bool FileAllowedFromDirectory(string path)
{
if((path.EndsWith(".cfg") == true) // for config files.
|| (path.EndsWith(".dat") == true) // for journal files.
|| (path.EndsWith(".dll") == true) // dynamic modules are handled a different way for pure.
|| (path.EndsWith(".scriptcfg") == true)) // configuration script, such as map cycle.
{
// TODO
/*#if ID_PURE_ALLOWDDS
|| !strcmp( path + l - 4, ".dds" )
#endif*/
// note: cd and xp keys, as well as config.spec are opened through an explicit OS path and don't hit this
return true;
}
// savegames
if((path.StartsWith("savegames") == true) && ((path.EndsWith(".tga") == true) || (path.EndsWith(".txt") == true) || (path.EndsWith(".save") == true)))
{
return true;
}
// screen shots
if((path.StartsWith("screenshots") == true) && (path.EndsWith(".tga") == true))
{
return true;
}
// objective tgas
if((path.StartsWith("maps/game") == true) && (path.EndsWith(".tga") == true))
{
return true;
}
// splash screens extracted from addons
if((path.StartsWith("guis/assets/splash/addon") == true) && (path.EndsWith(".tga") == true))
{
return true;
}
return false;
}
#endregion