diff options
author | Melanie Thielker | 2008-11-23 20:39:51 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-11-23 20:39:51 +0000 |
commit | fba9e3f513a0d9b4e0ccaf5a9fe24899d96e98c8 (patch) | |
tree | f5e20ebb72cb0e7cb1c9b2ae29f9db464eda726e /OpenSim/Region/Environment/Modules | |
parent | Try to keep autoreturn from IM spamming users if the prims take a bit (diff) | |
download | opensim-SC-fba9e3f513a0d9b4e0ccaf5a9fe24899d96e98c8.zip opensim-SC-fba9e3f513a0d9b4e0ccaf5a9fe24899d96e98c8.tar.gz opensim-SC-fba9e3f513a0d9b4e0ccaf5a9fe24899d96e98c8.tar.bz2 opensim-SC-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/Modules')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs | 22 |
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; | |||
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Environment.Interfaces; | 34 | using OpenSim.Region.Environment.Interfaces; |
35 | using OpenSim.Region.Environment.Scenes; | 35 | using OpenSim.Region.Environment.Scenes; |
36 | using OpenSim.Framework.Communications.Cache; | ||
36 | using BlockingQueue = OpenSim.Framework.BlockingQueue<OpenSim.Region.Environment.Interfaces.ITextureSender>; | 37 | using BlockingQueue = OpenSim.Framework.BlockingQueue<OpenSim.Region.Environment.Interfaces.ITextureSender>; |
37 | 38 | ||
38 | namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | 39 | namespace 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)) |