aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-23 20:39:51 +0000
committerMelanie Thielker2008-11-23 20:39:51 +0000
commitfba9e3f513a0d9b4e0ccaf5a9fe24899d96e98c8 (patch)
treef5e20ebb72cb0e7cb1c9b2ae29f9db464eda726e /OpenSim/Region/Environment
parentTry to keep autoreturn from IM spamming users if the prims take a bit (diff)
downloadopensim-SC_OLD-fba9e3f513a0d9b4e0ccaf5a9fe24899d96e98c8.zip
opensim-SC_OLD-fba9e3f513a0d9b4e0ccaf5a9fe24899d96e98c8.tar.gz
opensim-SC_OLD-fba9e3f513a0d9b4e0ccaf5a9fe24899d96e98c8.tar.bz2
opensim-SC_OLD-fba9e3f513a0d9b4e0ccaf5a9fe24899d96e98c8.tar.xz
Don't serve texture preview from other people's objects if you
havenever seen that texture before.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
index af51df6..8e56afb 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
@@ -33,6 +33,7 @@ using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Region.Environment.Interfaces; 34using OpenSim.Region.Environment.Interfaces;
35using OpenSim.Region.Environment.Scenes; 35using OpenSim.Region.Environment.Scenes;
36using OpenSim.Framework.Communications.Cache;
36using BlockingQueue = OpenSim.Framework.BlockingQueue<OpenSim.Region.Environment.Interfaces.ITextureSender>; 37using BlockingQueue = OpenSim.Framework.BlockingQueue<OpenSim.Region.Environment.Interfaces.ITextureSender>;
37 38
38namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload 39namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
@@ -161,6 +162,27 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
161 public void TextureRequest(Object sender, TextureRequestArgs e) 162 public void TextureRequest(Object sender, TextureRequestArgs e)
162 { 163 {
163 IClientAPI client = (IClientAPI) sender; 164 IClientAPI client = (IClientAPI) sender;
165
166 if (e.Priority == 1016001f) // Preview
167 {
168 if (client.Scene is Scene)
169 {
170 Scene scene = (Scene)client.Scene;
171
172 CachedUserInfo profile = scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId);
173 if (profile == null) // Deny unknown user
174 return;
175
176 if (profile.RootFolder == null) // Deny no inventory
177 return;
178
179 if (profile.UserProfile.GodLevel < 200 && profile.RootFolder.FindAsset(e.RequestedAssetID) == null) // Deny if not owned
180 return;
181
182 m_log.Debug("Texture preview");
183 }
184 }
185
164 UserTextureDownloadService textureService; 186 UserTextureDownloadService textureService;
165 187
166 if (TryGetUserTextureService(client, out textureService)) 188 if (TryGetUserTextureService(client, out textureService))