aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs34
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs44
2 files changed, 58 insertions, 20 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 = "";
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
index 1117f2a..91872c5 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
@@ -56,6 +56,7 @@ namespace OpenSim.Region.ClientStack.Linden
56// private IAssetService m_assetService; 56// private IAssetService m_assetService;
57 private bool m_dumpAssetsToFile = false; 57 private bool m_dumpAssetsToFile = false;
58 private bool m_enabled = true; 58 private bool m_enabled = true;
59 private int m_levelUpload = 0;
59 60
60 #region IRegionModuleBase Members 61 #region IRegionModuleBase Members
61 62
@@ -72,6 +73,7 @@ namespace OpenSim.Region.ClientStack.Linden
72 return; 73 return;
73 74
74 m_enabled = meshConfig.GetBoolean("AllowMeshUpload", true); 75 m_enabled = meshConfig.GetBoolean("AllowMeshUpload", true);
76 m_levelUpload = meshConfig.GetInt("LevelUpload", 0);
75 } 77 }
76 78
77 public void AddRegion(Scene pScene) 79 public void AddRegion(Scene pScene)
@@ -137,25 +139,41 @@ namespace OpenSim.Region.ClientStack.Linden
137 // llsdRequest.asset_type == "animation" || 139 // llsdRequest.asset_type == "animation" ||
138 // llsdRequest.asset_type == "sound") 140 // llsdRequest.asset_type == "sound")
139 // { 141 // {
142 // check user level
143 ScenePresence avatar = null;
140 IClientAPI client = null; 144 IClientAPI client = null;
145 m_scene.TryGetScenePresence(agentID, out avatar);
141 146
142 147 if (avatar != null)
148 {
149 client = avatar.ControllingClient;
150
151 if (avatar.UserLevel < m_levelUpload)
152 {
153 if (client != null)
154 client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false);
155
156 LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
157 errorResponse.rsvp = "";
158 errorResponse.state = "error";
159 return errorResponse;
160 }
161 }
162
163 // check funds
143 IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>(); 164 IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>();
144 165
145 if (mm != null) 166 if (mm != null)
146 { 167 {
147 if (m_scene.TryGetClient(agentID, out client)) 168 if (!mm.UploadCovered(agentID, mm.UploadCharge))
148 { 169 {
149 if (!mm.UploadCovered(client.AgentId, mm.UploadCharge)) 170 if (client != null)
150 { 171 client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
151 if (client != null) 172
152 client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); 173 LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
153 174 errorResponse.rsvp = "";
154 LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse(); 175 errorResponse.state = "error";
155 errorResponse.rsvp = ""; 176 return errorResponse;
156 errorResponse.state = "error";
157 return errorResponse;
158 }
159 } 177 }
160 } 178 }
161 // } 179 // }