Compatible with DayZ Epoch 1.0.7 +
You need a program to reload your bans.txt file so that all bans written by the AH will take immediate effect. This can be done with BEC by adding the following line to your config file:
AutoLoadBans = True
It should look something like this:
Copy the antihack folder into your dayz_server folder.
In \z\addons\dayz_server\init\server_functions.sqf:
Find:
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
Below it, add:
#include "\z\addons\dayz_server\antihack\antihack.sqf"
Remove the following line:
#include "mission_check.sqf"
In \z\addons\dayz_server\system\scheduler\sched_sync.sqf:
Find:
// Date format [Year,Month,Day of the month,Hour,Minute]
Below it, add:
if (!isNil "AH_timeOverride") exitWith {objNull};
Copy the antihack.hpp file into the root of your mission folder.
In description.ext:
Find:
#include "\z\addons\dayz_code\Configs\CfgServerTrader\CfgServerTrader.hpp"
Below it, add:
#include "antihack.hpp"
In configVariables.sqf:
Find:
dayz_antihack = 1;
Change it to:
dayz_antihack = 0;
Note: dayz_REsec
can remain at its default value of 1 (this is also recommended)
Find this line in your init.sqf file (replace chernarus11 with your map name if you are using a different map):
call compile preprocessFileLineNumbers "\z\addons\dayz_code\system\mission\server_traders\chernarus11.sqf";
Cut and paste it below this line:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\system\mission\chernarus11.sqf";
Copy the Antihack.dll, Antihack.ini, and Newtonsoft.Json.dll files into your server's root folder.
Adjust the settings in the Antihack.ini file to fit your server.
Keep in mind the following:
antihack\Admin.log
will send the log file to a folder called "antihack" in your server's root.C:\antihack\Admin.log
will send the log file to a folder called "antihack" in your C drive.Adjust the _missionFiles
array in your config.sqf to fit your server. There is a tool included that will automatically generate the list of files in your mission.
To use the tool (named KFC_Array_Builder.exe
):
Example:
BattlEye:
Add the following to the end of the first line in publicvariable.txt:
!AHPV_
I have also provided the modified publicvariable.txt file as an example (copied from Epoch repository with the above added to the end of the first line)
Due to time constraints in maintaining accurate scripts.txt filters and the work that it creates when modifying the antihack, no other BattlEye filters are provided. Please be sure to copy BE filters from the DayZ Epoch repository and modify them following known community examples.
This antihack is designed to aid in server administration and provide insight as to the activities of players. It is by no means a solution to all hacking issues, and is intentionally light weight.
Without properly configured BattlEye filters, your server will still be vulnerable to attack, and this antihack will not aid in such situations.
Admins are defined in the following format:
[Name (can be a single string or an array of names) - can be empty to allow admin client on any name, UID (string), Hide from Lower Ranks (bool), Disable Logging (bool), Allow Execution on Dialog (bool), Player Name (or test account name) - only useful if Name field is empty]
Examples:
Name of the admin must be "BigEgg" in order to use powers. Admin is hidden from lower ranks in menu, is not logged, and has access to the code execution box on the menu.
["BigEgg", "76561198115492831", true, true, true, ""]
Name of the admin must be either "BigEgg", "FatEgg", or "TwinkieDestroyer" in order to use powers. Admin is not hidden from lower ranks in the menu, is logged, but has access to the code execution box on the menu.
[["BigEgg", "FatEgg", "TwinkieDestroyer"], "76561198115492831", false, false, true, ""]
Name of the admin can be anything. Admin powers are not given if name is BillyBob. Admin is not hidden from lower ranks in the menu, is logged, but has access to the code execution box on the menu.
["", "76561198115492831", false, false, true, "BillyBob"]
Setting | Description | |
---|---|---|
_menuKey | Key that will open the menu | |
_mod | List of moderators following the above configuration formats | |
_admin | List of admins following the above configuration formats | |
_headAdmin | List of head admins following the above configuration formats | |
_owner | List of owners following the above configuration formats | |
_diag_prefix | This prefix will appear before all diag_log messages on all clients and the server | |
_rptall | If true, all logs will be sent to the rpt as well as their respective designations | |
_headless | List UIDs of headless clients here. They will be sent no client code and global code will be terminated | |
_apj | If true, announces when a player has connected or disconnected in systemChat | |
_bvc | If true, will delete any vehicles not in server traders or the whitelist below | |
_wai | If true, enables compatibility with Wicked AI (https://github.com/f3cuk/WICKED-AI) | |
_vehWhiteList | Add any additional vehicles that shouldn't be deleted here (special mission vehicles etc...). Only used if _bvc = true | |
_voteplayers | Number of players that must be online before a vote can be held | |
_votedelay | Amount of time (in seconds) to wait between day/night votes | |
_votetime | Amount of time to wait before cancelling a vote due to lack of majority | |
_votepercent | Percentage of the server population that must vote before a decision is reached (0-1) | |
_chat_prefix | This prefix will appear before all systemChat messages on clients | |
_viewDistance | Default view distance. This will only be set on login (set to -1 to disable) | |
_grassLevel | Default grass level. Options are: 3.125 (Highest performance hit), 6.25, 12.5, 25 (multiplayer default), and 50 (No grass). This will only be set on login (set to -1 to disable) | |
_bfs | If true, scans the client's game directory for the files listed in _badFiles below | |
_bvs | If true, checks for bad variables listed in _badVars below | |
_oef | If true, makes sure that onEachFrame isn't modified (esp scripts sometimes use this) | |
_bdc | If true, checks for bad displays listed in _badDisplays | |
_bsc | If true, makes sure the player isn't wearing a forbidden skin listed in _badSkins | |
_upc | If true, prevents urban prone actions near plot poles | |
_mic | If true, checks the integrity of the mission file. If a file is modified, the player is banned | |
_bwc | If true, makes sure the player doesn't have an illegal weapon listed in _badWeapons | |
_mev | Depricated 1.0.7 | |
_sev | If true, switches client to 3rd person automatically upon login | |
_badDisplays | List of bad displays (displays that should be restricted on normal clients like the admin menu etc...) | |
_badSkins | List of forbidden skins | |
_badWeapons | List of illegal weapons | |
_discord | This will be displayed when a player types !discord or /discord in chat. Leave empty to disable | |
_teamspeak | This will be displayed when a player types !teamspeak or /teamspeak in chat. Leave empty to disable | |
_website | This will be displayed when a player types !website or /website in chat. Leave empty to disable | |
_chatcmds | List of chat scripts players can use (currently "day/night" and "suicide" are the only possible commands | |
_chatbanned | List of UIDs that are banned from chatting in any channel | |
_debug | Determines if debug monitor will be used (true = enabled | false = disabled) |
_dkey | Key used to activate / deactivate debug monitor | |
_drestart | Restart time in minutes (will be used to calculate time till restart on debug monitor) | |
_dtext | This text will appear at the bottom of the debug monitor | |
_safezones | If true, enables safe zones | |
_bubbles | If true, marks safe zone boundaries with bubbles | |
_antized | If true, deletes zombies that walk into the safe zone | |
_antiai | If true, deletes AI that walk into the safe zone | |
_antitheft | If true, prevents theft of vehicles and gear in the safe zones | |
_speedLimit | If greater than 0, speed of vehicles in the safe zone will be limited to this number | |
_timer | If greater than 0, safe zone protection will remain in affect for this number of seconds after leaving | |
_disableWeps | If true, makes the player drop any weapon listed in _dropWeps while in safe zone | |
_dropWeps | Will remove these weapons from the player if they try to select them in a safe zone | |
_escTopT | Text at the top of the escape menu | |
_escTopC | Color of the text at the top of the escape menu | |
_escMidT | Text in the middle of the escape menu | |
_escLUPT | Lower-upper text of the escape menu | |
_escLUPC | Color of the lower-upper text of the escape menu | |
_escLBOT | Lower-bottom text of the escape menu | |
_escLBOC | Color of the lower-bottom text of the escape menu | |
_loadouts | List of defined loadouts that will appear in target menus if configured (by default, only Owner and Head Admin ranks will see) | |
_starterBox | Items in the starter build box | |
_smallBox | Items in the small build box | |
_mediumBox | Items in the medium build box | |
_largeBox | Items in the large build box | |
_starterSafe | Items in the starter build safe | |
_smallSafe | Items in the small build safe | |
_mediumSafe | Items in the medium build safe | |
_largeSafe | Items in the large build safe | |
_missionFiles | List of files within your mission. Antihack will make sure that none have been changed. | |
_badChat | List of chat commands that will be logged in surveillance log | |
_badFiles | List of bad files that will be scanned for in client game directories | |
_badVars | List of bad files to be checked for |
There are some useful features included in the menu:
admin_limitLists
enabled.private
arrays and converted to more efficient local _var
.dayz_antihack
.server_traders
variable.