Protected Primitives
Important data such as positions or health status are usually stored in the runtime memory, which can be vulnerable to manipulation by cheat tools or data sniffers. Encryption is essential to protect against unauthorised changes. The use of AntiCheats protected fields provides a straightforward solution that allows developers to protect their application's runtime data and prevent cheat attempts.
How to use
Implementation is seamless - simply replace the regular types with the protected ones and continue with normal read, write and calculation processes.
//UInt
ProtectedUInt16 a = 1234;
ProtectedUInt32 b = 5678;
ProtectedUInt64 c = 91011;
//Int
ProtectedInt16 d = 123;
ProtectedInt32 e = 5678;
ProtectedInt64 f = 91011;
//Float
ProtectedFloat g = 1234.123f;
//Double
ProtectedDouble h = 1234.123d;
//String
ProtectedString i = "My Protected Text";
//Vector
ProtectedVector2 j = new Vector2(1,2);
ProtectedVector2Int j2 = new Vector2Int(1,2);
ProtectedVector3 k = new Vector3(1, 2, 3);
ProtectedVector3Int k2 = new Vector3Int(1, 2, 3);
ProtectedVector4 l = new Vector4(1, 2, 3, 4);
ProtectedVector4Int l2 = new Vector4Int(1, 2, 3);
//Quaternion
ProtectedQuaternion m = new Quaternion(1, 2, 3, 4);
//Bool
ProtectedBool n = false;
//Decimal
ProtectedDecimal o = 12312.534m;
//DateTime
ProtectedDateTime p = System.DateTime.Now;
To react to recognised cheating attempts, the 'PrimitiveCheatingDetector' is simply connected to the 'AntiCheat-Monitor'. Protected fields within the detector recognise cheating attempts by trapping them in a honeypot. Each time a protected field is accessed for reading or writing, the detector is notified so that further action can be taken accordingly.
Drag and drop the prefab to the anti cheat monitor in your scene.
Custom Observer
If you would like to write a custom listener to the detector, you can attach an observer:
// Get the detector from the anti cheat monitor.
var detector = AntiCheatMonitor.Instance
.GetDetector<PrimitiveCheatingDetector>();
// Subscribe as observer and get notified on cheating.
detector.Subscribe(myObserver);