Example #1
1
 /// <summary>
 /// Constructor
 /// </summary>
 public QueryResult(int pRows, UInt32 pID)
 {
     Rows = pRows;
     ID = pID;
     Records = new Records();
     _success = true;
 }
Example #2
1
 private static UInt32[] Decrypt(UInt32[] v, UInt32[] k)
 {
     Int32 n = v.Length - 1;
     if (n < 1) {
         return v;
     }
     if (k.Length < 4) {
         UInt32[] Key = new UInt32[4];
         k.CopyTo(Key, 0);
         k = Key;
     }
     UInt32 z = v[n], y = v[0], sum, e;
     Int32 p, q = 6 + 52 / (n + 1);
     unchecked {
         sum = (UInt32)(q * delta);
         while (sum != 0) {
             e = sum >> 2 & 3;
             for (p = n; p > 0; p--) {
                 z = v[p - 1];
                 y = v[p] -= (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
             }
             z = v[n];
             y = v[0] -= (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
             sum -= delta;
         }
     }
     return v;
 }
Example #3
1
        protected StreamContent(Byte[] contentBytes)
        {
            Debug.Assert(contentBytes != null);

            ContentBytes = contentBytes;
            ContentLength = (UInt32)contentBytes.Length;
        }
Example #4
1
        /// <summary>
        /// Creates a new miner instance.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="extraNonce"></param>
        /// <param name="connection"></param>
        /// <param name="pool"></param>
        /// <param name="minerManager"></param>
        /// <param name="storageLayer"></param>
        public StratumMiner(int id, UInt32 extraNonce, IConnection connection, IPool pool, IMinerManager minerManager, IStorageLayer storageLayer)
        {
            Id = id; // the id of the miner.
            ExtraNonce = extraNonce;
            Connection = connection; // the underlying connection.
            Pool = pool;
            _minerManager = minerManager;
            _storageLayer = storageLayer;

            Subscribed = false; // miner has to subscribe.
            Authenticated = false; // miner has to authenticate.

            _logger = Log.ForContext<StratumMiner>().ForContext("Component", pool.Config.Coin.Name);
            _packetLogger = LogManager.PacketLogger.ForContext<StratumMiner>().ForContext("Component", pool.Config.Coin.Name);

            _rpcResultHandler = callback =>
            {
                var asyncData = ((JsonRpcStateAsync)callback); // get the async data.
                var result = asyncData.Result + "\n"; // read the result.
                var response = Encoding.UTF8.GetBytes(result); // set the response.

                Connection.Send(response); // send the response.

                _packetLogger.Verbose("tx: {0}", result.PrettifyJson());
            };
        }
Example #5
1
        public static INode AddNode(this IGraph myIGraph, UInt32 myUInt32Id)
        {
            if (myIGraph == null)
                throw new ArgumentNullException("myIGraph must not be null!");

            return myIGraph.AddNode(myUInt32Id.ToString());
        }
Example #6
1
 /// <summary>
 ///     A class that represents a file within an RAF archive. Creates an entry that only exists in memory.
 /// </summary>
 /// <param name="raf">Pointer to the owning RAFArchive</param>
 /// <param name="fileName">Full path of the file, ie. DATA/Characters/Ahri/Ahri.skn</param>
 /// <param name="offsetDatFile">Offset to the entry data offsets</param>
 /// <param name="fileSize">Length of the file in bytes</param>
 public RAFFileListEntry(RAFArchive raf, string fileName, UInt32 offsetDatFile, UInt32 fileSize)
 {
     m_raf = raf;
     FileName = fileName;
     m_fileOffset = offsetDatFile;
     m_fileSize = fileSize;
 }
Example #7
1
 public BmpReader(string fileName)
 {
     byte[] buffer = System.IO.File.ReadAllBytes(fileName);
     HeaderId = System.Text.Encoding.UTF8.GetString(buffer, 0, 2);
     HeaderFileSize = BitConverter.ToUInt32(buffer, 2);
     OffsetToPixelArray = BitConverter.ToUInt32(buffer, 0xa);
 }
Example #8
1
 public static extern bool WriteFile(
     IntPtr hFile,
     IntPtr lpBuffer,
     UInt32 nNumberOfBytesToWrite,
     out UInt32 lpNumberOfBytesWritten,
     IntPtr lpOverlapped
     );
Example #9
1
 public static extern bool ReadFile(
     IntPtr hFile,
     IntPtr lpBuffer,
     UInt32 nNumberOfBytesToRead,
     out UInt32 lpNumberOfBytesRead,
     IntPtr lpOverlapped
     );
Example #10
1
        public void AddFrame(Bitmap bmp)
        {
            bmp.RotateFlip(RotateFlipType.RotateNoneFlipY);

            BitmapData bmpDat = bmp.LockBits(
                new Rectangle(0, 0, bmp.Width, bmp.Height),
                ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);

            if (countFrames == 0)
            {
                this.stride = (UInt32)bmpDat.Stride;
                this.width = bmp.Width;
                this.height = bmp.Height;
                CreateStream();
            }

            int result = AviReadingMethods.AVIStreamWrite(aviStream,
                countFrames, 1,
                bmpDat.Scan0,
                (Int32)(stride * height),
                0, 0, 0);

            if (result != 0)
            {
                throw new Exception("Problem podczas otwierania pliku AVI" + result.ToString());
            }

            bmp.UnlockBits(bmpDat);
            countFrames++;
        }
Example #11
1
        public static Byte[] bin2CArray(Byte[] inputData, UInt32 memberSizeInBytes)
        {
            StringBuilder cArraySB;
              UInt32 sizeSB = (((UInt32)inputData.Length)/memberSizeInBytes +1) * (memberSizeInBytes*2 + 4) + 30;

              cArraySB = new StringBuilder((Int32)sizeSB);

              switch(memberSizeInBytes)
              {
            case 1:
              bin2charArray(inputData,cArraySB);
              break;
            case 2:
              break;
            case 4:
              bin2uintArray(inputData,cArraySB);
              break;
            case 8:
              break;
            default:
              break;
              }

              return (new ASCIIEncoding()).GetBytes(cArraySB.ToString());
        }
 private static extern Boolean SetupDiEnumDeviceInterfaces(
     IntPtr hDevInfo,
     ref SP_DEVINFO_DATA devInfo,
     ref Guid interfaceClassGuid,
     UInt32 memberIndex,
     ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData
     );
 private static extern Boolean SetupDiEnumDeviceInterfaces(
     IntPtr hDevInfo,
     [MarshalAs(UnmanagedType.AsAny)] Object devInfo,
     ref Guid interfaceClassGuid,
     UInt32 memberIndex,
     ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData
     );
 VmAfdAddCertificate (
     string pszServerName,
     UInt32 hStore,
     string pszAlias,
     string pszCertificate,
     string pszPrivateKey,
     UInt32 uAutoRefresh);
Example #15
1
 public object WithRefsWithReturn(
     ref string param1,
     ref int param2,
     ref short param3,
     ref long param4,
     ref uint param5,
     ref ushort param6,
     ref ulong param7,
     ref bool param8,
     ref double param9,
     ref decimal param10,
     ref int? param11,
     ref object param12,
     ref char param13,
     ref DateTime param14,
     ref Single param15,
     ref IntPtr param16,
     ref UInt16 param17,
     ref UInt32 param18,
     ref UInt64 param19,
     ref UIntPtr param20
     )
 {
     throw new Exception("Foo");
 }
		public Contact getContactById( UInt32 id )
		{
			string sql = "SELECT " +
			             "`contacts`.`id`, " +
			             "`contacts`.`telephoneNumber`, " +
			             "`contacts`.`alias`, " +
			             "`contacts`.`firstName`, " +
			             "`contacts`.`lastName`, " +
			             "`contacts`.`emailAddress` " +
			             "FROM `SmsApplicatie`.`contacts` WHERE id=:id ";
			MySqlCommand statement = this.databaseConnection.CreateCommand ();
			statement.CommandText = sql;
			statement.Parameters.AddWithValue ("id", id);
			MySqlDataReader reader = statement.ExecuteReader ();

			if (reader.Read ()) 
			{
				Contact contact = new Contact (
					                  Convert.ToUInt32 (reader ["id"]),
					                  Convert.ToString (reader ["telephoneNumber"]),
					                  Convert.ToString (reader ["alias"]),
					                  Convert.ToString (reader ["firstName"]),
					                  Convert.ToString (reader ["lastName"]),
					                  Convert.ToString (reader ["emailAddress"])
				                  );
				return contact;
			} 
			else 
			{
				return null;
			}

		}
 VmAfdRpcEnumCertificates (
     UInt32 hBinding,
     UInt32 hStore,
     UInt32 dwStartIndex,
     UInt32 dwNumCertificates,
     VMAFD_CERT_CONTAINER ppCertContainer
 );
		public static void QueryObjectParameterAMD(Int32 target, UInt32 id, Int32 pname, OcclusionQueryEventMaskAMD param)
		{
			Debug.Assert(Delegates.pglQueryObjectParameteruiAMD != null, "pglQueryObjectParameteruiAMD not implemented");
			Delegates.pglQueryObjectParameteruiAMD(target, id, pname, (UInt32)param);
			CallLog("glQueryObjectParameteruiAMD({0}, {1}, {2}, {3})", target, id, pname, param);
			DebugCheckErrors();
		}
		void nsIEmbeddingSiteWindow.GetDimensions(UInt32 flags, out Int32 x, out Int32 y, out Int32 cx, out Int32 cy)
		{
			Trace.TraceInformation("nsIEmbeddingSiteWindow.GetDimensions(flags = 0x{0:X8})", flags);

			x = y = cx = cy = 0;

			if (flags.HasFlag(nsIEmbeddingSiteWindowConstants.DIM_FLAGS_POSITION))
			{
				Point outerPosition = Container.GetOuterPosition();
				x = outerPosition.X;
				y = outerPosition.Y;
			}

			if (flags.HasFlag(nsIEmbeddingSiteWindowConstants.DIM_FLAGS_SIZE_INNER))
			{
				Size innerSize = Container.GetInnerSize();
				cx = innerSize.Width;
				cy = innerSize.Height;
			}
			else if (flags.HasFlag(nsIEmbeddingSiteWindowConstants.DIM_FLAGS_SIZE_OUTER))
			{
				Size outerSize = Container.GetOuterSize();
				cx = outerSize.Width;
				cy = outerSize.Height;
			}
		}
Example #20
1
 public Item(string productCodeIn, double singlePriceIn, double volumePriceIn, UInt32 volumeQuantityIn)
 {
     _productCode = productCodeIn;
     _singleUnitPrice = singlePriceIn;
     _volumePrice = volumePriceIn;
     _volumeQuantity = volumeQuantityIn;
 }
		public static void StencilClearTagEXT(Int32 stencilTagBits, UInt32 stencilClearTag)
		{
			Debug.Assert(Delegates.pglStencilClearTagEXT != null, "pglStencilClearTagEXT not implemented");
			Delegates.pglStencilClearTagEXT(stencilTagBits, stencilClearTag);
			CallLog("glStencilClearTagEXT({0}, {1})", stencilTagBits, stencilClearTag);
			DebugCheckErrors();
		}
Example #22
1
        public void TestCase1()
        {
            scriptName = appDirectory + @"\scripts\val_test_ranges.ds";
            FileInfo info = new FileInfo(scriptName);
            nrOfErrors = 22;
            nrOfWarnings = 23;
            if (scriptSession != null)
            {
                string resultFile = scriptSession.SessionId.ToString("000") + '_' + info.Name + "_res.xml";
                scriptSession.StartResultsGathering(resultFile);

                // Perform the actual execution of the script.
                scriptSession.BeginExecuteScript(scriptName, false, theAsyncCallback);
            }

            lock (this)
            {
                wait = true;

                while (wait)
                {
                    if (wait)
                    {
                        System.Threading.Thread.Sleep(500);
                    }
                }
            }

            Assert.That(scriptSession.NrOfValidationErrors, Is.EqualTo(nrOfErrors), "Validation Error:");
            Assert.That(scriptSession.NrOfValidationWarnings, Is.EqualTo(nrOfWarnings), "Validation Warning:");
        }
Example #23
1
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="country">地域</param>
 /// <param name="family_line_num">系統番号</param>
 /// <param name="parent_family_line_num">大元の親系統番号</param>
 /// <param name="data">系統データ</param>
 public FamilyLineInfo( Horse.Area country, UInt32 family_line_num, UInt32 parent_family_line_num, ref HFamilyLineData data )
 {
     this.Coutry = country;
     this.FamilyLineNum = family_line_num;
     this.ParentFamilyLuneNum = parent_family_line_num;
     this.Data = data;
 }
Example #24
1
        public static bool IsSignatureVerified(AKEKeys ake_keys, DHKeyPair key_pair, byte[] their_public_key_mpi_byte_array, byte[] encrypted_signature_byte_array,
            byte[] hashed_encrypted_signature_byte_array, bool is_top_half_keys, ref UInt32 public_key_id, ref byte[] dsa_public_key_byte_array_encoded)
        {
            if (encrypted_signature_byte_array == null || encrypted_signature_byte_array.Length < 1)
                throw new ArgumentException("IsSignatureVerified: Encrypted signature byte array cannot be null/empty");

            if (hashed_encrypted_signature_byte_array == null || hashed_encrypted_signature_byte_array.Length < 1)
             throw new ArgumentException("IsSignatureVerified: The hashed encrypted byte array cannot be null/empty");

            if (ake_keys == null)
             throw new ArgumentException("IsSignatureVerified: The AKE keys cannot be null");

            bool _is_hash_verified = false;

            if (is_top_half_keys == true)
                _is_hash_verified = IsHashSignatureVerified(ake_keys.GetMACKey2(), encrypted_signature_byte_array, hashed_encrypted_signature_byte_array);
            else
                _is_hash_verified = IsHashSignatureVerified(ake_keys.GetMACKey4(), encrypted_signature_byte_array, hashed_encrypted_signature_byte_array);

            if (_is_hash_verified == false)
             return false;

             if (IsEncryptedSignatureVerified(ake_keys, key_pair, their_public_key_mpi_byte_array,
                 encrypted_signature_byte_array, 0, is_top_half_keys, ref public_key_id, ref dsa_public_key_byte_array_encoded) == false)
              return false;

               return true;
        }
Example #25
1
 public override void Decode()
 {
     MemoryStream stream = new MemoryStream(Data);
     BinaryReader reader = new BinaryReader(stream);
     this.FirstRowOffset = reader.ReadUInt32();
     reader.ReadUInt16();
 }
Example #26
1
File: Item.cs Project: habb0/Bfly
        internal Item(UInt32 Id, int Sprite, string PublicName, string Name, string Type, int Width, int Length, double Height, bool Stackable, bool Walkable, bool IsSeat, bool AllowRecycle, bool AllowTrade, bool AllowMarketplaceSell, bool AllowGift, bool AllowInventoryStack, InteractionType InteractionType, int Modes, string VendingIds)
        {
            this.Id = Id;
            this.SpriteId = Sprite;
            this.PublicName = PublicName;
            this.Name = Name;
            this.Type = char.Parse(Type);
            this.Width = Width;
            this.Length = Length;
            this.Height = Height;
            this.Stackable = Stackable;
            this.Walkable = Walkable;
            this.IsSeat = IsSeat;
            this.AllowRecycle = AllowRecycle;
            this.AllowTrade = AllowTrade;
            this.AllowMarketplaceSell = AllowMarketplaceSell;
            this.AllowGift = AllowGift;
            this.AllowInventoryStack = AllowInventoryStack;
            this.InteractionType = InteractionType;
            this.Modes = Modes;
            this.VendingIds = new List<int>();

            foreach (string VendingId in VendingIds.Split(','))
            {
                this.VendingIds.Add(int.Parse(VendingId));
            }
        }
Example #27
1
 private static UInt32 CalculateHash(UInt32[] table, UInt32 seed, IList<byte> buffer, int start, int size)
 {
     var crc = seed;
     for (var i = start; i < size - start; i++)
         crc = (crc >> 8) ^ table[buffer[i] ^ crc & 0xff];
     return crc;
 }
Example #28
1
 public void GetContent(CompilerContext context, ParseTreeNode parseNode)
 {
     if (parseNode.HasChildNodes())
     {
         ParallelTasks = Convert.ToUInt32(parseNode.ChildNodes[1].Token.Value);
     }
 }
Example #29
1
 public Order(Customer customer)
 {
   m_orderId = 0;
   m_customer = customer;
   m_customer.Orders.Add(this);
   m_payments = new VelocityDbList<Payment>();
 }
Example #30
1
 private static UInt32[] Encrypt(UInt32[] v, UInt32[] k)
 {
     Int32 n = v.Length - 1;
     if (n < 1)
     {
         return v;
     }
     if (k.Length < 4)
     {
         UInt32[] Key = new UInt32[4];
         k.CopyTo(Key, 0);
         k = Key;
     }
     UInt32 z = v[n], y = v[0], delta = 0x9E3779B9, sum = 0, e;
     Int32 p, q = 6 + 52 / (n + 1);
     while (q-- > 0)
     {
         sum = unchecked(sum + delta);
         e = sum >> 2 & 3;
         for (p = 0; p < n; p++)
         {
             y = v[p + 1];
             z = unchecked(v[p] += (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
         }
         y = v[0];
         z = unchecked(v[n] += (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
     }
     return v;
 }
Example #31
0
 private void UpdateMileageText(System.UInt32 mileage)
 {
     mileageText.text = mileage.ToString() + "M";
 }
Example #32
0
    // Update is called once per frame
    void Update()
    {
        //print(GamePlayState);
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (ProgramMode == Program_Mode.MENU)
            {
                ProgramMode = Program_Mode.GAME;
            }
            else if (ProgramMode == Program_Mode.GAME)
            {
                ProgramMode = Program_Mode.MENU;
            }
        }

        if (Input.GetKeyDown(KeyCode.Return))
        {
            if (ProgramMode == Program_Mode.START_SCREEN)
            {
                ProgramMode = Program_Mode.GAME;
                ELEKTRICITY.Play();
            }

            StartCoroutine(DoorOpenEffect());
        }


        if (Input.GetKeyDown(KeyCode.Escape) && ProgramMode == Program_Mode.START_SCREEN)
        {
            Application.Quit(0);
        }


        if (ProgramMode == Program_Mode.START_SCREEN)
        {
            for (u32 Index = 0;
                 Index < StartScreenItems.Length;
                 ++Index)
            {
                StartScreenItems[Index].SetActive(true);
            }
            ThePlayer.SetActive(false);
        }
        else
        {
            for (u32 Index = 0;
                 Index < StartScreenItems.Length;
                 ++Index)
            {
                StartScreenItems[Index].SetActive(false);
            }
            ThePlayer.SetActive(true);
        }

        v3 PlayerPosition = ThePlayer.transform.position; // TODO(@rudra): Every frame?

        if (Rectangle.IsInRectangle(CSG_Room1.GetRect(), PlayerPosition))
        {
            CurrentPlayerRoom = PLAYER_CURRENT_ROOM.ROOM_1;
        }

        if (Rectangle.IsInRectangle(CSG_Room2.GetRect(), PlayerPosition))
        {
            CurrentPlayerRoom = PLAYER_CURRENT_ROOM.ROOM_2;
        }

        if (Rectangle.IsInRectangle(CSG_Room3.GetRect(), PlayerPosition))
        {
            CurrentPlayerRoom = PLAYER_CURRENT_ROOM.ROOM_3;

            if (GamePlayState == GAMEPLAY_STATE.RIGHT_DOOR_OPENED)
            {
                GamePlayState            = GAMEPLAY_STATE.START_CRAZINESS;
                Human.transform.rotation = Quaternion.Euler(0.0f, 25.0f, 0.0f);
                Camera.IncreaseVHSVerticalOffset(0.04f);

                VCR_Target_Volume = 9.0f;
                T = 0.0f;
#if IGNORED
                f32 CurrentPlayTime = GM_AudioSource.time;

                GM_AudioSource.clip = VCR_Mid;
                GM_AudioSource.loop = true;
                GM_AudioSource.Play();
                GM_AudioSource.time = CurrentPlayTime;
#endif
            }
        }


        if (CurrentPlayerRoom == PLAYER_CURRENT_ROOM.ROOM_2 && DoorState == DOOR_STATE.DOOR_OPEN && GamePlayState == GAMEPLAY_STATE.INIT)
        {
            CloseDoor();

            StartCoroutine(ActivateCoffins());
            //StartCoroutine(OpenDoorWhenCollected());
        }


        if (CurrentPlayerRoom == PLAYER_CURRENT_ROOM.ROOM_2 && DoorState == DOOR_STATE.DOOR_OPEN && GamePlayState == GAMEPLAY_STATE.READ_FOURTH_NOTE)
        {
            CloseDoor();
            GamePlayState = GAMEPLAY_STATE.LEVER_SEQUENCE;
            StartCoroutine(WaitAndStartCoffinsAndInitLever());
        }

        if (CurrentPlayerRoom == PLAYER_CURRENT_ROOM.ROOM_1 && DoorState == DOOR_STATE.DOOR_OPEN && GamePlayState == GAMEPLAY_STATE.FIRST_COLLECTED)
        {
            CloseDoor();
            GamePlayState = GAMEPLAY_STATE.WAITING_FOR_NOTES;

            Letter_1.GetComponent <Animation>().Play("SendLetter");
            Human.SetActive(true);
        }

        if (Camera.HitWithRaycast(LetterLayer) && ThePlayer.GetComponent <Player>().CollidedWithLetter)
        {
            Animation LetterAnimation = Camera.LookingAt.transform.parent.gameObject.GetComponent <Animation>();
            if (LetterAnimation.isPlaying)
            {
            }
            else
            {
                if (ReadingState == READING_STATE.NONE)
                {
                    ReadingState = READING_STATE.CAN_READ;
                }
            }
        }
        else
        {
            ReadingState = READING_STATE.NONE;
        }

        EKeyProcessed = false;

        if (ReadingState == READING_STATE.READING && Input.GetKeyDown(KeyCode.E))
        {
            EKeyProcessed = true;
            ReadingState  = READING_STATE.CAN_READ;

            Letter _L = Camera.LookingAt.GetComponent <Letter>();
            if (_L.LetterTag == Letter.Tag.FIRST)
            {
                if (GamePlayState == GAMEPLAY_STATE.WAITING_FOR_NOTES)
                {
                    GamePlayState = GAMEPLAY_STATE.READ_FIRST_NOTE;
                    Letter_1.transform.position = Letter_1_Table_Position.position;

                    GamePlayState = GAMEPLAY_STATE.SECOND_NOTE_SENT;
                    Letter_2.GetComponent <Animation>().Play("SendLetter");
                }
            }
            else if (_L.LetterTag == Letter.Tag.SECOND)
            {
                if (GamePlayState == GAMEPLAY_STATE.SECOND_NOTE_SENT)
                {
                    GamePlayState = GAMEPLAY_STATE.READ_SECOND_NOTE;
                    Letter_2.transform.position = Letter_2_Table_Position.position;

                    GamePlayState = GAMEPLAY_STATE.THIRD_NOTE_SENT;
                    Letter_3.GetComponent <Animation>().Play("SendLetter");
                }
            }
            else if (_L.LetterTag == Letter.Tag.THIRD)
            {
                if (GamePlayState == GAMEPLAY_STATE.THIRD_NOTE_SENT)
                {
                    GamePlayState = GAMEPLAY_STATE.READ_THIRD_NOTE;
                    Letter_3.transform.position = Letter_3_Table_Position.position;

                    GamePlayState = GAMEPLAY_STATE.FOURTH_NOTE_SENT;
                    Letter_4.GetComponent <Animation>().Play("SendLetter");
                }
            }
            else if (_L.LetterTag == Letter.Tag.FOURTH)
            {
                if (GamePlayState == GAMEPLAY_STATE.FOURTH_NOTE_SENT)
                {
                    GamePlayState = GAMEPLAY_STATE.READ_FOURTH_NOTE;
                    Letter_4.transform.position = Letter_4_Table_Position.position;

                    StartCoroutine(OpenDoorAndEnableLever());
                }
            }
            else
            {
                // NOTE(@rudra): Case for notes on the other side
                OtherNotesProgressHash = OtherNotesProgressHash | 1 << (i32)_L.LetterTag;
                if (OtherNotesProgressHash == GameCompleteHash)
                {
                    StartCoroutine(FinishingSequence());
                }
            }
        }


        if (ReadingState == READING_STATE.CAN_READ && Input.GetKeyDown(KeyCode.E) && !EKeyProcessed)
        {
            EKeyProcessed = true;
            ReadingState  = READING_STATE.READING;
        }

        ReadingBackground.SetActive(ReadingState == READING_STATE.READING);


        // NOTE(@rudra): Lever
        if (Camera.HitWithRaycast(LeverLayer) && ThePlayer.GetComponent <Player>().CollidedWithLever)
        {
            if (LeverState != LEVER_STATE.LEVER_ON)
            {
                LeverState = LEVER_STATE.LEVER_CAN_ACCESS;
            }
        }
        else
        {
            if (LeverState != LEVER_STATE.LEVER_ON)
            {
                LeverState = LEVER_STATE.LEVER_CANNOT_ACCESS;
            }
        }


        // NOTE(@rudra): Interact text
        if (ReadingState == READING_STATE.CAN_READ || LeverState == LEVER_STATE.LEVER_CAN_ACCESS)
        {
            InteractText.text = "E";
        }
        else
        {
            InteractText.text = "";
        }

        LetterText.text = "";
        if (ReadingState == READING_STATE.READING)
        {
            Letter _L = Camera.LookingAt.GetComponent <Letter>();
            if (_L != null)
            {
                LetterText.text = _L.Contents;
            }
        }

        // NOTE(@rudra): Handle Lever
        if (LeverState == LEVER_STATE.LEVER_CAN_ACCESS && Input.GetKeyDown(KeyCode.E))
        {
            LeverState = LEVER_STATE.LEVER_ON;
            Lever.GetComponent <Animation>().Play("LeverOn");

            StartCoroutine(LightOffSequence());
        }

        // NOTE(@rudra): Right door opening sequence
        if (GamePlayState == GAMEPLAY_STATE.LEVER_ACTIVATED)
        {
            f32 SqDistanceFromPlayer = DistanceSq(RightDoor.transform.position, ThePlayer.transform.position);

            if (SqDistanceFromPlayer <= 30.0f)
            {
                GamePlayState = GAMEPLAY_STATE.RIGHT_DOOR_OPENED;
                RightDoorPivot.GetComponent <Animation>().Play("RightDoorOpen");

                AudioSource RightDoorAudio = RightDoor.GetComponent <AudioSource>();
                RightDoorAudio.clip = RightDoorOpen;
                RightDoorAudio.Play();
            }
        }

        // NOTE(@rudra): Ending sequence
        if (CurrentPlayerRoom == PLAYER_CURRENT_ROOM.ROOM_3)
        {
        }

        GameMixer.GetFloat("GM_Volume", out VCR_Current_Volume);
        VCR_Current_Volume = Mathf.Lerp(VCR_Current_Volume, VCR_Target_Volume, T);
        GameMixer.SetFloat("GM_Volume", VCR_Current_Volume);
        T += 1.0f * Time.deltaTime;

        // NOTE(@rudra): Coffin sequence
        if (FirstCoffinActivated)
        {
            f32 SqDistanceFromPlayer = DistanceSq(FirstCoffinLight.transform.position, ThePlayer.transform.position);
            if (SqDistanceFromPlayer <= CoffinMinDistance)
            {
                StartCoroutine(WaitAndActivateSecondCoffin());
            }
        }
        if (SecondCoffinActivated)
        {
            f32 SqDistanceFromPlayer = DistanceSq(SecondCoffinLight.transform.position, ThePlayer.transform.position);
            if (SqDistanceFromPlayer <= CoffinMinDistance)
            {
                StartCoroutine(WaitAndActivateThirdCoffin());
            }
        }
        if (ThirdCoffinActivated && !StartedAlready)
        {
            f32 SqDistanceFromPlayer = DistanceSq(ThirdCoffinLight.transform.position, ThePlayer.transform.position);
            if (SqDistanceFromPlayer <= CoffinMinDistance)
            {
                StartCoroutine(WaitAndActivateOpenDoor());
            }
        }
    }
Example #33
0
 public static extern void glEnable(System.UInt32 flag);
Example #34
0
 /// <summary>
 /// If the type is derived, set the target
 /// </summary>
 /// <param name="_ActorId"></param>
 public void SetTargetActorId(EAObjID _ActorId)
 {
     WeaponInfo.m_TargetActorId = _ActorId;
 }
Example #35
0
 public void SetWeapon(EAObjID _weaponId)
 {
     m_weaponId = _weaponId;
 }
Example #36
0
 public void SetOwnActor(EAObjID _ActorId)
 {
     GetItemBase().GetItemInfo().m_HavenUser = _ActorId;
 }
Example #37
0
 private void UpdateWashedItemsText(System.UInt32 washedItems, System.UInt32 washedItemsCombo)
 {
     washedItemsText.text = washedItems.ToString();
 }
Example #38
0
 internal static extern int vc_dispmanx_update_submit_sync(DISPMANX_UPDATE_HANDLE_T update);
Example #39
0
 internal static extern DISPMANX_ELEMENT_HANDLE_T vc_dispmanx_element_add(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_DISPLAY_HANDLE_T display, Int32 layer, IntPtr dest_rect, DISPMANX_RESOURCE_HANDLE_T src, IntPtr src_rect, DISPMANX_PROTECTION_T protection, IntPtr alpha, IntPtr clamp, DISPMANX_TRANSFORM_T transform);
Example #40
0
        /*
        ** Try to obtain a page from the cache.
        */
        static int sqlite3PcacheFetch(
            PCache pCache,   /* Obtain the page from this cache */
            u32 pgno,        /* Page number to obtain */
            int createFlag,  /* If true, create page if it does not exist already */
            ref PgHdr ppPage /* Write the page here */
            )
        {
            PgHdr pPage = null;
            int   eCreate;

            Debug.Assert(pCache != null);
            Debug.Assert(createFlag == 1 || createFlag == 0);
            Debug.Assert(pgno > 0);

            /* If the pluggable cache (sqlite3_pcache*) has not been allocated,
            ** allocate it now.
            */
            if (null == pCache.pCache && createFlag != 0)
            {
                sqlite3_pcache p;
                int            nByte;
                nByte = pCache.szPage + pCache.szExtra + 0;// sizeof( PgHdr );
                p     = sqlite3GlobalConfig.pcache.xCreate(nByte, pCache.bPurgeable ? 1 : 0);
                if (null == p)
                {
                    return(SQLITE_NOMEM);
                }
                sqlite3GlobalConfig.pcache.xCachesize(p, pCache.nMax);
                pCache.pCache = p;
            }

            eCreate = createFlag * (1 + ((!pCache.bPurgeable || null == pCache.pDirty) ? 1 : 0));

            if (pCache.pCache != null)
            {
                pPage = sqlite3GlobalConfig.pcache.xFetch(pCache.pCache, pgno, eCreate);
            }

            if (null == pPage && eCreate == 1)
            {
                PgHdr pPg;

                /* Find a dirty page to write-out and recycle. First try to find a
                ** page that does not require a journal-sync (one with PGHDR_NEED_SYNC
                ** cleared), but if that is not possible settle for any other
                ** unreferenced dirty page.
                */
#if SQLITE_ENABLE_EXPENSIVE_ASSERT
                expensive_assert(pcacheCheckSynced(pCache));
#endif
                for (pPg = pCache.pSynced;
                     pPg != null && (pPg.nRef != 0 || (pPg.flags & PGHDR_NEED_SYNC) != 0);
                     pPg = pPg.pDirtyPrev
                     )
                {
                    ;
                }
                pCache.pSynced = pPg;
                if (null == pPg)
                {
                    for (pPg = pCache.pDirtyTail; pPg != null && pPg.nRef != 0; pPg = pPg.pDirtyPrev)
                    {
                        ;
                    }
                }
                if (pPg != null)
                {
                    int rc;
                    rc = pCache.xStress(pCache.pStress, pPg);
                    if (rc != SQLITE_OK && rc != SQLITE_BUSY)
                    {
                        return(rc);
                    }
                }

                pPage = sqlite3GlobalConfig.pcache.xFetch(pCache.pCache, pgno, 2);
            }

            if (pPage != null)
            {
                if (null == pPage.pData)
                {
//memset( pPage, 0, sizeof( PgHdr ) + pCache.szExtra );
                    pPage.pData = sqlite3Malloc(pCache.szPage);
                    //pPage.pExtra = (void*)&pPage[1];
                    //pPage.pData = (void*)&( (char*)pPage )[sizeof( PgHdr ) + pCache.szExtra];
                    pPage.pCache = pCache;
                    pPage.pgno   = pgno;
                }
                Debug.Assert(pPage.pCache == pCache);
                Debug.Assert(pPage.pgno == pgno);
                //Debug.Assert( pPage.pExtra == (void*)&pPage[1] );
                if (0 == pPage.nRef)
                {
                    pCache.nRef++;
                }
                pPage.nRef++;
                if (pgno == 1)
                {
                    pCache.pPage1 = pPage;
                }
            }
            ppPage = pPage;
            return((pPage == null && eCreate != 0) ? SQLITE_NOMEM : SQLITE_OK);
        }
Example #41
0
        public static int vc_dispmanx_element_remove(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element)
        {
            int retvalue;

            Debug.Assert(Delegates.pvc_dispmanx_element_remove != null, "vc_dispmanx_element_remove not implemented");
            retvalue = Delegates.pvc_dispmanx_element_remove(update, element);
            LogCommand("vc_dispmanx_element_remove", retvalue, update, element);

            return(retvalue);
        }
Example #42
0
 internal static extern int vc_dispmanx_element_remove(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element);
Example #43
0
 public uint ResolveVirtualAddressInSection(RVA rva, Section section)
 {
     return(rva + section.PointerToRawData - section.VirtualAddress);
 }
Example #44
0
 internal static extern int vc_dispmanx_display_close(DISPMANX_DISPLAY_HANDLE_T display);
Example #45
0
        static void _decode_uavcan_equipment_air_data_TrueAirspeed(CanardRxTransfer transfer, ref uint32_t bit_ofs, uavcan_equipment_air_data_TrueAirspeed msg, bool tao)
        {
            {
                uint16_t float16_val = 0;
                canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                msg.true_airspeed = canardConvertFloat16ToNativeFloat(float16_val);
            }
            bit_ofs += 16;

            {
                uint16_t float16_val = 0;
                canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                msg.true_airspeed_variance = canardConvertFloat16ToNativeFloat(float16_val);
            }
            bit_ofs += 16;
        }
Example #46
0
        public static DISPMANX_ELEMENT_HANDLE_T vc_dispmanx_element_add(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_DISPLAY_HANDLE_T display, Int32 layer, VC_RECT_T dest_rect, DISPMANX_RESOURCE_HANDLE_T src, VC_RECT_T src_rect, DISPMANX_PROTECTION_T protection, IntPtr alpha, IntPtr clamp, DISPMANX_TRANSFORM_T transform)
        {
            DISPMANX_ELEMENT_HANDLE_T retvalue;

            GCHandle dest_rectHandle = GCHandle.Alloc(dest_rect, GCHandleType.Pinned);
            GCHandle src_rectHandle  = GCHandle.Alloc(src_rect, GCHandleType.Pinned);

            try {
                Debug.Assert(Delegates.pvc_dispmanx_element_add != null, "vc_dispmanx_element_add not implemented");
                retvalue = Delegates.pvc_dispmanx_element_add(update, display, layer, dest_rectHandle.AddrOfPinnedObject(), src, src_rectHandle.AddrOfPinnedObject(), protection, alpha, clamp, transform);
                LogCommand("vc_dispmanx_element_add", retvalue, update, display, layer, dest_rect, src, src_rect, protection, alpha, clamp, transform);
            } finally {
                dest_rectHandle.Free();
                src_rectHandle.Free();
            }

            return(retvalue);
        }
Example #47
0
 public static extern bool WriteProcessMemory(IntPtr hProcess, DWORD_PTR dwAddress, IntPtr lpBuffer, uint dwSize, out uint dwBytesWritten);
Example #48
0
 static extern bool InternetGetCookieEx(string pchURL, string pchCookieName, StringBuilder pchCookieData, ref System.UInt32 pcchCookieData, int dwFlags, IntPtr lpReserved);
Example #49
0
 public static extern bool VirtualFreeEx(IntPtr hProcess, DWORD_PTR lpAddress, uint dwSize, FreeType dwFreeType);
Example #50
0
 public static extern bool ReadProcessMemory(IntPtr hProcess, DWORD_PTR dwAddress, IntPtr lpBuffer, uint dwSize, out uint dwBytesRead);
Example #51
0
        static void _decode_uavcan_equipment_ahrs_Solution(CanardRxTransfer transfer, ref uint32_t bit_ofs, uavcan_equipment_ahrs_Solution msg, bool tao)
        {
            _decode_uavcan_Timestamp(transfer, ref bit_ofs, msg.timestamp, false);

/*['__doc__', '__init__', '__module__', '__repr__', '__str__', 'get_normalized_definition', 'name', 'type']*/
            for (int i = 0; i < 4; i++)
            {
                {
                    uint16_t float16_val = 0;
                    canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                    msg.orientation_xyzw[i] = canardConvertFloat16ToNativeFloat(float16_val);
                }
                bit_ofs += 16;
            }

            bit_ofs += 4;

            canardDecodeScalar(transfer, bit_ofs, 4, false, ref msg.orientation_covariance_len);
            bit_ofs += 4;
            msg.orientation_covariance = new Single[msg.orientation_covariance_len];
            for (int i = 0; i < msg.orientation_covariance_len; i++)
            {
                {
                    uint16_t float16_val = 0;
                    canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                    msg.orientation_covariance[i] = canardConvertFloat16ToNativeFloat(float16_val);
                }
                bit_ofs += 16;
            }

/*['__doc__', '__init__', '__module__', '__repr__', '__str__', 'get_normalized_definition', 'name', 'type']*/
            for (int i = 0; i < 3; i++)
            {
                {
                    uint16_t float16_val = 0;
                    canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                    msg.angular_velocity[i] = canardConvertFloat16ToNativeFloat(float16_val);
                }
                bit_ofs += 16;
            }

            bit_ofs += 4;

            canardDecodeScalar(transfer, bit_ofs, 4, false, ref msg.angular_velocity_covariance_len);
            bit_ofs += 4;
            msg.angular_velocity_covariance = new Single[msg.angular_velocity_covariance_len];
            for (int i = 0; i < msg.angular_velocity_covariance_len; i++)
            {
                {
                    uint16_t float16_val = 0;
                    canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                    msg.angular_velocity_covariance[i] = canardConvertFloat16ToNativeFloat(float16_val);
                }
                bit_ofs += 16;
            }

/*['__doc__', '__init__', '__module__', '__repr__', '__str__', 'get_normalized_definition', 'name', 'type']*/
            for (int i = 0; i < 3; i++)
            {
                {
                    uint16_t float16_val = 0;
                    canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                    msg.linear_acceleration[i] = canardConvertFloat16ToNativeFloat(float16_val);
                }
                bit_ofs += 16;
            }

            if (!tao)
            {
                canardDecodeScalar(transfer, bit_ofs, 4, false, ref msg.linear_acceleration_covariance_len);
                bit_ofs += 4;
            }
            else
            {
                msg.linear_acceleration_covariance_len = (uint8_t)(((transfer.payload_len * 8) - bit_ofs) / 16);
            }

            msg.linear_acceleration_covariance = new Single[msg.linear_acceleration_covariance_len];
            for (int i = 0; i < msg.linear_acceleration_covariance_len; i++)
            {
                {
                    uint16_t float16_val = 0;
                    canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                    msg.linear_acceleration_covariance[i] = canardConvertFloat16ToNativeFloat(float16_val);
                }
                bit_ofs += 16;
            }
        }
Example #52
0
 public static extern IntPtr CreateRemoteThread(IntPtr hProcess, uint lpThreadAttributes, uint dwStackSize, DWORD_PTR dwStartAddress, DWORD_PTR dwParameter, uint dwCreationFlags, out uint dwThreadId);
        public void _01_BasicOperationStateTest()
        {
            Helpers.CheckPlatform();

            CKR rv = CKR.CKR_OK;

            using (Pkcs11 pkcs11 = new Pkcs11(Settings.Pkcs11LibraryPath))
            {
                rv = pkcs11.C_Initialize(Settings.InitArgs40);
                if ((rv != CKR.CKR_OK) && (rv != CKR.CKR_CRYPTOKI_ALREADY_INITIALIZED))
                {
                    Assert.Fail(rv.ToString());
                }

                // Find first slot with token present
                NativeULong slotId = Helpers.GetUsableSlot(pkcs11);

                // Open RO (read-only) session
                NativeULong session = CK.CK_INVALID_HANDLE;
                rv = pkcs11.C_OpenSession(slotId, CKF.CKF_SERIAL_SESSION, IntPtr.Zero, IntPtr.Zero, ref session);
                if (rv != CKR.CKR_OK)
                {
                    Assert.Fail(rv.ToString());
                }

                // Get length of state in first call
                NativeULong stateLen = 0;
                rv = pkcs11.C_GetOperationState(session, null, ref stateLen);
                if (rv != CKR.CKR_OK)
                {
                    Assert.Fail(rv.ToString());
                }

                Assert.IsTrue(stateLen > 0);

                // Allocate array for state
                byte[] state = new byte[stateLen];

                // Get state in second call
                rv = pkcs11.C_GetOperationState(session, state, ref stateLen);
                if (rv != CKR.CKR_OK)
                {
                    Assert.Fail(rv.ToString());
                }

                // Let's set state so the test is complete
                rv = pkcs11.C_SetOperationState(session, state, ConvertUtils.UInt32FromInt32(state.Length), CK.CK_INVALID_HANDLE, CK.CK_INVALID_HANDLE);
                if (rv != CKR.CKR_OK)
                {
                    Assert.Fail(rv.ToString());
                }

                rv = pkcs11.C_CloseSession(session);
                if (rv != CKR.CKR_OK)
                {
                    Assert.Fail(rv.ToString());
                }

                rv = pkcs11.C_Finalize(IntPtr.Zero);
                if (rv != CKR.CKR_OK)
                {
                    Assert.Fail(rv.ToString());
                }
            }
        }
Example #54
0
 public static extern DWORD_PTR VirtualAllocEx(IntPtr hProcess, DWORD_PTR lpAddress, uint dwSize, AllocationType flAllocationType, MemoryProtection flProtect);
Example #55
0
 public static extern long okGetBufferSize(IntPtr hBoard, ref System.UInt32 lpLinear, ref System.UInt32 dwSize);
Example #56
0
        // was:sqlite3PcacheFetch
        internal RC FetchPage(Pgno pgno, int createFlag, ref PgHdr ppPage)
        {
            Debug.Assert(createFlag == 1 || createFlag == 0);
            Debug.Assert(pgno > 0);
            // If the pluggable cache (sqlite3_pcache*) has not been allocated, allocate it now.
            if (pCache == null && createFlag != 0)
            {
                var nByte = szPage + szExtra + 0;
                var p     = IPCache.xCreate(nByte, bPurgeable);
                p.xCachesize(nMax);
                pCache = p;
            }
            var   eCreate = createFlag * (1 + ((!bPurgeable || null == pDirty) ? 1 : 0));
            PgHdr pPage   = null;

            if (pCache != null)
            {
                pPage = pCache.xFetch(pgno, eCreate);
            }
            if (pPage == null && eCreate == 1)
            {
                PgHdr pPg;
                // Find a dirty page to write-out and recycle. First try to find a page that does not require a journal-sync (one with PGHDR_NEED_SYNC
                // cleared), but if that is not possible settle for any other unreferenced dirty page.
#if SQLITE_ENABLE_EXPENSIVE_ASSERT
                expensive_assert(pcacheCheckSynced(pCache));
#endif
                for (pPg = pSynced; pPg != null && (pPg.Refs != 0 || (pPg.Flags & PgHdr.PGHDR.NEED_SYNC) != 0); pPg = pPg.DirtyPrev)
                {
                    ;
                }
                pSynced = pPg;
                if (pPg == null)
                {
                    for (pPg = pDirtyTail; pPg != null && pPg.Refs != 0; pPg = pPg.DirtyPrev)
                    {
                        ;
                    }
                }
                if (pPg != null)
                {
#if SQLITE_LOG_CACHE_SPILL
                    sqlite3_log(SQLITE_FULL, "spill page %d making room for %d - cache used: %d/%d", pPg.pgno, pgno, sqlite3GlobalConfig.pcache.xPagecount(pCache.pCache), pCache.nMax);
#endif
                    var rc = xStress(pStress, pPg);
                    if (rc != RC.OK && rc != RC.BUSY)
                    {
                        return(rc);
                    }
                }
                pPage = pCache.xFetch(pgno, 2);
            }
            if (pPage != null)
            {
                if (pPage.Data == null)
                {
                    pPage.Data  = MallocEx.sqlite3Malloc(pCache.szPage);
                    pPage.Cache = this;
                    pPage.ID    = pgno;
                }
                Debug.Assert(pPage.Cache == this);
                Debug.Assert(pPage.ID == pgno);
                if (pPage.Refs == 0)
                {
                    nRef++;
                }
                pPage.Refs++;
                if (pgno == 1)
                {
                    pPage1 = pPage;
                }
            }
            ppPage = pPage;
            return(pPage == null && eCreate != 0 ? RC.NOMEM : RC.OK);
        }
Example #57
0
 public void Clear()
 {
     rpos = wpos = 0;
 }
 /// <summary>
 /// Initializes a new instance of the CkRsaPkcsPssParams class.
 /// </summary>
 /// <param name='hashAlg'>Hash algorithm used in the PSS encoding (CKM)</param>
 /// <param name='mgf'>Mask generation function to use on the encoded block (CKG)</param>
 /// <param name='len'>Length, in bytes, of the salt value used in the PSS encoding</param>
 public CkRsaPkcsPssParams(NativeULong hashAlg, NativeULong mgf, NativeULong len)
 {
     _lowLevelStruct.HashAlg = hashAlg;
     _lowLevelStruct.Mgf     = mgf;
     _lowLevelStruct.Len     = len;
 }
Example #59
0
 public byte[] GetBytes(System.UInt32 startIndex, System.UInt32 length)
 {
     byte[] bytes = new byte[length];
     Array.Copy(Data, startIndex, bytes, 0, length);
     return(bytes);
 }
Example #60
0
        static void _decode_uavcan_equipment_ahrs_MagneticFieldStrength2(CanardRxTransfer transfer, ref uint32_t bit_ofs, uavcan_equipment_ahrs_MagneticFieldStrength2 msg, bool tao)
        {
            canardDecodeScalar(transfer, bit_ofs, 8, false, ref msg.sensor_id);
            bit_ofs += 8;

/*['__doc__', '__init__', '__module__', '__repr__', '__str__', 'get_normalized_definition', 'name', 'type']*/
            for (int i = 0; i < 3; i++)
            {
                {
                    uint16_t float16_val = 0;
                    canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                    msg.magnetic_field_ga[i] = canardConvertFloat16ToNativeFloat(float16_val);
                }
                bit_ofs += 16;
            }

            if (!tao)
            {
                canardDecodeScalar(transfer, bit_ofs, 4, false, ref msg.magnetic_field_covariance_len);
                bit_ofs += 4;
            }
            else
            {
                msg.magnetic_field_covariance_len = (uint8_t)(((transfer.payload_len * 8) - bit_ofs) / 16);
            }

            for (int i = 0; i < msg.magnetic_field_covariance_len; i++)
            {
                {
                    uint16_t float16_val = 0;
                    canardDecodeScalar(transfer, bit_ofs, 16, true, ref float16_val);
                    msg.magnetic_field_covariance[i] = canardConvertFloat16ToNativeFloat(float16_val);
                }
                bit_ofs += 16;
            }
        }