diff options
Diffstat (limited to 'OpenSim/Region')
3 files changed, 61 insertions, 26 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs index eca576d..cf95463 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs | |||
@@ -64,11 +64,18 @@ namespace OpenSim.Region.ClientStack.Linden | |||
64 | 64 | ||
65 | private Scene m_scene; | 65 | private Scene m_scene; |
66 | private bool m_persistBakedTextures; | 66 | private bool m_persistBakedTextures; |
67 | private string m_URL; | ||
67 | 68 | ||
68 | private IBakedTextureModule m_BakedTextureModule; | 69 | private IBakedTextureModule m_BakedTextureModule; |
69 | 70 | ||
70 | public void Initialise(IConfigSource source) | 71 | public void Initialise(IConfigSource source) |
71 | { | 72 | { |
73 | IConfig config = source.Configs["ClientStack.LindenCaps"]; | ||
74 | if (config == null) | ||
75 | return; | ||
76 | |||
77 | m_URL = config.GetString("Cap_UploadBakedTexture", string.Empty); | ||
78 | |||
72 | IConfig appearanceConfig = source.Configs["Appearance"]; | 79 | IConfig appearanceConfig = source.Configs["Appearance"]; |
73 | if (appearanceConfig != null) | 80 | if (appearanceConfig != null) |
74 | m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures); | 81 | m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures); |
@@ -280,23 +287,28 @@ namespace OpenSim.Region.ClientStack.Linden | |||
280 | 287 | ||
281 | public void RegisterCaps(UUID agentID, Caps caps) | 288 | public void RegisterCaps(UUID agentID, Caps caps) |
282 | { | 289 | { |
283 | UploadBakedTextureHandler avatarhandler = new UploadBakedTextureHandler( | 290 | UUID capID = UUID.Random(); |
284 | caps, m_scene.AssetService, m_persistBakedTextures); | ||
285 | 291 | ||
286 | 292 | //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); | |
287 | 293 | if (m_URL == "localhost") | |
288 | caps.RegisterHandler( | 294 | { |
289 | "UploadBakedTexture", | 295 | UploadBakedTextureHandler avatarhandler = new UploadBakedTextureHandler( |
290 | new RestStreamHandler( | 296 | caps, m_scene.AssetService, m_persistBakedTextures); |
291 | "POST", | ||
292 | "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath, | ||
293 | avatarhandler.UploadBakedTexture, | ||
294 | "UploadBakedTexture", | ||
295 | agentID.ToString())); | ||
296 | |||
297 | |||
298 | |||
299 | 297 | ||
298 | caps.RegisterHandler( | ||
299 | "UploadBakedTexture", | ||
300 | new RestStreamHandler( | ||
301 | "POST", | ||
302 | "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath, | ||
303 | avatarhandler.UploadBakedTexture, | ||
304 | "UploadBakedTexture", | ||
305 | agentID.ToString())); | ||
306 | |||
307 | } | ||
308 | else | ||
309 | { | ||
310 | caps.RegisterHandler("UploadBakedTexture", m_URL); | ||
311 | } | ||
300 | } | 312 | } |
301 | } | 313 | } |
302 | } \ No newline at end of file | 314 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 389c2c6..2594b1b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4703,10 +4703,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
4703 | // m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags); | 4703 | // m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags); |
4704 | } | 4704 | } |
4705 | 4705 | ||
4706 | // Subscribe for physics collision events if needed for scripts and sounds | 4706 | /// <summary> |
4707 | /// Subscribe for physics collision events if needed for scripts and sounds | ||
4708 | /// </summary> | ||
4707 | public void SubscribeForCollisionEvents() | 4709 | public void SubscribeForCollisionEvents() |
4708 | { | 4710 | { |
4709 | if (PhysActor != null) | 4711 | PhysicsActor pa = PhysActor; |
4712 | |||
4713 | if (pa != null) | ||
4710 | { | 4714 | { |
4711 | if ( | 4715 | if ( |
4712 | ((AggregateScriptEvents & scriptEvents.collision) != 0) || | 4716 | ((AggregateScriptEvents & scriptEvents.collision) != 0) || |
@@ -4724,20 +4728,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
4724 | (CollisionSound != UUID.Zero) | 4728 | (CollisionSound != UUID.Zero) |
4725 | ) | 4729 | ) |
4726 | { | 4730 | { |
4727 | if (!PhysActor.SubscribedEvents()) | 4731 | if (!pa.SubscribedEvents()) |
4728 | { | 4732 | { |
4729 | // If not already subscribed for event, set up for a collision event. | 4733 | // If not already subscribed for event, set up for a collision event. |
4730 | PhysActor.OnCollisionUpdate += PhysicsCollision; | 4734 | pa.OnCollisionUpdate += PhysicsCollision; |
4731 | PhysActor.SubscribeEvents(1000); | 4735 | pa.SubscribeEvents(1000); |
4732 | } | 4736 | } |
4733 | } | 4737 | } |
4734 | else | 4738 | else |
4735 | { | 4739 | { |
4736 | // There is no need to be subscribed to collisions so, if subscribed, remove subscription | 4740 | // There is no need to be subscribed to collisions so, if subscribed, remove subscription |
4737 | if (PhysActor.SubscribedEvents()) | 4741 | if (pa.SubscribedEvents()) |
4738 | { | 4742 | { |
4739 | PhysActor.OnCollisionUpdate -= PhysicsCollision; | 4743 | pa.OnCollisionUpdate -= PhysicsCollision; |
4740 | PhysActor.UnSubscribeEvents(); | 4744 | pa.UnSubscribeEvents(); |
4741 | } | 4745 | } |
4742 | } | 4746 | } |
4743 | } | 4747 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 8da06d1..3646c98 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -242,7 +242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
242 | if (Engine.Config.GetString("ScriptStopStrategy", "abort") == "co-op") | 242 | if (Engine.Config.GetString("ScriptStopStrategy", "abort") == "co-op") |
243 | { | 243 | { |
244 | m_coopTermination = true; | 244 | m_coopTermination = true; |
245 | m_coopSleepHandle = new AutoResetEvent(false); | 245 | m_coopSleepHandle = new XEngineEventWaitHandle(false, EventResetMode.AutoReset); |
246 | } | 246 | } |
247 | } | 247 | } |
248 | 248 | ||
@@ -1221,4 +1221,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1221 | Suspended = false; | 1221 | Suspended = false; |
1222 | } | 1222 | } |
1223 | } | 1223 | } |
1224 | } | 1224 | |
1225 | /// <summary> | ||
1226 | /// Xengine event wait handle. | ||
1227 | /// </summary> | ||
1228 | /// <remarks> | ||
1229 | /// This class exists becase XEngineScriptBase gets a reference to this wait handle. We need to make sure that | ||
1230 | /// when scripts are running in different AppDomains the lease does not expire. | ||
1231 | /// FIXME: Like LSL_Api, etc., this effectively leaks memory since the GC will never collect it. To avoid this, | ||
1232 | /// proper remoting sponsorship needs to be implemented across the board. | ||
1233 | /// </remarks> | ||
1234 | public class XEngineEventWaitHandle : EventWaitHandle | ||
1235 | { | ||
1236 | public XEngineEventWaitHandle(bool initialState, EventResetMode mode) : base(initialState, mode) {} | ||
1237 | |||
1238 | public override Object InitializeLifetimeService() | ||
1239 | { | ||
1240 | return null; | ||
1241 | } | ||
1242 | } | ||
1243 | } \ No newline at end of file | ||