From 9526a96b4fd668c8b6d355155a8682868ae56abb Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 13 Jun 2017 13:22:01 +0100 Subject: some cleanup --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 9 ++++++--- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 14 -------------- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 +++--------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 17 +++++++---------- 4 files changed, 16 insertions(+), 36 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 6419f11..ae827f4 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1604,13 +1604,16 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient) { - SceneObjectGroup group = GetGroupByPrim(localID); + SceneObjectPart part = GetSceneObjectPart(localID); + if(part == null) + return; - if (group != null) + SceneObjectGroup group = part.ParentGroup; + if (group != null && !group.IsDeleted) { if (m_parentScene.Permissions.CanEditObject(group, remoteClient)) { - group.UpdateTextureEntry(localID, texture); + part.UpdateTextureEntry(texture); } } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 1695d9b..fdfe8ae 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -4129,20 +4129,6 @@ namespace OpenSim.Region.Framework.Scenes return Parts.Count(); } - /// - /// Update the texture entry for this part - /// - /// - /// - public void UpdateTextureEntry(uint localID, byte[] textureEntry) - { - SceneObjectPart part = GetPart(localID); - if (part != null) - { - part.UpdateTextureEntry(textureEntry); - } - } - public void AdjustChildPrimPermissions(bool forceTaskInventoryPermissive) { uint newOwnerMask = (uint)(PermissionMask.All | PermissionMask.Export) & 0xfffffff0; // Mask folded bits diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 61aa915..c2eac24 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -5016,6 +5016,9 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter if (newTex.FaceTextures[i] != null) newFace = newTex.FaceTextures[i]; + if (oldFace.TextureID != newFace.TextureID) + changeFlags |= Changed.TEXTURE; + Color4 oldRGBA = oldFace.RGBA; Color4 newRGBA = newFace.RGBA; @@ -5025,9 +5028,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter oldRGBA.A != newRGBA.A) changeFlags |= Changed.COLOR; - if (oldFace.TextureID != newFace.TextureID) - changeFlags |= Changed.TEXTURE; - // Max change, skip the rest of testing if (changeFlags == (Changed.TEXTURE | Changed.COLOR)) break; @@ -5053,17 +5053,11 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter m_shape.TextureEntry = newTex.GetBytes(); if (changeFlags != 0) TriggerScriptChangedEvent(changeFlags); - UpdateFlag = UpdateRequired.FULL; ParentGroup.HasGroupChanged = true; - - //This is madness.. - //ParentGroup.ScheduleGroupForFullUpdate(); - //This is sparta ScheduleFullUpdate(); } } - internal void UpdatePhysicsSubscribedEvents() { PhysicsActor pa = PhysActor; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2416b87..7e3adb9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2280,18 +2280,13 @@ namespace OpenSim.Region.Framework.Scenes m_lastChildAgentUpdateDrawDistance = DrawDistance; m_lastChildAgentUpdatePosition = AbsolutePosition; m_childUpdatesBusy = false; // allow them - - } m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); - - // send the rest of the world if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide) SendInitialDataToMe(); - // priority uses avatar position only // m_reprioritizationLastPosition = AbsolutePosition; @@ -2958,31 +2953,32 @@ namespace OpenSim.Region.Framework.Scenes Dir_ControlFlags.DIR_CONTROL_FLAG_DOWN)); MovementFlag &= noMovFlagsMask; - AgentControlFlags &= noMovFlagsMask; + uint tmpAgentControlFlags = (uint)m_AgentControlFlags; + tmpAgentControlFlags &= noMovFlagsMask; if (LocalVectorToTarget3D.X < 0) //MoveBack { MovementFlag |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_BACK; - AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_BACK; + tmpAgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_BACK; updated = true; } else if (LocalVectorToTarget3D.X > 0) //Move Forward { MovementFlag |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD; - AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD; + tmpAgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD; updated = true; } if (LocalVectorToTarget3D.Y > 0) //MoveLeft { MovementFlag |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; - AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; + tmpAgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; updated = true; } else if (LocalVectorToTarget3D.Y < 0) //MoveRight { MovementFlag |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT; - AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT; + tmpAgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT; updated = true; } @@ -3006,6 +3002,7 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE PRESENCE]: HandleMoveToTargetUpdate adding {0} to move vector {1} for {2}", // LocalVectorToTarget3D, agent_control_v3, Name); + m_AgentControlFlags = (AgentManager.ControlFlags) tmpAgentControlFlags; agent_control_v3 += LocalVectorToTarget3D; } catch (Exception e) -- cgit v1.1