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; }
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); } }
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); } }
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); } }
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); } }
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); } }
public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount) { throw new NotImplementedException(); }
public override FeatureAccountContainer RestoreAccountContainer(Unpacker unpacker, ushort size, FeatureAccount featureAccount) { return(new SharedAccountIndexContainer(unpacker, size, this, featureAccount)); }
public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount) { return(new SharedAccountIndexContainer(this, featureAccount)); }
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; }
public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount) { return(new ReceiverContainer(this, featureAccount)); }
public ReceiverContainer(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount) { LastReceiverTransactionInfo = LastTransactionCountInfo.Empty; }
public override FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount) { return(new FriendContainer(this, featureAccount)); }
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); }
public FriendContainer(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount) { LastFriendTransactionInfo = LastTransactionInfo.Empty; }
public abstract void PreProcess(IFeatureChain currentChain, FeatureAccount featureAccount, Transaction transaction, FeatureData featureData);
public override FeatureAccountContainer RestoreAccountContainer(Unpacker unpacker, ushort size, FeatureAccount featureAccount) { throw new NotImplementedException(); }
public AccountIndexContainerBase(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount) { }
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; }
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); } } }
public SharedAccountIndexContainer(Feature feature, FeatureAccount featureAccount) : base(feature, featureAccount) { }
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)); }
// server public abstract FeatureAccountContainer NewAccountContainer(FeatureAccount featureAccount);