diff options
author | Melanie Thielker | 2008-08-23 00:44:06 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-08-23 00:44:06 +0000 |
commit | 5d6f92fb9697dc09d26bba236846809c737fc5c0 (patch) | |
tree | 76637af39aaea0b30a19f322cadcdac5e301cb3f /OpenSim/Framework/Communications | |
parent | * Homer's amazing terrain MapTileRenderer. Thanks Homer! (diff) | |
download | opensim-SC-5d6f92fb9697dc09d26bba236846809c737fc5c0.zip opensim-SC-5d6f92fb9697dc09d26bba236846809c737fc5c0.tar.gz opensim-SC-5d6f92fb9697dc09d26bba236846809c737fc5c0.tar.bz2 opensim-SC-5d6f92fb9697dc09d26bba236846809c737fc5c0.tar.xz |
Patch #9171
Disallow bulk uploads if money module is present and upload cost
is set and the user hasn't got sufficient funds.
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r-- | OpenSim/Framework/Communications/Capabilities/Caps.cs | 26 |
1 files changed, 26 insertions, 0 deletions
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; | |||
34 | using log4net; | 34 | using log4net; |
35 | using OpenSim.Framework.Communications.Cache; | 35 | using OpenSim.Framework.Communications.Cache; |
36 | using OpenSim.Framework.Servers; | 36 | using OpenSim.Framework.Servers; |
37 | using OpenSim.Framework; | ||
38 | using OpenSim.Region.Environment.Interfaces; | ||
39 | using OpenSim.Region.Environment.Scenes; | ||
37 | 40 | ||
38 | namespace OpenSim.Framework.Communications.Capabilities | 41 | namespace OpenSim.Framework.Communications.Capabilities |
39 | { | 42 | { |
@@ -606,6 +609,29 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
606 | /// <returns></returns> | 609 | /// <returns></returns> |
607 | public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) | 610 | public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) |
608 | { | 611 | { |
612 | if (llsdRequest.asset_type == "texture" || | ||
613 | llsdRequest.asset_type == "animation" || | ||
614 | llsdRequest.asset_type == "sound") | ||
615 | { | ||
616 | IClientAPI client = GetClient(m_agentID); | ||
617 | Scene scene = (Scene)client.Scene; | ||
618 | |||
619 | IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>(); | ||
620 | |||
621 | if(mm != null) | ||
622 | { | ||
623 | if(!mm.UploadCovered(client)) | ||
624 | { | ||
625 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | ||
626 | |||
627 | LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); | ||
628 | errorResponse.uploader = ""; | ||
629 | errorResponse.state = "error"; | ||
630 | return errorResponse; | ||
631 | } | ||
632 | } | ||
633 | } | ||
634 | |||
609 | //Console.WriteLine("asset upload request via CAPS" + llsdRequest.inventory_type +" , "+ llsdRequest.asset_type); | 635 | //Console.WriteLine("asset upload request via CAPS" + llsdRequest.inventory_type +" , "+ llsdRequest.asset_type); |
610 | 636 | ||
611 | string assetName = llsdRequest.name; | 637 | string assetName = llsdRequest.name; |