Anti-Cheat Toolkit  2024.0.0
Multi-purpose anti-cheat solution for Unity Engine
ObscuredFileReadResult Struct Reference

Public Member Functions

override string ToString ()
 

Properties

bool Success [get]
 
byte[] Data [get]
 
bool CheatingDetected [get]
 
bool DataIsNotGenuine [get]
 
bool DataFromAnotherDevice [get]
 
ObscuredFileError Error [get]
 
bool IsValid [get]
 

Detailed Description

Contains ObscuredFile read operation results.

Member Function Documentation

◆ ToString()

override string ToString ( )
inline

Returns contents of this operation result.

Returns
Human-readable operation result.

Property Documentation

◆ Success

bool Success
get

Returns true in case Data is not null and Error's ErrorCode is ObscuredFileErrorCode.NoError, returns false otherwise.

NOTE: it will be false if data is not genuine or was loaded from another device even if Data itself was read successfully and not null. Listen to the NotGenuineDataDetected and DataFromAnotherDeviceDetected events (at ObscuredFile or ObscuredFilePrefs) or check CheatingDetected, DataIsNotGenuine and DataFromAnotherDevice properties explicitly to react on the possible cheating.

◆ Data

byte [] Data
get

Contains read bytes. Will be null if data was damaged, file does not exists or device lock feature prevented data read.

◆ CheatingDetected

bool CheatingDetected
get

Indicates either DataIsNotGenuine or DataFromAnotherDevice is true.

◆ DataIsNotGenuine

bool DataIsNotGenuine
get

Returns true if saved data has correct header but signature does not matches file contents. Returns false otherwise.

◆ DataFromAnotherDevice

bool DataFromAnotherDevice
get

Returns true if device lock feature detected data from another device.

◆ Error

ObscuredFileError Error
get

Contains specific error in case Success is not true but IsValid is true.

◆ IsValid

bool IsValid
get

Returns true if this struct was filled with actual data, otherwise will stay false.