diff -Nur aurora-/Aurora/AuroraDotNetEngine/EventManager.cs aurora/Aurora/AuroraDotNetEngine/EventManager.cs --- aurora-/Aurora/AuroraDotNetEngine/EventManager.cs 2011-08-29 13:59:12.000000000 +0900 +++ aurora/Aurora/AuroraDotNetEngine/EventManager.cs 2011-08-30 14:49:31.000000000 +0900 @@ -118,53 +118,22 @@ if (money != null) { money.OnObjectPaid += HandleObjectPaid; - money.OnPostObjectPaid += HandlePostObjectPaid; } } - //private void HandleObjectPaid(UUID objectID, UUID agentID, int amount) - private bool HandleObjectPaid(UUID objectID, UUID agentID, int amount) + private void HandleObjectPaid(UUID objectID, UUID agentID, int amount) { - bool ret = false; ISceneChildEntity part = m_scriptEngine.findPrim(objectID); - //if (part == null) - // return; + if (part == null) return; - //m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); - //if (part.ParentGroup != null) - // part = part.ParentGroup.RootPart; + m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); + if (part.ParentEntity != null) part = part.ParentEntity.RootChild; - //if (part != null) - //{ - // money(part.LocalId, agentID, amount); - //} - if (part != null) + if (part != null) { - m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); - if (part.ParentEntity != null) part = part.ParentEntity.RootChild; - if (part != null) - { - ret = money(part.LocalId, agentID, amount); - } + money(part.LocalId, agentID, amount); } - return ret; - } - - private bool HandlePostObjectPaid(uint localID, ulong regionHandle, UUID agentID, int amount) - { - bool ret = true; - - foreach (IScene scene in m_scriptEngine.Worlds) - { - if (scene.RegionInfo.RegionHandle == regionHandle) - { - ret = money(localID, agentID, amount); - break; - } - } - - return ret; } public void changed (ISceneChildEntity part, uint change) @@ -311,19 +280,18 @@ CoalescedTouchEvents[part.LocalId] = det; } - //public void money(uint localID, UUID agentID, int amount) - public bool money(uint localID, UUID agentID, int amount) + public void money(uint localID, UUID agentID, int amount) { - bool ret = false; ISceneChildEntity part = m_scriptEngine.findPrim(localID); - if (part == null) return ret; + if (part == null) return; ScriptData[] datas = ScriptEngine.ScriptProtection.GetScripts(part.UUID); if (datas == null || datas.Length == 0) { - datas = ScriptEngine.ScriptProtection.GetScripts(part.ParentEntity.UUID); - if (datas == null || datas.Length == 0) return ret; + //datas = ScriptEngine.ScriptProtection.GetScripts(part.ParentEntity.UUID); + //if (datas == null || datas.Length == 0) + return; } string functionName = "money"; object[] param = new object[] { @@ -334,10 +302,8 @@ { if (CheckIfEventShouldFire(ID, functionName, param)) { m_scriptEngine.AddToScriptQueue(ID, functionName, new DetectParams[0], EventPriority.FirstStart, param); - ret = true; } } - return ret; } public void collision_start (ISceneChildEntity part, ColliderArgs col) diff -Nur aurora-/Aurora/AuroraDotNetEngine4/EventManager.cs aurora/Aurora/AuroraDotNetEngine4/EventManager.cs --- aurora-/Aurora/AuroraDotNetEngine4/EventManager.cs 2011-08-29 13:59:12.000000000 +0900 +++ aurora/Aurora/AuroraDotNetEngine4/EventManager.cs 2011-08-30 14:49:31.000000000 +0900 @@ -122,53 +122,22 @@ if (money != null) { money.OnObjectPaid += HandleObjectPaid; - money.OnPostObjectPaid += HandlePostObjectPaid; } } - //private void HandleObjectPaid(UUID objectID, UUID agentID, int amount) - private bool HandleObjectPaid(UUID objectID, UUID agentID, int amount) + private void HandleObjectPaid(UUID objectID, UUID agentID, int amount) { - bool ret = false; ISceneChildEntity part = m_scriptEngine.findPrim(objectID); - //if (part == null) - // return; + if (part == null) return; - //m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); - //if (part.ParentGroup != null) - // part = part.ParentGroup.RootPart; + m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); + if (part.ParentEntity != null) part = part.ParentEntity.RootChild; - //if (part != null) - //{ - // money(part.LocalId, agentID, amount); - //} - if (part != null) + if (part != null) { - m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); - if (part.ParentEntity != null) part = part.ParentEntity.RootChild; - if (part != null) - { - ret = money(part.LocalId, agentID, amount); - } + money(part.LocalId, agentID, amount); } - return ret; - } - - private bool HandlePostObjectPaid(uint localID, ulong regionHandle, UUID agentID, int amount) - { - bool ret = true; - - foreach (Scene scene in m_Scenes) - { - if (scene.RegionInfo.RegionHandle == regionHandle) - { - ret = money(localID, agentID, amount); - break; - } - } - - return ret; } public void changed (ISceneChildEntity part, uint change) @@ -315,19 +284,18 @@ CoalescedTouchEvents[part.LocalId] = det; } - //public void money(uint localID, UUID agentID, int amount) - public bool money(uint localID, UUID agentID, int amount) + public void money(uint localID, UUID agentID, int amount) { - bool ret = false; ISceneChildEntity part = m_scriptEngine.findPrim(localID); - if (part == null) return ret; + if (part == null) return; ScriptData[] datas = ScriptEngine.ScriptProtection.GetScripts(part.UUID); if (datas == null || datas.Length == 0) { - datas = ScriptEngine.ScriptProtection.GetScripts(part.ParentEntity.UUID); - if (datas == null || datas.Length == 0) return ret; + //datas = ScriptEngine.ScriptProtection.GetScripts(part.ParentEntity.UUID); + //if (datas == null || datas.Length == 0) + return; } string functionName = "money"; object[] param = new object[] { @@ -338,10 +306,8 @@ { if (CheckIfEventShouldFire(ID, functionName, param)) { m_scriptEngine.AddToScriptQueue(ID, functionName, new DetectParams[0], ID.VersionID, param); - ret = true; } } - return ret; } public void collision_start (ISceneChildEntity part, ColliderArgs col) diff -Nur aurora-/Aurora/Modules/World/SampleCurrencyModule/SampleCurrencyModule.cs aurora/Aurora/Modules/World/SampleCurrencyModule/SampleCurrencyModule.cs --- aurora-/Aurora/Modules/World/SampleCurrencyModule/SampleCurrencyModule.cs 2011-08-29 13:59:12.000000000 +0900 +++ aurora/Aurora/Modules/World/SampleCurrencyModule/SampleCurrencyModule.cs 2011-08-30 14:49:31.000000000 +0900 @@ -71,7 +71,7 @@ #pragma warning disable 67 public event ObjectPaid OnObjectPaid; - public event PostObjectPaid OnPostObjectPaid; + //public event PostObjectPaid OnPostObjectPaid; public bool Transfer(UUID toID, UUID fromID, int amount, string description) { return true; @@ -82,9 +82,14 @@ return true; } + public bool Transfer(UUID toID, UUID fromID, int id, int amount, string description, TransactionType type) + { + return true; + } + public bool Transfer(UUID toID, UUID fromID, UUID toObjectID, UUID fromObjectID, int amount, string description, TransactionType type) { - if ((type == TransactionType.ObjectPay) && (OnObjectPaid != null)) + if ((type == TransactionType.PayObject) && (OnObjectPaid != null)) OnObjectPaid((fromObjectID == UUID.Zero) ? toObjectID : fromObjectID, fromID, amount); return true; } diff -Nur aurora-/OpenSim/Framework/IMoneyModule.cs aurora/OpenSim/Framework/IMoneyModule.cs --- aurora-/OpenSim/Framework/IMoneyModule.cs 2011-08-29 13:59:12.000000000 +0900 +++ aurora/OpenSim/Framework/IMoneyModule.cs 2011-08-30 14:49:31.000000000 +0900 @@ -29,26 +29,29 @@ namespace OpenSim.Framework { - //public delegate void ObjectPaid(UUID objectID, UUID agentID, int amount); - // For legacy money module. Fumi.Iseki - public delegate bool ObjectPaid(UUID objectID, UUID agentID, int amount); - // For DTL money module. - public delegate bool PostObjectPaid(uint localID, ulong regionHandle, UUID agentID, int amount); + public delegate void ObjectPaid(UUID objectID, UUID agentID, int amount); public enum TransactionType { - SystemGenerated = 0, - RegionMoneyRequest = 1, - Gift = 2, - Purchase = 3, - Upload = 4, - ObjectPay = 5008 + GroupCreate = 1002, + GroupJoin = 1004, + UploadCharge = 1101, + LandAuction = 1102, + ObjectSale = 5000, + Gift = 5001, + LandSale = 5002, + ReferBonus = 5003, + InvntorySale = 5004, + DwellBonus = 5007, + PayObject = 5008, + ObjectPays = 5009, + BuyMoney = 5010, + MoveMoney = 5011 } public interface IMoneyModule { - bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, - int amount); + bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount); int Balance(IClientAPI client); bool Charge(IClientAPI client, int amount); @@ -58,10 +61,11 @@ int GroupCreationCharge { get; } event ObjectPaid OnObjectPaid; - event PostObjectPaid OnPostObjectPaid; + //event PostObjectPaid OnPostObjectPaid; - bool Transfer(UUID toID, UUID fromID, int amount, string description); - bool Transfer(UUID toID, UUID fromID, int amount, string description, TransactionType type); + //bool Transfer(UUID toID, UUID fromID, int amount, string description); + //bool Transfer(UUID toID, UUID fromID, int amount, string description, TransactionType type); + bool Transfer(UUID toID, UUID fromID, int parcelID, int amount, string description, TransactionType type); bool Transfer(UUID toID, UUID fromID, UUID toObjectID, UUID fromObjectID, int amount, string description, TransactionType type); } } diff -Nur aurora-/OpenSim/Region/CoreModules/World/Land/ParcelManagementModule.cs aurora/OpenSim/Region/CoreModules/World/Land/ParcelManagementModule.cs --- aurora-/OpenSim/Region/CoreModules/World/Land/ParcelManagementModule.cs 2011-08-29 13:59:12.000000000 +0900 +++ aurora/OpenSim/Region/CoreModules/World/Land/ParcelManagementModule.cs 2011-08-30 14:49:31.000000000 +0900 @@ -1202,7 +1202,9 @@ IMoneyModule module = m_scene.RequestModuleInterface(); if (module != null) - if (!module.Transfer(landObject.LandData.OwnerID, client.AgentId, landObject.LandData.PassPrice, "Parcel Pass")) + //if (!module.Transfer(landObject.LandData.OwnerID, client.AgentId, landObject.LandData.PassPrice, "Parcel Pass")) + if (!module.Transfer(landObject.LandData.OwnerID, client.AgentId, ParcelLocalID, + landObject.LandData.PassPrice, "Parcel Pass", TransactionType.LandSale)) { client.SendAlertMessage("You do not have enough funds to complete this transaction."); return; diff -Nur aurora-/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs aurora/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs --- aurora-/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs 2011-08-29 13:59:12.000000000 +0900 +++ aurora/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs 2011-08-30 14:49:31.000000000 +0900 @@ -157,7 +157,7 @@ IMoneyModule moneyMod = remoteClient.Scene.RequestModuleInterface(); if (moneyMod != null) { - if (!moneyMod.Transfer(part.OwnerID, remoteClient.AgentId, part.ParentUUID, UUID.Zero, part.SalePrice, "Object Purchase", TransactionType.ObjectPay)) + if (!moneyMod.Transfer(part.OwnerID, remoteClient.AgentId, part.ParentUUID, UUID.Zero, part.SalePrice, "Object Purchase", TransactionType.PayObject)) { remoteClient.SendAgentAlertMessage("You do not have enough money to buy this object.", false); return;