Ejemplo n.º 1
0
 public FanContainer(Unpacker unpacker, ushort size, Feature feature, FeatureAccount featureAccount) : base(unpacker, size, feature, featureAccount)
 {
     unpacker.Unpack(_fans);
     unpacker.Unpack(_fanOf);
     LastFansTransactionInfo  = new LastTransactionInfo(unpacker);
     LastFanOfTransactionInfo = new LastTransactionInfo(unpacker);
 }
 public FeatureAccountContainer(Feature feature, FeatureAccount featureAccount)
 {
     Feature        = feature;
     FeatureId      = feature.FeatureId;
     FeatureAccount = featureAccount;
     AccountId      = featureAccount.AccountId;
 }
Ejemplo n.º 3
0
        public override void PreProcess(IFeatureChain featureChain, FeatureAccount featureAccount, Transaction transaction, FeatureData featureData)
        {
            if (_chainHandler == null)
            {
                _chainHandler = featureChain.GetFeatureChainHandler <GroupChainHandler>(featureData.FeatureId);
            }

            var group     = featureData as Group;
            var groupId   = group.GroupId;
            var index     = group.GroupIndex;
            var groupInfo = _chainHandler.GetGroupInfo(groupId);

            var info = groupInfo.LastTransactionInfo;

            PreviousGroupTransactions.Set(groupId, info.TransactionId);
            GroupTransactionsCount.Set(groupId, info.Count);

            if (index != null)
            {
                info = groupInfo.GetLastGroupIndexTransactionInfo(index, true);

                PreviousGroupIndexTransactions.Set(groupId, index, info.TransactionId);
                GroupIndexTransactionsCount.Set(groupId, info.Count);
            }
        }
Ejemplo n.º 4
0
        public override void PreProcess(IFeatureChain featureChain, FeatureAccount featureAccount, Transaction transaction, FeatureData featureData)
        {
            var targetData    = featureData as TransactionTarget;
            var targetHandler = featureChain.GetFeatureChainHandler <TransactionTargetChainHandler>(featureData.FeatureId);

            var targets = targetData.Targets;

            foreach (var targetId in targets)
            {
                var info = targetHandler?.GetTransactionTargetInfo(targetId)?.LastTransactionInfo ?? LastTransactionCountInfo.Empty;
                _lastTransactionIdLookup.Set(targetId, info.TransactionId);
                _lastTransactionCountLookup.Set(targetId, info.Count);
            }
        }
Ejemplo n.º 5
0
        public override void PreProcess(IFeatureChain featureChain, FeatureAccount featureAccount, Transaction transaction, FeatureData featureData)
        {
            var receiverData = featureData as Receiver;
            var receivers    = receiverData.Receivers;

            foreach (var receiverId in receivers)
            {
                var receiverAccount = featureChain.GetFeatureAccount(receiverId);
                var info            = receiverAccount.GetFeatureContainer <ReceiverContainer>(featureData.FeatureId)?.LastReceiverTransactionInfo ?? LastTransactionCountInfo.Empty;

                _lastTransactionIdLookup.Set(receiverId, info.TransactionId);
                _lastTransactionCountLookup.Set(receiverId, info.Count);
            }
        }
Ejemplo n.º 6
0
        public override void PreProcess(IFeatureChain featureChain, FeatureAccount featureAccount, Transaction transaction, FeatureData featureData)
        {
            if (_chainHandler == null)
            {
                _chainHandler = featureChain.GetFeatureChainHandler <GroupAdministrationChainHandler>(featureData.FeatureId);
                _nextGroupId  = _chainHandler.LastGroupId + 1;
            }

            if (transaction.GetFeatureRequest <GroupAdministrationRequest>(out var request))
            {
                var groupId = request.GroupId;
                var group   = _chainHandler.GetGroupInfo(groupId);
                _lastTransactionIdLookup.Set(groupId, group.AdministrationLastTransactionInfo.TransactionId);
            }
        }
Ejemplo n.º 7
0
        public override void PreProcess(IFeatureChain currentChain, FeatureAccount featureAccount, Transaction transaction, FeatureData featureData)
        {
            var feature   = featureData as AccountIndexBase;
            var featureId = featureData.FeatureId;
            var accountId = featureAccount.AccountId;

            var container = featureAccount.GetFeatureContainer <AccountIndexContainerBase>(featureId);

            if (container != null)
            {
                var info = container.GetLastTransactionInfo(feature.Index);

                _lastTransactionIdLookup.Set(accountId, info.TransactionId);
                _lastTransactionCountLookup.Set(accountId, info.Count);
            }
        }
        public override void PreProcess(IFeatureChain featureChain, FeatureAccount featureAccount, Transaction transaction, FeatureData transactionFeature)
        {
            if (featureAccount == null) // Join
            {
                return;
            }

            var featureId = transactionFeature.FeatureId;
            var accountId = featureAccount.AccountId;

            var container = featureAccount.GetFeatureContainer <PreviousAccountTransactionContainer>(featureId);

            if (container != null)
            {
                var info = container.LastTransactionInfo;

                _lastTransactionIdLookup.Set(accountId, info.TransactionId);
                _lastTransactionCountLookup.Set(accountId, info.Count);
            }
        }
Ejemplo n.º 9
0
 public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 10
0
 public override FeatureAccountContainer RestoreAccountContainer(Unpacker unpacker, ushort size, FeatureAccount featureAccount)
 {
     return(new SharedAccountIndexContainer(unpacker, size, this, featureAccount));
 }
Ejemplo n.º 11
0
 public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount)
 {
     return(new SharedAccountIndexContainer(this, featureAccount));
 }
Ejemplo n.º 12
0
 public abstract FeatureAccountContainer RestoreAccountContainer(Unpacker unpacker, ushort size, FeatureAccount featureAccount);
 public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount)
 {
     return(new PreviousAccountTransactionContainer(this, featureAccount));
 }
 public PreviousAccountTransactionContainer(Unpacker unpacker, ushort size, Feature feature, FeatureAccount featureAccount) : base(unpacker, size, feature, featureAccount)
 {
     LastTransactionInfo = new LastTransactionCountInfo(unpacker);
 }
 public FeatureAccountContainer(Unpacker unpacker, ushort size, Feature feature, FeatureAccount featureAccount) : this(feature, featureAccount)
 {
     AccountId = featureAccount.AccountId;
 }
Ejemplo n.º 16
0
 public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount)
 {
     return(new ReceiverContainer(this, featureAccount));
 }
Ejemplo n.º 17
0
 public ReceiverContainer(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount)
 {
     LastReceiverTransactionInfo = LastTransactionCountInfo.Empty;
 }
Ejemplo n.º 18
0
 public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount)
 {
     return(new FriendContainer(this, featureAccount));
 }
Ejemplo n.º 19
0
 public FriendContainer(Unpacker unpacker, ushort size, Feature feature, FeatureAccount featureAccount) : base(unpacker, size, feature, featureAccount)
 {
     unpacker.Unpack(_friends);
     unpacker.Unpack(_friendInvitations, (u) => new FriendInvitation(AccountId, unpacker));
     LastFriendTransactionInfo = new LastTransactionInfo(unpacker);
 }
Ejemplo n.º 20
0
 public FriendContainer(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount)
 {
     LastFriendTransactionInfo = LastTransactionInfo.Empty;
 }
Ejemplo n.º 21
0
 public abstract void PreProcess(IFeatureChain currentChain, FeatureAccount featureAccount, Transaction transaction, FeatureData featureData);
Ejemplo n.º 22
0
 public override FeatureAccountContainer RestoreAccountContainer(Unpacker unpacker, ushort size, FeatureAccount featureAccount)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 23
0
 public AccountIndexContainerBase(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount)
 {
 }
Ejemplo n.º 24
0
        public AccountIndexContainerBase(Unpacker unpacker, ushort size, Feature feature, FeatureAccount featureAccount) : base(unpacker, size, feature, featureAccount)
        {
            var count = unpacker.UnpackInt();

            for (var i = 0; i < count; i++)
            {
                var key   = new Index(unpacker);
                var value = new LastTransactionCountInfo(unpacker);
                _indices[key] = value;
            }
        }
 public PreviousAccountTransactionContainer(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount)
 {
     LastTransactionInfo = LastTransactionCountInfo.Empty;
 }
Ejemplo n.º 26
0
        public override void ConsumeTransactionFeature(CommitItems commitItems, Commit commit, Transaction transaction, FeatureAccount featureAccount, FeatureData featureData)
        {
            var group   = featureData as Group;
            var groupId = group.GroupId;

            var groupAdministrationInfo = GroupAdministrationChainHandler.GetGroupInfo(groupId);

            if (groupAdministrationInfo != null)
            {
                if (groupAdministrationInfo.IsGroupAccount(transaction.AccountId))
                {
                    var groupInfo = GetGroupInfo(groupId);
                    groupInfo.ConsumeGroup(transaction, group);
                    commit.DirtyIds.Add(groupId);
                }
            }
        }
Ejemplo n.º 27
0
 public SharedAccountIndexContainer(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount)
 {
 }
Ejemplo n.º 28
0
 public SharedAccountIndexContainer(Unpacker unpacker, ushort size, Feature feature, FeatureAccount featureAccount) : base(unpacker, size, feature, featureAccount)
 {
 }
 public override FeatureAccountContainer RestoreAccountContainer(Unpacker unpacker, ushort size, FeatureAccount featureAccount)
 {
     return(new PreviousAccountTransactionContainer(unpacker, size, this, featureAccount));
 }
Ejemplo n.º 30
0
 // server
 public abstract FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount);