From 8556a9f1a8c85bc77c87beeaae1aec7d170ebbd3 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 4 Feb 2010 13:31:06 -0800 Subject: Applying patch #4534 by Misterblue to fix ODE physics stickiness --- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 973aa84..44b2727 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -1575,6 +1575,7 @@ Console.WriteLine(" JointCreateFixed"); { //Console.WriteLine("Move " + m_primName); if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009 + /* // NON-'VEHICLES' are dealt with here if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f)) { @@ -1587,6 +1588,7 @@ Console.WriteLine(" JointCreateFixed"); avel2.Z = 0; d.BodySetAngularVel(Body, avel2.X, avel2.Y, avel2.Z); } + */ //float PID_P = 900.0f; float m_mass = CalculateMass(); -- cgit v1.1 From f1b99c4a7f9543c3a2aa36de2e659bdefca9e68b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 4 Feb 2010 21:35:56 +0000 Subject: minor: one method doc --- .../CoreModules/Scripting/VectorRender/VectorRenderModule.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index d57a8e5..3291be4 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -342,6 +342,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender m_log.Error( "[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); } + m_textureManager.ReturnData(id, imageJ2000); } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8d84557..dd797fc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4144,9 +4144,13 @@ namespace OpenSim.Region.Framework.Scenes ScheduleFullUpdate(); } - // Added to handle bug in libsecondlife's TextureEntry.ToBytes() - // not handling RGBA properly. Cycles through, and "fixes" the color - // info + /// + /// Update the textures on the part. + /// + /// Added to handle bug in libsecondlife's TextureEntry.ToBytes() + /// not handling RGBA properly. Cycles through, and "fixes" the color + /// info + /// public void UpdateTexture(Primitive.TextureEntry tex) { //Color4 tmpcolor; -- cgit v1.1 From 0a084a31e9f96cc007f953b47e3319bde6d834f2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 4 Feb 2010 23:23:07 +0000 Subject: refactor: chain two ScenePresence constructors together to eliminate common code. No functional changes --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 4 +++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 26 +++++++++------------- 2 files changed, 14 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 1d364d4..6dc6f01 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -5190,6 +5190,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP { ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack; + //m_log.DebugFormat("[CLIENT]: Received ScriptDialogReply from {0}", rdialog.Data.ObjectID); + #region Packet Session and User Check if (m_checkPackets) { @@ -5210,7 +5212,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP args.Type = ChatTypeEnum.Shout; args.Position = new Vector3(); args.Scene = Scene; - args.Sender = this; + args.Sender = this; ChatMessage handlerChatFromClient2 = OnChatFromClient; if (handlerChatFromClient2 != null) handlerChatFromClient2(this, args); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index cd39cab..bcf22c3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -104,6 +104,8 @@ namespace OpenSim.Region.Framework.Scenes } protected ScenePresenceAnimator m_animator; + protected List m_attachments = new List(); + private Dictionary scriptedcontrols = new Dictionary(); private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; @@ -215,9 +217,7 @@ namespace OpenSim.Region.Framework.Scenes // Agent's Draw distance. protected float m_DrawDistance; - protected AvatarAppearance m_appearance; - - protected List m_attachments = new List(); + protected AvatarAppearance m_appearance; // neighbouring regions we have enabled a child agent in // holds the seed cap for the child agent in that region @@ -630,12 +630,16 @@ namespace OpenSim.Region.Framework.Scenes #endregion #region Constructor(s) - - private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) - { - m_animator = new ScenePresenceAnimator(this); + + public ScenePresence() + { m_sendCourseLocationsMethod = SendCoarseLocationsDefault; CreateSceneViewer(); + m_animator = new ScenePresenceAnimator(this); + } + + private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this() + { m_rootRegionHandle = reginfo.RegionHandle; m_controllingClient = client; m_firstname = m_controllingClient.FirstName; @@ -659,7 +663,6 @@ namespace OpenSim.Region.Framework.Scenes m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize); m_reprioritization_timer.AutoReset = false; - AdjustKnownSeeds(); // TODO: I think, this won't send anything, as we are still a child here... @@ -3321,13 +3324,6 @@ namespace OpenSim.Region.Framework.Scenes m_animator = null; } - public ScenePresence() - { - m_sendCourseLocationsMethod = SendCoarseLocationsDefault; - CreateSceneViewer(); - m_animator = new ScenePresenceAnimator(this); - } - public void AddAttachment(SceneObjectGroup gobj) { lock (m_attachments) -- cgit v1.1 From 7058a4c2597a2b76704e906b73ae7077ff805b16 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Feb 2010 18:09:27 +0000 Subject: Old OpenSim installations may have no AssetCaching setting in config-include/StandaloneCommon.ini [Modules] (or no [Modules] at all) If this is the case, this patch makes CenomeAssetCache the default cache (which matches that selected in StandaloneCommon.ini.example) Not having an asset cache may lead to a continual loop of appearance baking failures and cause dynamic textures not to work, among other effects --- OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index 1add0ab..e0e4cc6 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs @@ -324,7 +324,9 @@ namespace OpenSim.Region.CoreModules.Asset if (moduleConfig == null) return; - string name = moduleConfig.GetString("AssetCaching"); + // We're going to make CenomeAssetCache the default if there is no AssetCaching setting at all. This + // matches the default StandaloneCommon.ini.example + string name = moduleConfig.GetString("AssetCaching", Name); //Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); if (name != Name) -- cgit v1.1 From 68bb2dac45d7ce0d280cdfa66de3d142bb05c8cc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Feb 2010 19:21:27 +0000 Subject: Revert "Old OpenSim installations may have no AssetCaching setting in config-include/StandaloneCommon.ini [Modules] (or no [Modules] at all)" This will be replaced by a better solution where an enabled baking module will fail if no cache is in place (same for dynamic texture modules) This reverts commit 7058a4c2597a2b76704e906b73ae7077ff805b16. --- OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index e0e4cc6..1add0ab 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs @@ -324,9 +324,7 @@ namespace OpenSim.Region.CoreModules.Asset if (moduleConfig == null) return; - // We're going to make CenomeAssetCache the default if there is no AssetCaching setting at all. This - // matches the default StandaloneCommon.ini.example - string name = moduleConfig.GetString("AssetCaching", Name); + string name = moduleConfig.GetString("AssetCaching"); //Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); if (name != Name) -- cgit v1.1 From bf9fc69d017e9179b32cb7fde3374264f5c1ea8d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Feb 2010 19:34:25 +0000 Subject: minor: log what kind of wearable cannot be found --- .../Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 6 ++++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 35c59aa..144c8d1 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -115,7 +115,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // client.OnAvatarNowWearing -= AvatarIsWearing; } - public void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) { IInventoryService invService = m_scene.InventoryService; @@ -139,7 +138,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } else { - m_log.ErrorFormat("[APPEARANCE]: Can't find inventory item {0}, setting to default", appearance.Wearables[i].ItemID); + m_log.ErrorFormat( + "[APPEARANCE]: Can't find inventory item {0} for {1}, setting to default", + appearance.Wearables[i].ItemID, (WearableType)i); + appearance.Wearables[i].AssetID = def.Wearables[i].AssetID; } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index bcf22c3..e960d51 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3184,8 +3184,7 @@ namespace OpenSim.Region.Framework.Scenes m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong m_physicsActor.SubscribeEvents(500); - m_physicsActor.LocalID = LocalId; - + m_physicsActor.LocalID = LocalId; } private void OutOfBoundsCall(Vector3 pos) @@ -3195,7 +3194,7 @@ namespace OpenSim.Region.Framework.Scenes //AddToPhysicalScene(flying); if (ControllingClient != null) - ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.",true); + ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.", true); } // Event called by the physics plugin to tell the avatar about a collision. -- cgit v1.1 From 59f6606ecf4ea7ac3928aec20d1528222961458b Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 6 Feb 2010 00:37:07 -0500 Subject: Endline fix --- .../DynamicTexture/DynamicTextureModule.cs | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 679c871..e3c7bbf 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -358,18 +358,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // tmptex.DefaultTexture.Fullbright = true; part.UpdateTexture(tmptex); - } - - if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) - { - if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); - if (oldAsset != null) - { - if (oldAsset.Temporary == true) - { - scene.AssetService.Delete(oldID.ToString()); - } - } + } + + if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) + { + if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); + if (oldAsset != null) + { + if (oldAsset.Temporary == true) + { + scene.AssetService.Delete(oldID.ToString()); + } + } } } -- cgit v1.1 From fabf10f1cf29a20332f5ab3b5b467a6954a83b34 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 6 Feb 2010 00:38:22 -0500 Subject: endline fix 2 --- .../ServiceConnectorsOut/Interregion/RESTInterregionComms.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs index 44458d1..fa3681a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs @@ -436,12 +436,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } OSDMap resp = new OSDMap(2); - string reason = String.Empty; - uint teleportFlags = 0; - if (args.ContainsKey("teleport_flags")) - { - teleportFlags = args["teleport_flags"].AsUInteger(); - } + string reason = String.Empty; + uint teleportFlags = 0; + if (args.ContainsKey("teleport_flags")) + { + teleportFlags = args["teleport_flags"].AsUInteger(); + } // This is the meaning of POST agent m_regionClient.AdjustUserInformation(aCircuit); -- cgit v1.1 From 00947cf2ca7a9315ae1d508507db0c95348e25ec Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 8 Feb 2010 19:02:20 +0000 Subject: Add EventManager.OnIncomingSceneObject event which is triggered by an incoming scene object Add a read-only Attachments property to ScenePresence --- OpenSim/Region/Framework/Scenes/EventManager.cs | 29 ++++++++++++++++- OpenSim/Region/Framework/Scenes/Scene.cs | 36 +++++++++++++--------- .../Framework/Scenes/SceneCommunicationService.cs | 1 - OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 +++++- 4 files changed, 58 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 473920e..9f74b2a 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -205,6 +205,12 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnMakeRootAgentDelegate(ScenePresence presence); public event OnMakeRootAgentDelegate OnMakeRootAgent; + /// + /// Triggered when an object or attachment enters a scene + /// + public event OnIncomingSceneObjectDelegate OnIncomingSceneObject; + public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so); + public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel); public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete; @@ -407,7 +413,7 @@ namespace OpenSim.Region.Framework.Scenes } } } - } + } public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) { @@ -1206,6 +1212,27 @@ namespace OpenSim.Region.Framework.Scenes } } + public void TriggerOnIncomingSceneObject(SceneObjectGroup so) + { + OnIncomingSceneObjectDelegate handlerIncomingSceneObject = OnIncomingSceneObject; + if (handlerIncomingSceneObject != null) + { + foreach (OnIncomingSceneObjectDelegate d in handlerIncomingSceneObject.GetInvocationList()) + { + try + { + d(so); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + public void TriggerOnRegisterCaps(UUID agentID, Caps caps) { RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 73b0b3e..039d074 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2406,9 +2406,14 @@ namespace OpenSim.Region.Framework.Scenes return successYN; } + /// + /// Called when objects or attachments cross the border between regions. + /// + /// + /// public bool IncomingCreateObject(ISceneObject sog) { - //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); + //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); SceneObjectGroup newObject; try { @@ -2425,7 +2430,12 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); return false; } + newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); + + // Do this as late as possible so that listeners have full access to the incoming object + EventManager.TriggerOnIncomingSceneObject(newObject); + return true; } @@ -2437,6 +2447,8 @@ namespace OpenSim.Region.Framework.Scenes /// False public virtual bool IncomingCreateObject(UUID userID, UUID itemID) { + //m_log.DebugFormat(" >>> IncomingCreateObject(userID, itemID) <<< {0} {1}", userID, itemID); + ScenePresence sp = GetScenePresence(userID); if (sp != null) { @@ -2496,29 +2508,25 @@ namespace OpenSim.Region.Framework.Scenes //RootPrim.SetParentLocalId(parentLocalID); - m_log.DebugFormat("[ATTACHMENT]: Received " + - "attachment {0}, inworld asset id {1}", - //grp.RootPart.LastOwnerID.ToString(), - grp.GetFromItemID(), - grp.UUID.ToString()); + m_log.DebugFormat( + "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.GetFromItemID(), grp.UUID); //grp.SetFromAssetID(grp.RootPart.LastOwnerID); - m_log.DebugFormat("[ATTACHMENT]: Attach " + - "to avatar {0} at position {1}", - sp.UUID.ToString(), grp.AbsolutePosition); - AttachObject(sp.ControllingClient, - grp.LocalId, (uint)0, - grp.GroupRotation, - grp.AbsolutePosition, false); + m_log.DebugFormat( + "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); + + AttachObject( + sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); RootPrim.RemFlag(PrimFlags.TemporaryOnRez); grp.SendGroupFullUpdate(); + + } else { RootPrim.RemFlag(PrimFlags.TemporaryOnRez); RootPrim.AddFlag(PrimFlags.TemporaryOnRez); } - } else { diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 6164368..2f6a0db 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -191,7 +191,6 @@ namespace OpenSim.Region.Framework.Scenes if (handlerChildAgentUpdate != null) handlerChildAgentUpdate(cAgentData); - return true; } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e960d51..6b95624 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -104,6 +104,14 @@ namespace OpenSim.Region.Framework.Scenes } protected ScenePresenceAnimator m_animator; + /// + /// The scene objects attached to this avatar. Do not change this list directly - use methods such as + /// AddAttachment() and RemoveAttachment(). Lock this list when performing any read operations upon it. + /// + public List Attachments + { + get { return m_attachments; } + } protected List m_attachments = new List(); private Dictionary scriptedcontrols = new Dictionary(); @@ -1105,7 +1113,6 @@ namespace OpenSim.Region.Framework.Scenes m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look); SendInitialData(); - } /// -- cgit v1.1 From 9f4883d1468b5fe1c60e1831b24e1fed1eb5caeb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 8 Feb 2010 19:10:54 +0000 Subject: refactor: Reuse SceneObjectGroup.IsAttachmentCheckFull() in Scene.AddSceneObject since this wraps a check that is much less clear --- OpenSim/Region/Framework/Scenes/Scene.cs | 6 ++---- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 11 ++++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 039d074..ddebd0b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2483,7 +2483,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectPart p in sceneObject.Children.Values) p.LocalId = 0; - if ((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0)) // Attachment + if (sceneObject.IsAttachmentCheckFull()) // Attachment { sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); sceneObject.RootPart.AddFlag(PrimFlags.Phantom); @@ -2518,9 +2518,7 @@ namespace OpenSim.Region.Framework.Scenes AttachObject( sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); RootPrim.RemFlag(PrimFlags.TemporaryOnRez); - grp.SendGroupFullUpdate(); - - + grp.SendGroupFullUpdate(); } else { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 8c56870..af46659 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -268,7 +268,16 @@ namespace OpenSim.Region.Framework.Scenes } } - private bool IsAttachmentCheckFull() + /// + /// Check both the attachment property and the relevant properties of the underlying root part. + /// + /// This is necessary in some cases, particularly when a scene object has just crossed into a region and doesn't + /// have the IsAttachment property yet checked. + /// + /// FIXME: However, this should be fixed so that this property + /// propertly reflects the underlying status. + /// + public bool IsAttachmentCheckFull() { return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0)); } -- cgit v1.1 From ad28db3669d7881799c9f88edb98e2186ef462c0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 8 Feb 2010 21:21:21 +0000 Subject: add some method doc to IDynamicTextureManager --- .../Framework/Interfaces/IDynamicTextureManager.cs | 61 +++++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index abcaf91..c289cdb 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -43,10 +43,67 @@ namespace OpenSim.Region.Framework.Interfaces int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face); UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer); + + /// Apply a dynamically generated texture to all sides of the given prim. The texture is not persisted to the + /// asset service. + /// + /// The simulator in which the texture is being generated + /// The prim to which to apply the texture. + /// The content type to create. Current choices are "vector" to create a vector + /// based texture or "image" to create a texture from an image at a particular URL + /// The data for the generator + /// Parameters for the generator that don't form part of the main data. + /// If zero, the image is never updated after the first generation. If positive + /// the image is updated at the given interval. Not implemented for + /// + /// If true, the newly generated texture is blended with the appropriate existing ones on the prim + /// + /// + /// The alpha value of the generated texture. + /// + /// + /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need + /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture + /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID + /// UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue); - UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, - int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face); + + /// + /// Apply a dynamically generated texture to the given prim. + /// + /// The simulator in which the texture is being generated + /// The prim to which to apply the texture. + /// The content type to create. Current choices are "vector" to create a vector + /// based texture or "image" to create a texture from an image at a particular URL + /// The data for the generator + /// Parameters for the generator that don't form part of the main data. + /// If zero, the image is never updated after the first generation. If positive + /// the image is updated at the given interval. Not implemented for + /// + /// If true, the newly generated texture is blended with the appropriate existing ones on the prim + /// + /// + /// Display flags. If DISP_EXPIRE then the old texture is deleted if it is replaced by a + /// newer generated texture (may not currently be implemented). If DISP_TEMP then the asset is flagged as + /// temporary, which often means that it is not persisted to the database. + /// + /// + /// The alpha value of the generated texture. + /// + /// + /// The face of the prim on which to put the generated texture. If ALL_SIDES then all sides of the prim are + /// set + /// + /// + /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need + /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture + /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID + /// + UUID AddDynamicTextureData( + UUID simID, UUID primID, string contentType, string data, string extraParams, + int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face); + void GetDrawStringSize(string contentType, string text, string fontName, int fontSize, out double xSize, out double ySize); } -- cgit v1.1