From 5d6f92fb9697dc09d26bba236846809c737fc5c0 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 23 Aug 2008 00:44:06 +0000 Subject: Patch #9171 Disallow bulk uploads if money module is present and upload cost is set and the user hasn't got sufficient funds. --- .../Framework/Communications/Capabilities/Caps.cs | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 24fe0f4..338604d 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -34,6 +34,9 @@ using libsecondlife; using log4net; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; +using OpenSim.Framework; +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; namespace OpenSim.Framework.Communications.Capabilities { @@ -606,6 +609,29 @@ namespace OpenSim.Framework.Communications.Capabilities /// public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) { + if (llsdRequest.asset_type == "texture" || + llsdRequest.asset_type == "animation" || + llsdRequest.asset_type == "sound") + { + IClientAPI client = GetClient(m_agentID); + Scene scene = (Scene)client.Scene; + + IMoneyModule mm = scene.RequestModuleInterface(); + + if(mm != null) + { + if(!mm.UploadCovered(client)) + { + client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); + + LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); + errorResponse.uploader = ""; + errorResponse.state = "error"; + return errorResponse; + } + } + } + //Console.WriteLine("asset upload request via CAPS" + llsdRequest.inventory_type +" , "+ llsdRequest.asset_type); string assetName = llsdRequest.name; -- cgit v1.1