From 0bbe7bab7bb60c39b0defeff173287fc66430c26 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Jul 2017 19:00:49 +0100 Subject: add new funtion bool MoveMoney(UUID fromUser, UUID toUser, int amount, MoneyTransactionType type, string text). this should be called async allowing time for money module to process it. If returns true, the transation did sucess, so if its use was to pay something, the payed item/service must be provided without fail, otherwise another method is needed so a refund is possible --- .../Region/CoreModules/World/Land/LandManagementModule.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index e0152a3..1fc4609 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -617,12 +617,15 @@ namespace OpenSim.Region.CoreModules.World.Land return; } - mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost, String.Format("Parcel '{0}' pass sell",ldata.Name)); - // lets try older method -// EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(remote_client.AgentId, ldata.OwnerID, -// cost,(int)MoneyTransactionType.LandPassSale , String.Format("Parcel '{0}' pass sell",ldata.Name)); + string regionName = m_scene.RegionInfo.RegionName; + string payDescription = String.Format("Parcel '{0}' at region '{1} {2:0.###} hours access pass", ldata.Name, regionName, ldata.PassHours); + + if(!mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost,MoneyTransactionType.LandPassSale, payDescription)) + { + remote_client.SendAgentAlertMessage("Sorry pass payment processing failed, please try again later", true); + return; + } -// m_scene.EventManager.TriggerMoneyTransfer(this, args); if (idx != -1) ldata.ParcelAccessList.RemoveAt(idx); ldata.ParcelAccessList.Add(entry); -- cgit v1.1