public void RandomizeCryptoKey() { Quaternion quaternion = this.InternalDecrypt(); this.currentCryptoKey = Random.get_seed(); this.hiddenValue = ObscuredQuaternion.Encrypt(quaternion, this.currentCryptoKey); }
public void ApplyNewCryptoKey() { if (this.currentCryptoKey != ObscuredQuaternion.cryptoKey) { this.hiddenValue = ObscuredQuaternion.Encrypt(this.InternalDecrypt(), ObscuredQuaternion.cryptoKey); this.currentCryptoKey = ObscuredQuaternion.cryptoKey; } }
private Quaternion InternalDecrypt() { if (!this.inited) { this.currentCryptoKey = ObscuredQuaternion.cryptoKey; this.hiddenValue = ObscuredQuaternion.Encrypt(ObscuredQuaternion.initialFakeValue); this.fakeValue = ObscuredQuaternion.initialFakeValue; this.inited = true; } Quaternion quaternion; quaternion.x = ObscuredFloat.Decrypt(this.hiddenValue.x, this.currentCryptoKey); quaternion.y = ObscuredFloat.Decrypt(this.hiddenValue.y, this.currentCryptoKey); quaternion.z = ObscuredFloat.Decrypt(this.hiddenValue.z, this.currentCryptoKey); quaternion.w = ObscuredFloat.Decrypt(this.hiddenValue.w, this.currentCryptoKey); if (ObscuredCheatingDetector.IsRunning && !this.fakeValue.Equals(ObscuredQuaternion.initialFakeValue) && !this.CompareQuaternionsWithTolerance(quaternion, this.fakeValue)) { ObscuredCheatingDetector.Instance.OnCheatingDetected(); } return quaternion; }
private Quaternion InternalDecrypt() { if (!this.inited) { this.currentCryptoKey = ObscuredQuaternion.cryptoKey; this.hiddenValue = ObscuredQuaternion.Encrypt(ObscuredQuaternion.initialFakeValue); this.fakeValue = ObscuredQuaternion.initialFakeValue; this.inited = true; } Quaternion q1; q1.x = (__Null)(double)ObscuredFloat.Decrypt(this.hiddenValue.x, this.currentCryptoKey); q1.y = (__Null)(double)ObscuredFloat.Decrypt(this.hiddenValue.y, this.currentCryptoKey); q1.z = (__Null)(double)ObscuredFloat.Decrypt(this.hiddenValue.z, this.currentCryptoKey); q1.w = (__Null)(double)ObscuredFloat.Decrypt(this.hiddenValue.w, this.currentCryptoKey); // ISSUE: explicit reference operation if (ObscuredCheatingDetector.IsRunning && !((Quaternion)@this.fakeValue).Equals((object)ObscuredQuaternion.initialFakeValue) && !this.CompareQuaternionsWithTolerance(q1, this.fakeValue)) { ObscuredCheatingDetector.Instance.OnCheatingDetected(); } return(q1); }
public static ObscuredQuaternion.RawEncryptedQuaternion Encrypt(Quaternion value) { return(ObscuredQuaternion.Encrypt(value, 0)); }
public void RandomizeCryptoKey() { Quaternion value = this.InternalDecrypt(); this.currentCryptoKey = UnityEngine.Random.Range(-2147483648, 2147483647); this.hiddenValue = ObscuredQuaternion.Encrypt(value, this.currentCryptoKey); }