aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-23 00:44:06 +0000
committerMelanie Thielker2008-08-23 00:44:06 +0000
commit5d6f92fb9697dc09d26bba236846809c737fc5c0 (patch)
tree76637af39aaea0b30a19f322cadcdac5e301cb3f /OpenSim/Framework/Communications
parent* Homer's amazing terrain MapTileRenderer. Thanks Homer! (diff)
downloadopensim-SC_OLD-5d6f92fb9697dc09d26bba236846809c737fc5c0.zip
opensim-SC_OLD-5d6f92fb9697dc09d26bba236846809c737fc5c0.tar.gz
opensim-SC_OLD-5d6f92fb9697dc09d26bba236846809c737fc5c0.tar.bz2
opensim-SC_OLD-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.cs26
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;
34using log4net; 34using log4net;
35using OpenSim.Framework.Communications.Cache; 35using OpenSim.Framework.Communications.Cache;
36using OpenSim.Framework.Servers; 36using OpenSim.Framework.Servers;
37using OpenSim.Framework;
38using OpenSim.Region.Environment.Interfaces;
39using OpenSim.Region.Environment.Scenes;
37 40
38namespace OpenSim.Framework.Communications.Capabilities 41namespace 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;