From 5c4056660fe7678315716e52cfe57da0ba448efe Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Dec 2011 21:16:01 +0000 Subject: Don't pass on ChaneWaterHeight event from EventManager is new water height is less than 0 This is to stop bad values and subsequent viewer crashes. Thanks to Michelle Argus for this patch. --- OpenSim/Region/Framework/Scenes/EventManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 4a4d98f..4f71915 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -1564,6 +1564,12 @@ namespace OpenSim.Region.Framework.Scenes public void TriggerRequestChangeWaterHeight(float height) { + if (height < 0) + { + // ignore negative water height + return; + } + RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; if (handlerRequestChangeWaterHeight != null) { -- cgit v1.1 From a3a17e929e7a39566a677672572433fe35d25849 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Dec 2011 23:20:12 +0000 Subject: Stop generating client flags when we send out full object updates. These were entirely unused. --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 5 ++--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 26 +++++++--------------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 ----- 3 files changed, 10 insertions(+), 27 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index f9e0b83..20ef8c9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1377,15 +1377,14 @@ namespace OpenSim.Region.Framework.Scenes // Used when the client initially connects and when client sends RequestPrim packet public void SendFullUpdateToClient(IClientAPI remoteClient) { - RootPart.SendFullUpdate( - remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); + RootPart.SendFullUpdate(remoteClient); SceneObjectPart[] parts = m_parts.GetArray(); for (int i = 0; i < parts.Length; i++) { SceneObjectPart part = parts[i]; if (part != RootPart) - part.SendFullUpdate(remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); + part.SendFullUpdate(remoteClient); } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index f5a00d7..598b310 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2836,8 +2836,7 @@ namespace OpenSim.Region.Framework.Scenes /// Send a full update to the client for the given part /// /// - /// - protected internal void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) + protected internal void SendFullUpdate(IClientAPI remoteClient) { if (ParentGroup == null) return; @@ -2849,16 +2848,16 @@ namespace OpenSim.Region.Framework.Scenes { if (ParentGroup.IsAttachment) { - SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags); + SendFullUpdateToClient(remoteClient, AttachedPos); } else { - SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags); + SendFullUpdateToClient(remoteClient, AbsolutePosition); } } else { - SendFullUpdateToClient(remoteClient, clientFlags); + SendFullUpdateToClient(remoteClient); } } @@ -2872,7 +2871,7 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) { - SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); + SendFullUpdate(avatar.ControllingClient); }); } @@ -2880,12 +2879,9 @@ namespace OpenSim.Region.Framework.Scenes /// Sends a full update to the client /// /// - /// - public void SendFullUpdateToClient(IClientAPI remoteClient, uint clientflags) + public void SendFullUpdateToClient(IClientAPI remoteClient) { - Vector3 lPos; - lPos = OffsetPosition; - SendFullUpdateToClient(remoteClient, lPos, clientflags); + SendFullUpdateToClient(remoteClient, OffsetPosition); } /// @@ -2893,8 +2889,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - /// - public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos, uint clientFlags) + public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos) { if (ParentGroup == null) return; @@ -2911,15 +2906,10 @@ namespace OpenSim.Region.Framework.Scenes (ParentGroup.AttachmentPoint >= 31) && (ParentGroup.AttachmentPoint <= 38)) return; - clientFlags &= ~(uint) PrimFlags.CreateSelected; - if (remoteClient.AgentId == OwnerID) { if ((Flags & PrimFlags.CreateSelected) != 0) - { - clientFlags |= (uint) PrimFlags.CreateSelected; Flags &= ~PrimFlags.CreateSelected; - } } //bool isattachment = IsAttachment; //if (LocalId != ParentGroup.RootPart.LocalId) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 800b7e0..7be95cd 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -784,7 +784,6 @@ namespace OpenSim.Region.Framework.Scenes public void RegisterToEvents() { ControllingClient.OnCompleteMovementToRegion += CompleteMovement; - //ControllingClient.OnCompleteMovementToRegion += SendInitialData; ControllingClient.OnAgentUpdate += HandleAgentUpdate; ControllingClient.OnAgentRequestSit += HandleAgentRequestSit; ControllingClient.OnAgentSit += HandleAgentSit; @@ -832,11 +831,6 @@ namespace OpenSim.Region.Framework.Scenes #endregion - public uint GenerateClientFlags(UUID ObjectID) - { - return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID); - } - #region Status Methods /// -- cgit v1.1 From 1bf05fbb1f8cc4832d8c8963556d8082181f810a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 17 Dec 2011 00:11:17 +0000 Subject: refactor: simplify methods in Scene.PacketHandlers.cs by using GetGroupByPrim() rather than retrieving GetEntities() and inspecting the entire list --- .../Framework/Scenes/Scene.PacketHandlers.cs | 209 +++++++-------------- .../Region/Framework/Scenes/SceneObjectGroup.cs | 14 +- 2 files changed, 81 insertions(+), 142 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 6ba74c7..f9d0e0a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -116,18 +116,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void RequestPrim(uint primLocalID, IClientAPI remoteClient) { - EntityBase[] entityList = GetEntities(); - foreach (EntityBase ent in entityList) - { - if (ent is SceneObjectGroup) - { - if (((SceneObjectGroup)ent).LocalId == primLocalID) - { - ((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient); - return; - } - } - } + SceneObjectGroup sog = GetGroupByPrim(primLocalID); + + if (sog != null) + sog.SendFullUpdateToClient(remoteClient); } /// @@ -137,47 +129,28 @@ namespace OpenSim.Region.Framework.Scenes /// public void SelectPrim(uint primLocalID, IClientAPI remoteClient) { - EntityBase[] entityList = GetEntities(); - foreach (EntityBase ent in entityList) + SceneObjectPart part = GetSceneObjectPart(primLocalID); + + if (null == part) + return; + + if (part.IsRoot) { - if (ent is SceneObjectGroup) + SceneObjectGroup sog = part.ParentGroup; + sog.SendPropertiesToClient(remoteClient); + sog.IsSelected = true; + + // A prim is only tainted if it's allowed to be edited by the person clicking it. + if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) + || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId)) { - if (((SceneObjectGroup) ent).LocalId == primLocalID) - { - ((SceneObjectGroup) ent).SendPropertiesToClient(remoteClient); - ((SceneObjectGroup) ent).IsSelected = true; - // A prim is only tainted if it's allowed to be edited by the person clicking it. - if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) - || Permissions.CanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)) - { - EventManager.TriggerParcelPrimCountTainted(); - } - break; - } - else - { - // We also need to check the children of this prim as they - // can be selected as well and send property information - bool foundPrim = false; - - SceneObjectGroup sog = ent as SceneObjectGroup; - - SceneObjectPart[] partList = sog.Parts; - foreach (SceneObjectPart part in partList) - { - if (part.LocalId == primLocalID) - { - part.SendPropertiesToClient(remoteClient); - foundPrim = true; - break; - } - } - - if (foundPrim) - break; - } + EventManager.TriggerParcelPrimCountTainted(); } } + else + { + part.SendPropertiesToClient(remoteClient); + } } /// @@ -250,121 +223,81 @@ namespace OpenSim.Region.Framework.Scenes public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List surfaceArgs) { - EntityBase[] EntityList = GetEntities(); + SceneObjectPart part = GetSceneObjectPart(localID); + + if (part == null) + return; + + SceneObjectGroup obj = part.ParentGroup; SurfaceTouchEventArgs surfaceArg = null; if (surfaceArgs != null && surfaceArgs.Count > 0) surfaceArg = surfaceArgs[0]; - foreach (EntityBase ent in EntityList) + // Currently only grab/touch for the single prim + // the client handles rez correctly + obj.ObjectGrabHandler(localID, offsetPos, remoteClient); + + // If the touched prim handles touches, deliver it + // If not, deliver to root prim + if ((part.ScriptEvents & scriptEvents.touch_start) != 0) + EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); + + // Deliver to the root prim if the touched prim doesn't handle touches + // or if we're meant to pass on touches anyway. Don't send to root prim + // if prim touched is the root prim as we just did it + if (((part.ScriptEvents & scriptEvents.touch_start) == 0) || + (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) { - if (ent is SceneObjectGroup) - { - SceneObjectGroup obj = ent as SceneObjectGroup; - if (obj != null) - { - // Is this prim part of the group - if (obj.HasChildPrim(localID)) - { - // Currently only grab/touch for the single prim - // the client handles rez correctly - obj.ObjectGrabHandler(localID, offsetPos, remoteClient); - - SceneObjectPart part = obj.GetChildPart(localID); - - // If the touched prim handles touches, deliver it - // If not, deliver to root prim - if ((part.ScriptEvents & scriptEvents.touch_start) != 0) - EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); - // Deliver to the root prim if the touched prim doesn't handle touches - // or if we're meant to pass on touches anyway. Don't send to root prim - // if prim touched is the root prim as we just did it - if (((part.ScriptEvents & scriptEvents.touch_start) == 0) || - (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) - { - EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); - } - - return; - } - } - } + EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); } } - public virtual void ProcessObjectGrabUpdate(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List surfaceArgs) + public virtual void ProcessObjectGrabUpdate( + UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List surfaceArgs) { - EntityBase[] EntityList = GetEntities(); + SceneObjectPart part = GetSceneObjectPart(objectID); + if (part == null) + return; + + SceneObjectGroup obj = part.ParentGroup; SurfaceTouchEventArgs surfaceArg = null; if (surfaceArgs != null && surfaceArgs.Count > 0) surfaceArg = surfaceArgs[0]; - foreach (EntityBase ent in EntityList) + // If the touched prim handles touches, deliver it + // If not, deliver to root prim + if ((part.ScriptEvents & scriptEvents.touch) != 0) + EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); + // Deliver to the root prim if the touched prim doesn't handle touches + // or if we're meant to pass on touches anyway. Don't send to root prim + // if prim touched is the root prim as we just did it + if (((part.ScriptEvents & scriptEvents.touch) == 0) || + (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) { - if (ent is SceneObjectGroup) - { - SceneObjectGroup obj = ent as SceneObjectGroup; - if (obj != null) - { - // Is this prim part of the group - if (obj.HasChildPrim(objectID)) - { - SceneObjectPart part = obj.GetChildPart(objectID); - - // If the touched prim handles touches, deliver it - // If not, deliver to root prim - if ((part.ScriptEvents & scriptEvents.touch) != 0) - EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); - // Deliver to the root prim if the touched prim doesn't handle touches - // or if we're meant to pass on touches anyway. Don't send to root prim - // if prim touched is the root prim as we just did it - if (((part.ScriptEvents & scriptEvents.touch) == 0) || - (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) - { - EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); - } - - return; - } - } - } + EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); } } public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List surfaceArgs) { - EntityBase[] EntityList = GetEntities(); + SceneObjectPart part = GetSceneObjectPart(localID); + if (part == null) + return; + + SceneObjectGroup obj = part.ParentGroup; SurfaceTouchEventArgs surfaceArg = null; if (surfaceArgs != null && surfaceArgs.Count > 0) surfaceArg = surfaceArgs[0]; - foreach (EntityBase ent in EntityList) - { - if (ent is SceneObjectGroup) - { - SceneObjectGroup obj = ent as SceneObjectGroup; - - // Is this prim part of the group - if (obj.HasChildPrim(localID)) - { - SceneObjectPart part=obj.GetChildPart(localID); - if (part != null) - { - // If the touched prim handles touches, deliver it - // If not, deliver to root prim - if ((part.ScriptEvents & scriptEvents.touch_end) != 0) - EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg); - else - EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg); - - return; - } - return; - } - } - } + // If the touched prim handles touches, deliver it + // If not, deliver to root prim + if ((part.ScriptEvents & scriptEvents.touch_end) != 0) + EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg); + else + EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg); } public void ProcessAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 20ef8c9..7bf8c34 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1373,8 +1373,13 @@ namespace OpenSim.Region.Framework.Scenes #endregion - // Send the parts of this SOG to a single client - // Used when the client initially connects and when client sends RequestPrim packet + /// + /// Send the parts of this SOG to a single client + /// + /// + /// Used when the client initially connects and when client sends RequestPrim packet + /// + /// public void SendFullUpdateToClient(IClientAPI remoteClient) { RootPart.SendFullUpdate(remoteClient); @@ -1678,10 +1683,11 @@ namespace OpenSim.Region.Framework.Scenes /// /// Reset the UUIDs for all the prims that make up this group. - /// + /// + /// /// This is called by methods which want to add a new group to an existing scene, in order /// to ensure that there are no clashes with groups already present. - /// + /// public void ResetIDs() { lock (m_parts.SyncRoot) -- cgit v1.1 From f9137c923bcdc952efe37c7dd328c2d0d8323317 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 17 Dec 2011 02:23:24 +0000 Subject: Fix bug where objects could not be set to a new group if the group had been created in that client session, or if no other action has been performed on the object. There were two problems here: 1) On object group update, we looked for the group is the IClientAPI group cache rather than in the groups service. This fails to groups created newly in that session 2) On object group update, we weren't setting the HasGroupChanged flag. This meant that the change was not persisted unless some other action set this flag. This commit fixes these issues and hopefully addresses http://opensimulator.org/mantis/view.php?id=5588 This commit also moves HandleObjectGroupUpdate() to the GroupsModule from the Scene.PacketHandlers.cs file --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 +--- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 14 -------------- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 +++++ 4 files changed, 8 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index b43b227..4914d65 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2776,7 +2776,6 @@ namespace OpenSim.Region.Framework.Scenes public virtual void SubscribeToClientParcelEvents(IClientAPI client) { - client.OnObjectGroupRequest += m_sceneGraph.HandleObjectGroupUpdate; client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime; client.OnParcelBuy += ProcessParcelBuy; @@ -2903,7 +2902,6 @@ namespace OpenSim.Region.Framework.Scenes public virtual void UnSubscribeToClientParcelEvents(IClientAPI client) { - client.OnObjectGroupRequest -= m_sceneGraph.HandleObjectGroupUpdate; client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel; client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime; client.OnParcelBuy -= ProcessParcelBuy; @@ -4287,7 +4285,7 @@ namespace OpenSim.Region.Framework.Scenes /// Get a scene object group that contains the prim with the given local id /// /// - /// null if no scene object group containing that prim is found + /// null if no scene object group containing that prim is found public SceneObjectGroup GetGroupByPrim(uint localID) { return m_sceneGraph.GetGroupByPrim(localID); diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index af95c28..a3e4b46 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -575,20 +575,6 @@ namespace OpenSim.Region.Framework.Scenes } } - protected internal void HandleObjectGroupUpdate( - IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage) - { - if (!remoteClient.IsGroupMember(GroupID)) - return; - - SceneObjectGroup group = GetGroupByPrim(objectLocalID); - if (group != null) - { - if (group.OwnerID == remoteClient.AgentId) - group.SetGroup(GroupID, remoteClient); - } - } - protected internal ScenePresence CreateAndAddChildScenePresence( IClientAPI client, AvatarAppearance appearance, PresenceType type) { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 7bf8c34..abea788 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -3211,6 +3211,8 @@ namespace OpenSim.Region.Framework.Scenes part.Inventory.ChangeInventoryGroup(GroupID); } + HasGroupChanged = true; + // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled // for the same object with very different properties. The caller must schedule the update. //ScheduleGroupForFullUpdate(); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 598b310..b29ecc6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3344,6 +3344,11 @@ namespace OpenSim.Region.Framework.Scenes public void SetGroup(UUID groupID, IClientAPI client) { + // Scene.AddNewPrims() calls with client == null so can't use this. +// m_log.DebugFormat( +// "[SCENE OBJECT PART]: Setting group for {0} to {1} for {2}", +// Name, groupID, OwnerID); + GroupID = groupID; if (client != null) SendPropertiesToClient(client); -- cgit v1.1 From 0b91ec8dd2b78461cb0fcdec567a83e88a76ac87 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 19 Dec 2011 18:58:05 +0000 Subject: Migrate detailed "appearance show" report generation up to AvatarFactoryModule from AppearanceInfoModule so that it can be used in debug (inactive). Further filters "debug packet " to exclused [Request]ObjectPropertiesFamily if level is below 25. Adjust some method doc Minor changes to some logging messages. --- OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs | 11 ++++++++++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs index 26bc922..8670229 100644 --- a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs @@ -31,9 +31,10 @@ using OpenSim.Framework; namespace OpenSim.Region.Framework.Interfaces { + public delegate void ReportOutputAction(string format, params object[] args); + public interface IAvatarFactoryModule { - void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams); /// @@ -63,5 +64,13 @@ namespace OpenSim.Region.Framework.Interfaces bool ValidateBakedTextureCache(IScenePresence sp); void QueueAppearanceSend(UUID agentid); void QueueAppearanceSave(UUID agentid); + + /// + /// Get a report about the current state of a scene presence's baked appearance textures. + /// + /// + /// + /// + void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction reportOutputAction); } } \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7be95cd..f2e2ce7 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2667,7 +2667,7 @@ namespace OpenSim.Region.Framework.Scenes public void SendAppearanceToAgent(ScenePresence avatar) { // m_log.DebugFormat( -// "[SCENE PRESENCE] Send appearance from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); +// "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); avatar.ControllingClient.SendAppearance( UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); -- cgit v1.1 From 92039f295d7fe66bf1a09b29483f9057e395839e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 19 Dec 2011 20:13:48 +0000 Subject: Stop sending the viewer its own AvatarAppearance packet. The viewer warns in the log if it receives this. Stopping this doesn't appear to have adverse effects on viewer 1 or viewer 3 - the viewer gets its own appearance from body parts/clothes and self-baked textures. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f2e2ce7..9cad3fe 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2532,7 +2532,10 @@ namespace OpenSim.Region.Framework.Scenes // again here... this comes after the cached appearance check because the avatars // appearance goes into the avatar update packet SendAvatarDataToAllAgents(); - SendAppearanceToAgent(this); + + // Sending us our own appearance does not seem to be necessary, and the viewer warns in the log if you do + // this. +// SendAppearanceToAgent(this); // If we are using the the cached appearance then send it out to everyone if (cachedappearance) -- cgit v1.1 From 87a2d8d51b66db12a487014deb8447fb2432e2a3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 19 Dec 2011 23:03:45 +0000 Subject: Move HandleObjectGroupUpdate() from GroupsModule to Scene.PacketHandlers.cs as this is updating SOG/SOP.GroupID, which is arguably generic. --- .../Framework/Scenes/Scene.PacketHandlers.cs | 39 ++++++++++++++++++++++ OpenSim/Region/Framework/Scenes/Scene.cs | 11 +++--- 2 files changed, 44 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index f9d0e0a..3355ebe 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -154,6 +154,45 @@ namespace OpenSim.Region.Framework.Scenes } /// + /// Handle the update of an object's user group. + /// + /// + /// + /// + /// + private void HandleObjectGroupUpdate( + IClientAPI remoteClient, UUID groupID, uint objectLocalID, UUID Garbage) + { + if (m_groupsModule == null) + return; + + // XXX: Might be better to get rid of this special casing and have GetMembershipData return something + // reasonable for a UUID.Zero group. + if (groupID != UUID.Zero) + { + GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, remoteClient.AgentId); + + if (gmd == null) + { +// m_log.WarnFormat( +// "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group", +// remoteClient.Name, GroupID, objectLocalID); + + return; + } + } + + SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID); + if (so != null) + { + if (so.OwnerID == remoteClient.AgentId) + { + so.SetGroup(groupID, remoteClient); + } + } + } + + /// /// Handle the deselection of a prim from the client. /// /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4914d65..6666328 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -139,6 +139,7 @@ namespace OpenSim.Region.Framework.Scenes protected IDialogModule m_dialogModule; protected IEntityTransferModule m_teleportModule; protected ICapabilitiesModule m_capsModule; + protected IGroupsModule m_groupsModule; /// /// Current scene frame number @@ -1164,6 +1165,7 @@ namespace OpenSim.Region.Framework.Scenes m_dialogModule = RequestModuleInterface(); m_capsModule = RequestModuleInterface(); m_teleportModule = RequestModuleInterface(); + m_groupsModule = RequestModuleInterface(); } #endregion @@ -2733,6 +2735,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnObjectDescription += m_sceneGraph.PrimDescription; client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; client.OnObjectOwner += ObjectOwner; + client.OnObjectGroupRequest += HandleObjectGroupUpdate; } public virtual void SubscribeToClientPrimRezEvents(IClientAPI client) @@ -3520,15 +3523,11 @@ namespace OpenSim.Region.Framework.Scenes m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); } - IGroupsModule groupsModule = - RequestModuleInterface(); - List agentGroups = new List(); - if (groupsModule != null) + if (m_groupsModule != null) { - GroupMembershipData[] GroupMembership = - groupsModule.GetMembershipData(agent.AgentID); + GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID); if (GroupMembership != null) { -- cgit v1.1