aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs44
1 files changed, 37 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
index b4ec7ae..dedd37f 100644
--- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -66,15 +66,37 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
66 /// <param name="data"></param> 66 /// <param name="data"></param>
67 public void ReturnData(UUID id, byte[] data) 67 public void ReturnData(UUID id, byte[] data)
68 { 68 {
69 if (Updaters.ContainsKey(id)) 69
70 DynamicTextureUpdater updater = null;
71
72 lock(Updaters)
73 {
74 if (Updaters.ContainsKey(id))
75 {
76 updater = Updaters[id];
77 }
78 }
79
80 if(updater != null)
70 { 81 {
71 DynamicTextureUpdater updater = Updaters[id];
72 if (RegisteredScenes.ContainsKey(updater.SimUUID)) 82 if (RegisteredScenes.ContainsKey(updater.SimUUID))
73 { 83 {
74 Scene scene = RegisteredScenes[updater.SimUUID]; 84 Scene scene = RegisteredScenes[updater.SimUUID];
75 updater.DataReceived(data, scene); 85 updater.DataReceived(data, scene);
76 } 86 }
77 } 87 }
88
89 if(updater.UpdateTimer == 0)
90 {
91 lock(Updaters)
92 {
93 if (!Updaters.ContainsKey(updater.UpdaterID))
94 {
95 Updaters.Remove(updater.UpdaterID);
96 }
97 }
98 }
99
78 } 100 }
79 101
80 public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, 102 public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url,
@@ -101,9 +123,12 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
101 updater.BlendWithOldTexture = SetBlending; 123 updater.BlendWithOldTexture = SetBlending;
102 updater.FrontAlpha = AlphaValue; 124 updater.FrontAlpha = AlphaValue;
103 125
104 if (!Updaters.ContainsKey(updater.UpdaterID)) 126 lock(Updaters)
105 { 127 {
106 Updaters.Add(updater.UpdaterID, updater); 128 if (!Updaters.ContainsKey(updater.UpdaterID))
129 {
130 Updaters.Add(updater.UpdaterID, updater);
131 }
107 } 132 }
108 133
109 RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); 134 RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams);
@@ -134,9 +159,12 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
134 updater.BlendWithOldTexture = SetBlending; 159 updater.BlendWithOldTexture = SetBlending;
135 updater.FrontAlpha = AlphaValue; 160 updater.FrontAlpha = AlphaValue;
136 161
137 if (!Updaters.ContainsKey(updater.UpdaterID)) 162 lock(Updaters)
138 { 163 {
139 Updaters.Add(updater.UpdaterID, updater); 164 if (!Updaters.ContainsKey(updater.UpdaterID))
165 {
166 Updaters.Add(updater.UpdaterID, updater);
167 }
140 } 168 }
141 169
142 RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); 170 RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams);
@@ -270,7 +298,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
270 298
271 // remove the old asset from the cache 299 // remove the old asset from the cache
272 UUID oldID = tmptex.DefaultTexture.TextureID; 300 UUID oldID = tmptex.DefaultTexture.TextureID;
273 scene.CommsManager.AssetCache.ExpireAsset(oldID);
274 301
275 tmptex.DefaultTexture.TextureID = asset.FullID; 302 tmptex.DefaultTexture.TextureID = asset.FullID;
276 // I'm pretty sure we always want to force this to true 303 // I'm pretty sure we always want to force this to true
@@ -278,6 +305,9 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
278 305
279 part.Shape.Textures = tmptex; 306 part.Shape.Textures = tmptex;
280 part.ScheduleFullUpdate(); 307 part.ScheduleFullUpdate();
308
309 scene.CommsManager.AssetCache.ExpireAsset(oldID);
310
281 } 311 }
282 312
283 private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha) 313 private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha)