The EOS plugin provides a method of automating EAC installation as part of the build process for Windows, Mac and Linux platforms. First, some additional configuration is required.
- Enable EAC modules for your desired platforms and activate client protection.
- Make sure the Anti-Cheat interface is enabled in your client policy.
- Download your EAC integrity keys. Make sure to store your private key in a secure manner, as making it public will allow players to bypass client protection.
- Open your Unity project with the plugin installed.
- Open the editor preferences settings for the plugin, which is avaiable in
Tools -> EOS Plugin -> Configuration
. All EAC options are located under the Tools subheader. - Enable EAC build steps by checking the
Use EAC
toggle. - Set
Path to EAC private key
andPath to EAC Certificate
to the private and public keys you previously downloaded, respectively. - (Recommended) Set
Path to EAC splash image
to a 800x450 PNG that will display in the EAC bootstrapper. - (Optional)
- If you want to customize the config for the EAC integrity tool, you can copy the default config from
Packages/Epic Online Services Plugin for Unity/Editor/Standalone/anticheat_integritytool.cfg
to your desired location, customize it, and setPath to EAC Integrity Tool Config
to the new file. See Epic's documentation for more information. - If you've downloaded the integrity tool yourself and want to use that, the path can be set via
Path to EAC Integrity Tool
.
- If you want to customize the config for the EAC integrity tool, you can copy the default config from
If the integrity tool was configured incorrectly, the Anti-Cheat interface should print a warning message after EOS initialization.
If you would like to test the functionality of EAC as it pertains to file integrity, then open the plugin project and follow the steps above. Once you have built the game with Easy Anti Cheat (EAS), build your game and launch the EACBootstrapper.exe
file generated at the root of your build directory.
-
Launch the
EACBootstrapper.exe
file again, and the project should launch.If, when launching with
EACBootstrapper.exe
you get a message akin to the following:Then open an elevated (Administrator) terminal window within the
EasyAntiCheat
directory at the root of your build directory, and type the following command:.\EasyAntiCheat_EOS_Setup.exe install prod-fn
-
Once the game (or our sample project) has launched successfully and fully, close the application.
-
Navigate to a file that will have been hashed and covered by EAC. If using the included project replete with Sample Scenes, you could modify any of the files within the Demo_Data directory (for example you could add a property to the JSON file
EOS Unity Plugin - Demo_Data\StreamingAssets\EOS\EpicOnlineServicesConfig.json
) like so: -
After saving changes made to that file, launch the sample scene "Lobbies," and look at the log. You should see an error logged there indicating that the file integrity of that modified file has been violated.
Note
The "Lobbies" sample scene was selected to implement an example of EAC file integrity testing because lobbies themselves have some additional EAC features connected, so it seemed like a natural place to demonstrate that functionality. The relevant lines of code that trigger the notification of file integrity violation can be found within Assets/Scripts/EOSEACLobbyManager.cs
:
public EOSEACLobbyManager()
{
EOSManager.Instance.SetLogLevel(LogCategory.AntiCheat, LogLevel.Verbose);
LobbyManager = EOSManager.Instance.GetOrCreateManager<EOSLobbyManager>();
AntiCheatManager = EOSManager.Instance.GetOrCreateManager<EOSAntiCheatClientManager>();
CurrentLobbyPeers = new HashSet<ProductUserId>();
OutgoingMessageCounters = new Dictionary<ProductUserId, int>();
IncomingMessageCounters = new Dictionary<ProductUserId, int>();
if (AntiCheatManager.IsAntiCheatAvailable())
{
LobbyManager.AddNotifyLobbyChange(OnLobbyChanged);
LobbyManager.AddNotifyLobbyUpdate(OnLobbyUpdated);
LobbyManager.AddNotifyMemberUpdateReceived(OnMemberUpdated);
AntiCheatManager.AddNotifyToMessageToPeer(OnMessageToPeer);
AntiCheatManager.AddNotifyPeerActionRequired(OnPeerActionRequired);
AntiCheatManager.AddNotifyClientIntegrityViolated(OnClientIntegrityViolated);
}
}
/// <summary>
/// Called when the integrity of the client has been violated according to EAC
/// </summary>
/// <param name="data"></param>
private void OnClientIntegrityViolated(ref OnClientIntegrityViolatedCallbackInfo data)
{
Debug.LogError("EAC Client Integrity Violeted!");
}