Anti-Cheat Toolkit
2024.0.0
Multi-purpose anti-cheat solution for Unity Engine
|
Inherits IEquatable< ObscuredQuaternion >, IEquatable< Quaternion >, and IObscuredType.
Classes | |
struct | RawEncryptedQuaternion |
Public Member Functions | |
ObscuredQuaternion (float x, float y, float z, float w) | |
RawEncryptedQuaternion | GetEncrypted (out int key) |
void | SetEncrypted (RawEncryptedQuaternion encrypted, int key) |
Quaternion | GetDecrypted () |
void | RandomizeCryptoKey () |
Static Public Member Functions | |
static RawEncryptedQuaternion | Encrypt (Quaternion value, int key) |
static RawEncryptedQuaternion | Encrypt (float x, float y, float z, float w, int key) |
static Quaternion | Decrypt (RawEncryptedQuaternion value, int key) |
static ObscuredQuaternion | FromEncrypted (RawEncryptedQuaternion encrypted, int key) |
static int | GenerateKey () |
Use it instead of regular Quaternion
for any cheating-sensitive variables.
WARNING: Doesn't mimic regular type API, thus should be used with extra caution. Cast it to regular, not obscured type to work with regular APIs.
Regular type is faster and memory wiser comparing to the obscured one!
Feel free to use regular types for all short-term operations and calculations while keeping obscured type only at the long-term declaration (i.e. class field).
|
inline |
Mimics constructor of regular Quaternion. Please note, passed components are not Euler Angles.
x | X component of the quaternion |
y | Y component of the quaternion |
z | Z component of the quaternion |
w | W component of the quaternion |
|
inlinestatic |
Encrypts passed value using passed key.
Key can be generated automatically using GenerateKey().
|
inlinestatic |
Encrypts passed components using passed key. Please note, passed components are not an Euler Angles.
Key can be generated automatically using GenerateKey().
|
inlinestatic |
|
inlinestatic |
Creates and fills obscured variable with raw encrypted value previously got from GetEncrypted().
Literally does same job as SetEncrypted() but makes new instance instead of filling existing one, making it easier to initialize new variables from saved encrypted values.
encrypted | Raw encrypted value you got from GetEncrypted(). |
key | Encryption key you've got from GetEncrypted(). |
|
inlinestatic |
|
inline |
Allows to pick current obscured value as is.
key | Encryption key needed to decrypt returned value. |
Use it in conjunction with SetEncrypted().
Useful for saving data in obscured state.
|
inline |
Allows to explicitly set current obscured value. Crypto key should be same as when encrypted value was got with GetEncrypted().
Use it in conjunction with GetEncrypted().
Useful for loading data stored in obscured state.
|
inline |
Alternative to the type cast, use if you wish to get decrypted value but can't or don't want to use cast to the regular type.
|
inline |
Allows to change current crypto key to the new random value and re-encrypt variable using it. Use it for extra protection against 'unknown value' search. Just call it sometimes when your variable doesn't change to fool the cheater.
Implements IObscuredType.