From c3666c9ec3f0e32443094fbcb683dec7b457a3e6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 17 Sep 2012 19:38:05 +0100 Subject: [PATCH] make sure client still has money at upload --- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index ddb69c4a8e..4ba8254352 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -489,6 +489,7 @@ namespace OpenSim.Region.ClientStack.Linden cost = (uint)baseCost; } + // check funds if (mm != null) { if (!mm.UploadCovered(client.AgentId, (int)cost)) @@ -565,6 +566,21 @@ namespace OpenSim.Region.ClientStack.Linden sbyte assType = 0; sbyte inType = 0; + IClientAPI client = null; + + IMoneyModule mm = m_Scene.RequestModuleInterface(); + if (mm != null) + { + // make sure client still has enougth credit + if (!mm.UploadCovered(m_HostCapsObj.AgentID, (int)cost)) + { + m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client); + if (client != null) + client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); + return; + } + } + if (inventoryType == "sound") { inType = 1;