예제 #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;
 }
예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #9
0
 public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount)
 {
     throw new NotImplementedException();
 }
예제 #10
0
 public override FeatureAccountContainer RestoreAccountContainer(Unpacker unpacker, ushort size, FeatureAccount featureAccount)
 {
     return(new SharedAccountIndexContainer(unpacker, size, this, featureAccount));
 }
예제 #11
0
 public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount)
 {
     return(new SharedAccountIndexContainer(this, featureAccount));
 }
예제 #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;
 }
예제 #16
0
 public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount)
 {
     return(new ReceiverContainer(this, featureAccount));
 }
예제 #17
0
 public ReceiverContainer(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount)
 {
     LastReceiverTransactionInfo = LastTransactionCountInfo.Empty;
 }
예제 #18
0
 public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount)
 {
     return(new FriendContainer(this, featureAccount));
 }
예제 #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);
 }
예제 #20
0
 public FriendContainer(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount)
 {
     LastFriendTransactionInfo = LastTransactionInfo.Empty;
 }
예제 #21
0
 public abstract void PreProcess(IFeatureChain currentChain, FeatureAccount featureAccount, Transaction transaction, FeatureData featureData);
예제 #22
0
 public override FeatureAccountContainer RestoreAccountContainer(Unpacker unpacker, ushort size, FeatureAccount featureAccount)
 {
     throw new NotImplementedException();
 }
예제 #23
0
 public AccountIndexContainerBase(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount)
 {
 }
예제 #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;
 }
예제 #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);
                }
            }
        }
예제 #27
0
 public SharedAccountIndexContainer(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount)
 {
 }
예제 #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));
 }
예제 #30
0
 // server
 public abstract FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount);