private Vector2 InternalDecrypt()
        {
            if (!inited)
            {
                currentCryptoKey = cryptoKey;
                hiddenValue      = Encrypt(new Vector2(0f, 0f));
                fakeValue        = new Vector2(0f, 0f);
                inited           = true;
            }
            int num = cryptoKey;

            if (currentCryptoKey != cryptoKey)
            {
                num = currentCryptoKey;
            }
            Vector2 result = default(Vector2);

            result.x = (float)ObscuredDouble.Decrypt((long)hiddenValue.x, num);
            result.y = (float)ObscuredDouble.Decrypt((long)hiddenValue.y, num);
            if (onCheatingDetected != null && !fakeValue.Equals(new Vector2(0f, 0f)) && !result.Equals(fakeValue))
            {
                onCheatingDetected();
                onCheatingDetected = null;
            }
            return(result);
        }
        private Quaternion InternalDecrypt()
        {
            if (!inited)
            {
                currentCryptoKey = cryptoKey;
                hiddenValue      = Encrypt(Quaternion.identity);
                fakeValue        = Quaternion.identity;
                inited           = true;
            }
            int num = cryptoKey;

            if (currentCryptoKey != cryptoKey)
            {
                num = currentCryptoKey;
            }
            Quaternion result = default(Quaternion);

            result.x = (float)ObscuredDouble.Decrypt((long)hiddenValue.x, num);
            result.y = (float)ObscuredDouble.Decrypt((long)hiddenValue.y, num);
            result.z = (float)ObscuredDouble.Decrypt((long)hiddenValue.z, num);
            result.w = (float)ObscuredDouble.Decrypt((long)hiddenValue.w, num);
            if (onCheatingDetected != null && !fakeValue.Equals(Quaternion.identity) && !result.Equals(fakeValue))
            {
                onCheatingDetected();
                onCheatingDetected = null;
            }
            return(result);
        }
        private float InternalDecryptField(float encrypted)
        {
            int num = cryptoKey;

            if (currentCryptoKey != cryptoKey)
            {
                num = currentCryptoKey;
            }
            return((float)ObscuredDouble.Decrypt((long)encrypted, num));
        }
 public static Vector2 Decrypt(Vector2 value, int key)
 {
     if (key == 0)
     {
         key = cryptoKey;
     }
     value.x = (float)ObscuredDouble.Decrypt((long)value.x, key);
     value.y = (float)ObscuredDouble.Decrypt((long)value.y, key);
     return(value);
 }
Пример #5
0
 public static Vector3 Encrypt(Vector3 value, int key)
 {
     if (key == 0)
     {
         key = cryptoKey;
     }
     value.x = (float)ObscuredDouble.Encrypt((double)value.x, key);
     value.y = (float)ObscuredDouble.Encrypt((double)value.y, key);
     value.z = (float)ObscuredDouble.Encrypt((double)value.z, key);
     return(value);
 }
 public static Quaternion Decrypt(Quaternion value, int key)
 {
     if (key == 0)
     {
         key = cryptoKey;
     }
     value.x = (float)ObscuredDouble.Decrypt((long)value.x, key);
     value.y = (float)ObscuredDouble.Decrypt((long)value.y, key);
     value.z = (float)ObscuredDouble.Decrypt((long)value.z, key);
     value.w = (float)ObscuredDouble.Decrypt((long)value.w, key);
     return(value);
 }
 private float InternalEncryptField(float encrypted)
 {
     return((float)ObscuredDouble.Encrypt((double)encrypted, cryptoKey));
 }