private Vector2 InternalDecrypt() { if (!inited) { currentCryptoKey = cryptoKey; hiddenValue = Encrypt(zero); fakeValue = zero; fakeValueActive = false; inited = true; return(zero); } Vector2 value; value.x = TSFloat.Decrypt(hiddenValue.x, currentCryptoKey); value.y = TSFloat.Decrypt(hiddenValue.y, currentCryptoKey); if (ObscuredCheatingDetector.ExistsAndIsRunning && fakeValueActive && !CompareVectorsWithTolerance(value, fakeValue)) { ObscuredCheatingDetector.Instance.OnCheatingDetected(); } return(value); }
private Quaternion InternalDecrypt() { if (!inited) { currentCryptoKey = cryptoKey; hiddenValue = Encrypt(identity); fakeValue = identity; fakeValueActive = false; inited = true; return(identity); } Quaternion value; value.x = TSFloat.Decrypt(hiddenValue.x, currentCryptoKey); value.y = TSFloat.Decrypt(hiddenValue.y, currentCryptoKey); value.z = TSFloat.Decrypt(hiddenValue.z, currentCryptoKey); value.w = TSFloat.Decrypt(hiddenValue.w, currentCryptoKey); if (ObscuredCheatingDetector.ExistsAndIsRunning && fakeValueActive && !CompareQuaternionsWithTolerance(value, fakeValue)) { ObscuredCheatingDetector.Instance.OnCheatingDetected(); } return(value); }
private float InternalDecryptField(int encrypted) { var key = cryptoKey; if (currentCryptoKey != cryptoKey) { key = currentCryptoKey; } var result = TSFloat.Decrypt(encrypted, key); return(result); }
/// <summary> /// 解密 /// </summary> public static Vector2 Decrypt(EncryptedVector2 value, int key) { if (key == 0) { key = cryptoKey; } Vector2 result; result.x = TSFloat.Decrypt(value.x, key); result.y = TSFloat.Decrypt(value.y, key); return(result); }
/// <summary> /// 简单的对称加密,使用默认的加密密钥。 /// </summary> public static EncryptedVector2 Encrypt(float x, float y, int key) { if (key == 0) { key = cryptoKey; } EncryptedVector2 result; result.x = TSFloat.Encrypt(x, key); result.y = TSFloat.Encrypt(y, key); return(result); }
/// <summary> /// 解密 /// </summary> public static Quaternion Decrypt(EncryptedQuaternion value, int key) { if (key == 0) { key = cryptoKey; } Quaternion result; result.x = TSFloat.Decrypt(value.x, key); result.y = TSFloat.Decrypt(value.y, key); result.z = TSFloat.Decrypt(value.z, key); result.w = TSFloat.Decrypt(value.w, key); return(result); }
/// <summary> /// 简单的对称加密,使用默认的加密密钥。 /// </summary> public static EncryptedQuaternion Encrypt(float x, float y, float z, float w, int key) { if (key == 0) { key = cryptoKey; } EncryptedQuaternion result; result.x = TSFloat.Encrypt(x, key); result.y = TSFloat.Encrypt(y, key); result.z = TSFloat.Encrypt(z, key); result.w = TSFloat.Encrypt(w, key); return(result); }
private int InternalEncryptField(float encrypted) { var result = TSFloat.Encrypt(encrypted, cryptoKey); return(result); }