From 4b3cb91ce8e0250a22ae60bed738bc95414d1076 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 1 Jun 2012 00:12:04 +0200 Subject: [PATCH 1/3] Remove the kill record. Core has removed it long ago and it really does more harm than good these days --- .../ClientStack/Linden/UDP/LLClientView.cs | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 5912a1584b..77dbca7bed 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -346,7 +346,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// All manipulation of this set has to occur under an m_entityUpdates.SyncRoot lock /// /// - protected HashSet m_killRecord; +// protected HashSet m_killRecord; // protected HashSet m_attachmentsSent; @@ -472,7 +472,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); m_entityProps = new PriorityQueue(m_scene.Entities.Count); m_fullUpdateDataBlocksBuilder = new List(); - m_killRecord = new HashSet(); +// m_killRecord = new HashSet(); // m_attachmentsSent = new HashSet(); m_assetService = m_scene.RequestModuleInterface(); @@ -1574,17 +1574,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP // We MUST lock for both manipulating the kill record and sending the packet, in order to avoid a race // condition where a kill can be processed before an out-of-date update for the same object. // ProcessEntityUpdates() also takes the m_killRecord lock. - lock (m_killRecord) - { - foreach (uint localID in localIDs) - m_killRecord.Add(localID); +// lock (m_killRecord) +// { +// foreach (uint localID in localIDs) +// m_killRecord.Add(localID); // The throttle queue used here must match that being used for updates. Otherwise, there is a // chance that a kill packet put on a separate queue will be sent to the client before an existing // update packet on another queue. Receiving updates after kills results in unowned and undeletable // scene objects in a viewer until that viewer is relogged in. OutPacket(kill, ThrottleOutPacketType.Task); - } +// } } } @@ -3802,11 +3802,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP // If the object is an attachment we don't want it to be in the kill // record. Else attaching from inworld and subsequently dropping // it will no longer work. - lock (m_killRecord) - { - m_killRecord.Remove(part.LocalId); - m_killRecord.Remove(part.ParentGroup.RootPart.LocalId); - } +// lock (m_killRecord) +// { +// m_killRecord.Remove(part.LocalId); +// m_killRecord.Remove(part.ParentGroup.RootPart.LocalId); +// } } else { @@ -3822,13 +3822,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP // after the root prim has been deleted. // // We ignore this for attachments because attaching something from inworld breaks unless we do. - lock (m_killRecord) - { - if (m_killRecord.Contains(part.LocalId)) - continue; - if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId)) - continue; - } +// lock (m_killRecord) +// { +// if (m_killRecord.Contains(part.LocalId)) +// continue; +// if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId)) +// continue; +// } } if (part.ParentGroup.IsAttachment && m_disableFacelights) From d8f6faa89e23482f7359c1f99066d2c306950fef Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 1 Jun 2012 23:04:13 +0200 Subject: [PATCH 2/3] Fix impersonation, it got broken in a merge --- .../PasswordAuthenticationService.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs index 0d7ced9fd7..769c3c2477 100644 --- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs @@ -103,6 +103,8 @@ namespace OpenSim.Services.AuthenticationService if ((user.UserFlags & impersonateFlag) == 0) return String.Empty; + m_log.DebugFormat("[PASS AUTH]: Attempting impersonation"); + List accounts = m_UserAccountService.GetUserAccountsWhere(UUID.Zero, "UserLevel >= 200"); if (accounts == null || accounts.Count == 0) return String.Empty; @@ -117,6 +119,8 @@ namespace OpenSim.Services.AuthenticationService continue; } +// m_log.DebugFormat("[PASS AUTH]: Trying {0}", data.PrincipalID); + hashed = Util.Md5Hash(password + ":" + data.Data["passwordSalt"].ToString()); @@ -125,13 +129,12 @@ namespace OpenSim.Services.AuthenticationService m_log.DebugFormat("[PASS AUTH]: {0} {1} impersonating {2}, proceeding with login", a.FirstName, a.LastName, principalID); return GetToken(principalID, lifetime); } - else - { - m_log.DebugFormat( - "[AUTH SERVICE]: Salted hash {0} of given password did not match salted hash of {1} for PrincipalID {2}. Authentication failure.", - hashed, data.Data["passwordHash"], principalID); - return String.Empty; - } +// else +// { +// m_log.DebugFormat( +// "[AUTH SERVICE]: Salted hash {0} of given password did not match salted hash of {1} for PrincipalID {2}. Authentication failure.", +// hashed, data.Data["passwordHash"], data.PrincipalID); +// } } m_log.DebugFormat("[PASS AUTH]: Impersonation of {0} failed", principalID); From 928e3e9e21f17ee6cfe8850a903acaad490719d1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 1 Jun 2012 23:04:28 +0200 Subject: [PATCH 3/3] Fix LSL animation state reporting and animation state transitions on crossing --- .../Region/Framework/Scenes/ScenePresence.cs | 2 +- .../Shared/Api/Implementation/LSL_Api.cs | 40 +++++++++++++++---- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e2f32dd251..2b1fb3d7d8 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -867,7 +867,7 @@ namespace OpenSim.Region.Framework.Scenes IsChildAgent = false; - Animator.TrySetMovementAnimation("SIT"); +// Animator.TrySetMovementAnimation("SIT"); } else { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ea78dc34cc..ec0966b29f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -111,6 +111,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected Timer m_ShoutSayTimer; protected int m_SayShoutCount = 0; + private Dictionary MovementAnimationsForLSL = + new Dictionary { + {"FLY", "Flying"}, + {"FLYSLOW", "FlyingSlow"}, + {"HOVER_UP", "Hovering Up"}, + {"HOVER_DOWN", "Hovering Down"}, + {"HOVER", "Hovering"}, + {"LAND", "Landing"}, + {"FALLDOWN", "Falling Down"}, + {"PREJUMP", "PreJumping"}, + {"JUMP", "Jumping"}, + {"STANDUP", "Standing Up"}, + {"SOFT_LAND", "Soft Landing"}, + {"STAND", "Standing"}, + {"CROUCHWALK", "CrouchWalking"}, + {"RUN", "Running"}, + {"WALK", "Walking"}, + {"CROUCH", "Crouching"}, + {"TURNLEFT", "Turning Left"}, + {"TURNRIGHT", "Turning Right"} + }; + public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) { m_ShoutSayTimer = new Timer(1000); @@ -2523,7 +2545,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - vel = m_host.Velocity; + vel = m_host.ParentGroup.RootPart.Velocity; } return new LSL_Vector(vel.X, vel.Y, vel.Z); @@ -4820,14 +4842,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (m_host.RegionHandle == presence.RegionHandle) { - Dictionary animationstateNames = DefaultAvatarAnimations.AnimStateNames; - if (presence != null) { - AnimationSet currentAnims = presence.Animator.Animations; - string currentAnimationState = String.Empty; - if (animationstateNames.TryGetValue(currentAnims.DefaultAnimation.AnimID, out currentAnimationState)) - return currentAnimationState; + if (presence.SitGround) + return "Sitting on Ground"; + if (presence.ParentID != 0 || presence.ParentUUID != UUID.Zero) + return "Sitting"; + + string movementAnimation = presence.Animator.CurrentMovementAnimation; + string lslMovementAnimation; + + if (MovementAnimationsForLSL.TryGetValue(movementAnimation, out lslMovementAnimation)) + return lslMovementAnimation; } }