fileManager.fileExists new discovery

Ask questions, discuss ideas, get answers
Post Reply
Diamondback
Posts: 589
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

fileManager.fileExists new discovery

Post by Diamondback »

The fileManager.fileExists command allows you to check if any file located in your main BF1942 directory and its subfolders exists or not.

Recently I found that this command can also be used to check for file types as well. This is done by using an asterix, followed by the file extension, as the argument. Example below:

Code: Select all

fileManager.fileExists *.rfa
This will check for the existence of files with the RFA extension. If at least one file with that extension exists, the command returns True. I've tested this in the Debugger as well as in a local BF1942 server.

This command could be useful to verify if a client is not running illegal files (cheats). You can modify the code to check if the main directory and any folder in it contains illegal DLLs or EXEs:

Code: Select all

fileManager.fileExists *.dll
fileManager.fileExists *.exe
Combined with conditional statements, one can then create a basic file checking script to block unallowed files.
See my Strasbourg map project here.
Post Reply