Ejemplo n.º 1
0
        public GetDataMessage(NetworkMessage message)
            : base("getdata", message.Payload)
        {
            int startIndex = 0;

            int inventoryCount = VarInt.GetInt32(
                Payload,
                ref startIndex);

            for (int i = 0; i < inventoryCount; i += 1)
            {
                Inventories.Add(
                    Inventory.Parse(
                        Payload,
                        ref startIndex));
            }
        }
Ejemplo n.º 2
0
        public InvMessage(byte[] buffer)
            : base(
                "inv",
                buffer)
        {
            int startIndex = 0;

            int inventoryCount = VarInt.GetInt32(
                Payload,
                ref startIndex);

            for (int i = 0; i < inventoryCount; i++)
            {
                Inventories.Add(
                    Inventory.Parse(
                        Payload,
                        ref startIndex));
            }
        }