diff options
Diffstat (limited to 'OpenSim/Region')
-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)) |