/** <summary> Process a transaction for paying a user by a group</summary>
         * <exception cref="InsufficientFundsException">this exception is thrown when not enough funds are available</exception>
         * <exception cref="NotSupportedException">this exception is thrown when the economy service does not support group accounts</exception>
         */
        public void TransferMoney(UGI sourceID, UGUI destinationID, BaseTransaction transactionData, int amount, Action processOperation)
        {
            IActiveTransaction transaction = BeginTransferTransaction(sourceID, destinationID, transactionData, amount);

            try
            {
                processOperation();
            }
            catch (Exception e)
            {
                transaction.Rollback(e);
                throw;
            }
            transaction.Commit();
        }
        public void ChargeAmount(UGUI agentID, BaseTransaction transactionData, int amount, Action processOperation)
        {
            IActiveTransaction transaction = BeginChargeTransaction(agentID, transactionData, amount);

            try
            {
                processOperation();
            }
            catch (Exception e)
            {
                transaction.Rollback(e);
                throw;
            }
            transaction.Commit();
        }
Пример #3
0
 public override void AssetTransferFailed(Exception e)
 {
     base.AssetTransferFailed(e);
     m_Transaction?.Rollback(e);
 }