aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
diff options
context:
space:
mode:
authorMelanie2012-03-27 23:14:43 +0100
committerMelanie2012-03-27 23:14:43 +0100
commitb18b1b1d700d4a5ffd306e5b69a08b241188c525 (patch)
tree2bb99cd8095a9b562f9ee075274508da973dd2a2 /OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
parentMerge branch 'master' into careminster (diff)
parentReverse a conditional in XInventory that made updating system folder evrsion ... (diff)
downloadopensim-SC_OLD-b18b1b1d700d4a5ffd306e5b69a08b241188c525.zip
opensim-SC_OLD-b18b1b1d700d4a5ffd306e5b69a08b241188c525.tar.gz
opensim-SC_OLD-b18b1b1d700d4a5ffd306e5b69a08b241188c525.tar.bz2
opensim-SC_OLD-b18b1b1d700d4a5ffd306e5b69a08b241188c525.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs34
1 files changed, 27 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 0103761..ef6dedb 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -114,6 +114,7 @@ namespace OpenSim.Region.ClientStack.Linden
114 private IAssetService m_assetService; 114 private IAssetService m_assetService;
115 private bool m_dumpAssetsToFile = false; 115 private bool m_dumpAssetsToFile = false;
116 private string m_regionName; 116 private string m_regionName;
117 private int m_levelUpload = 0;
117 118
118 public BunchOfCaps(Scene scene, Caps caps) 119 public BunchOfCaps(Scene scene, Caps caps)
119 { 120 {
@@ -124,7 +125,10 @@ namespace OpenSim.Region.ClientStack.Linden
124 { 125 {
125 IConfig sconfig = config.Configs["Startup"]; 126 IConfig sconfig = config.Configs["Startup"];
126 if (sconfig != null) 127 if (sconfig != null)
128 {
127 m_persistBakedTextures = sconfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures); 129 m_persistBakedTextures = sconfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
130 m_levelUpload = sconfig.GetInt("LevelUpload", 0);
131 }
128 } 132 }
129 133
130 m_assetService = m_Scene.AssetService; 134 m_assetService = m_Scene.AssetService;
@@ -367,21 +371,37 @@ namespace OpenSim.Region.ClientStack.Linden
367 llsdRequest.asset_type == "animation" || 371 llsdRequest.asset_type == "animation" ||
368 llsdRequest.asset_type == "sound") 372 llsdRequest.asset_type == "sound")
369 { 373 {
374 ScenePresence avatar = null;
370 IClientAPI client = null; 375 IClientAPI client = null;
371 IScene scene = null; 376 m_Scene.TryGetScenePresence(m_HostCapsObj.AgentID, out avatar);
372 if (GetClient != null) 377
378 // check user level
379 if (avatar != null)
373 { 380 {
374 client = GetClient(m_HostCapsObj.AgentID); 381 client = avatar.ControllingClient;
375 scene = client.Scene; 382
383 if (avatar.UserLevel < m_levelUpload)
384 {
385 if (client != null)
386 client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false);
376 387
377 IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>(); 388 LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse();
389 errorResponse.uploader = "";
390 errorResponse.state = "error";
391 return errorResponse;
392 }
393 }
394
395 // check funds
396 if (client != null)
397 {
398 IMoneyModule mm = m_Scene.RequestModuleInterface<IMoneyModule>();
378 399
379 if (mm != null) 400 if (mm != null)
380 { 401 {
381 if (!mm.UploadCovered(client.AgentId, mm.UploadCharge)) 402 if (!mm.UploadCovered(client.AgentId, mm.UploadCharge))
382 { 403 {
383 if (client != null) 404 client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
384 client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
385 405
386 LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); 406 LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse();
387 errorResponse.uploader = ""; 407 errorResponse.uploader = "";