aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-07-21 14:25:21 +0100
committerJustin Clark-Casey (justincc)2010-07-21 14:25:21 +0100
commit8e67f6dc44424a53f07cd0c2af0ecf53d7ca30b7 (patch)
treeb2e123604f241fbb01c022017495504d98ab9f62 /OpenSim
parentadd missing regionstore migration file for new fields. D'oh! (diff)
downloadopensim-SC_OLD-8e67f6dc44424a53f07cd0c2af0ecf53d7ca30b7.zip
opensim-SC_OLD-8e67f6dc44424a53f07cd0c2af0ecf53d7ca30b7.tar.gz
opensim-SC_OLD-8e67f6dc44424a53f07cd0c2af0ecf53d7ca30b7.tar.bz2
opensim-SC_OLD-8e67f6dc44424a53f07cd0c2af0ecf53d7ca30b7.tar.xz
start adding user ids to the media urls
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs28
1 files changed, 16 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
index cbe9af2..6755df7 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
@@ -189,7 +189,7 @@ namespace OpenSim.Region.CoreModules.Media.Moap
189 part.Shape.Media = new List<MediaEntry>(new MediaEntry[part.GetNumberOfSides()]); 189 part.Shape.Media = new List<MediaEntry>(new MediaEntry[part.GetNumberOfSides()]);
190 190
191 part.Shape.Media[face] = me; 191 part.Shape.Media[face] = me;
192 UpdateMediaUrl(part); 192 UpdateMediaUrl(part, UUID.Zero);
193 part.ScheduleFullUpdate(); 193 part.ScheduleFullUpdate();
194 part.TriggerScriptChangedEvent(Changed.MEDIA); 194 part.TriggerScriptChangedEvent(Changed.MEDIA);
195 } 195 }
@@ -300,6 +300,11 @@ namespace OpenSim.Region.CoreModules.Media.Moap
300 return string.Empty; 300 return string.Empty;
301 } 301 }
302 302
303 UUID agentId = default(UUID);
304
305 lock (m_omCapUsers)
306 agentId = m_omCapUsers[path];
307
303 List<MediaEntry> media = part.Shape.Media; 308 List<MediaEntry> media = part.Shape.Media;
304 309
305 if (null == media) 310 if (null == media)
@@ -310,12 +315,7 @@ namespace OpenSim.Region.CoreModules.Media.Moap
310 else 315 else
311 { 316 {
312 // We need to go through the media textures one at a time to make sure that we have permission 317 // We need to go through the media textures one at a time to make sure that we have permission
313 // to change them 318 // to change them
314 UUID agentId = default(UUID);
315
316 lock (m_omCapUsers)
317 agentId = m_omCapUsers[path];
318
319 for (int i = 0; i < media.Count; i++) 319 for (int i = 0; i < media.Count; i++)
320 { 320 {
321 if (m_scene.Permissions.CanControlPrimMedia(agentId, part.UUID, i)) 321 if (m_scene.Permissions.CanControlPrimMedia(agentId, part.UUID, i))
@@ -326,7 +326,7 @@ namespace OpenSim.Region.CoreModules.Media.Moap
326 } 326 }
327 } 327 }
328 328
329 UpdateMediaUrl(part); 329 UpdateMediaUrl(part, agentId);
330 330
331 // Arguably, we could avoid sending a full update to the avatar that just changed the texture. 331 // Arguably, we could avoid sending a full update to the avatar that just changed the texture.
332 part.ScheduleFullUpdate(); 332 part.ScheduleFullUpdate();
@@ -402,13 +402,13 @@ namespace OpenSim.Region.CoreModules.Media.Moap
402 402
403 me.CurrentURL = omn.URL; 403 me.CurrentURL = omn.URL;
404 404
405 UpdateMediaUrl(part); 405 UpdateMediaUrl(part, agentId);
406 406
407 part.ScheduleFullUpdate(); 407 part.ScheduleFullUpdate();
408 408
409 part.TriggerScriptChangedEvent(Changed.MEDIA); 409 part.TriggerScriptChangedEvent(Changed.MEDIA);
410 410
411 return string.Empty; 411 return OSDParser.SerializeLLSDXmlString(new OSD());
412 } 412 }
413 413
414 /// <summary> 414 /// <summary>
@@ -431,12 +431,16 @@ namespace OpenSim.Region.CoreModules.Media.Moap
431 /// Update the media url of the given part 431 /// Update the media url of the given part
432 /// </summary> 432 /// </summary>
433 /// <param name="part"></param> 433 /// <param name="part"></param>
434 protected void UpdateMediaUrl(SceneObjectPart part) 434 /// <param name="updateId">
435 /// The id to attach to this update. Normally, this is the user that changed the
436 /// texture
437 /// </param>
438 protected void UpdateMediaUrl(SceneObjectPart part, UUID updateId)
435 { 439 {
436 if (null == part.MediaUrl) 440 if (null == part.MediaUrl)
437 { 441 {
438 // TODO: We can't set the last changer until we start tracking which cap we give to which agent id 442 // TODO: We can't set the last changer until we start tracking which cap we give to which agent id
439 part.MediaUrl = "x-mv:0000000000/" + UUID.Zero; 443 part.MediaUrl = "x-mv:0000000000/" + updateId;
440 } 444 }
441 else 445 else
442 { 446 {