Guide for New Anti-Cheat Features
Last Update: 15/06/2023 21:08:45
# Introduction The file-hash anti-cheat is a feature in scripts 4.0 that checks sensitive files on the client to make sure they have not been tampered with. When a client running 4.0 loads a file, it sends a secure hash to the server. If the file-hash anti-cheat has been enabled (by setting AntiCheatEnabled=true in server.ini), the server then checks it against its approved list. If its not on the list, the server kicks the player with a message informing them which file caused the anti-cheat to reject them. Any files in the server data folder are considered "approved" as are files listed in anticheat.ini. Below is an example anticheat.ini with six allowed files. Note that multiple hashes are allowed for always.dat. ``` [HashList] 8307d2031ade3e81cc04c98559c5ebda=C&C_Canyon.mix ab312d439efd99480c77fa98a864d197=always.dat fbf9a79282c636e685196256943ce025=always.dbs d36d8b57f2919c12688355179542ed96=hud_sniper.dds 352af7c3b9673ae59ba5ff430a6c036c=stealth_effect.dds 1c7f389c011f5b19e2283a776b4d3337=always.dat 14738e4f675fa11d7a5f8396c09d4c22=M01.mix ``` In this example, the anticheat.ini allows clients to use one of two versions of always.dat and the other five files. In addition, all files that the server uses are allowed to be used by the client. To generate custom hashes for anticheat.ini, you should open a command prompt in your server directory and run achash.exe <path>, where <path> is the path to the file you wish to hash. It will then generate the hash of the file and the entry that can be inserted into anticheat.ini. If you prefer, you can also copy achash.exe and memorymanager.exe to a different location, for example the location in which you store the files you want to hash, or call it from a different location. A default anticheat.ini containing hashes of all the necessary files from the different language versions of Renegade has been included with the server download and should be used as a base for anyone running a Renegade server. # Files that are checked by the anti-cheat The following files are always checked if they exist on the client: - mix files (including always.dat, always.dbs and map mix files) - tt.ini - scopes.cfg - reticles.cfg - sniper scope textures (standard hud_sniper texture and custom scope textures) - stealth_effect texture - shader database (shaders.shd file) - custom shaders (source and binary) - w3d files - cameras.ini - surfaceeffects.ini - objects.ddb Additionally, the following files are checked for each map, where "mapname" is replaced with the actual name of the map for the current game: - mapname.ddb - mapname.lsd - mapname.ldd - mapname.shd Note that these files may be contained in mapname.mix. If you run a custom version of a map on the server and expect clients with the unmodified map to join, you may have to hash the files inside the unmodified mapname.mix and add them to your anticheat.ini too. # Allow certain files with the anticheat enabled Create a file called `acallow.ini` in the Server DATA directory. In this file add the following for each file you wish to allow: ``` [AllowList] stealth_effect.dds=0 skinfile.dds=0 wavfile.wav=0 ``` Every file listed here will then be allowed to be customized by players. Note that this effectively disables the anti cheat features for this file and that cheating might be possible then. Use at your own risk.