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)); } }
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)); } }