diff --git a/SLProxy/Analyst.cs b/SLProxy/Analyst.cs index 2c2800c0..647583a7 100644 --- a/SLProxy/Analyst.cs +++ b/SLProxy/Analyst.cs @@ -717,7 +717,9 @@ public class Analyst : ProxyPlugin // LogPacket: dump a packet to the console private void LogPacket(Packet packet, IPEndPoint endPoint, Direction direction) { - if (logGrep == null || (logGrep != null && Regex.IsMatch(packet.ToString(), logGrep))) + string packetText = packet.ToString(); + + if (logGrep == null || (logGrep != null && Regex.IsMatch(packetText, logGrep))) { Console.WriteLine("{0} {1,21} {2,5} {3}{4}{5}" , direction == Direction.Incoming ? "<--" : "-->" @@ -725,7 +727,7 @@ public class Analyst : ProxyPlugin , packet.Header.Sequence , InterpretOptions(packet.Header.Flags) , Environment.NewLine - , packet + , packetText ); } } diff --git a/libsecondlife/ObjectManager.cs b/libsecondlife/ObjectManager.cs index 63aaeaed..a0d884cd 100644 --- a/libsecondlife/ObjectManager.cs +++ b/libsecondlife/ObjectManager.cs @@ -2393,9 +2393,8 @@ namespace libsecondlife float adjSeconds = seconds * Client.Network.Simulators[i].Stats.Dilation; // Iterate through all of this sims avatars - lock (Client.Network.Simulators[i].ObjectsAvatars.Dictionary) - { - foreach (Avatar avatar in Client.Network.Simulators[i].ObjectsAvatars.Dictionary.Values) + Client.Network.Simulators[i].ObjectsAvatars.ForEach( + delegate(Avatar avatar) { #region Linear Motion // Only do movement interpolation (extrapolation) when there is a non-zero velocity but @@ -2404,16 +2403,15 @@ namespace libsecondlife { avatar.Position += (avatar.Velocity + (0.5f * (adjSeconds - HAVOK_TIMESTEP)) * avatar.Acceleration) * adjSeconds; - avatar.Velocity = avatar.Velocity + avatar.Acceleration * adjSeconds; + avatar.Velocity += avatar.Acceleration * adjSeconds; } #endregion Linear Motion } - } + ); // Iterate through all of this sims primitives - lock (Client.Network.Simulators[i].ObjectsPrimitives.Dictionary) - { - foreach (Primitive prim in Client.Network.Simulators[i].ObjectsPrimitives.Dictionary.Values) + Client.Network.Simulators[i].ObjectsPrimitives.ForEach( + delegate(Primitive prim) { if (prim.Joint == Primitive.JointType.Invalid) { @@ -2438,8 +2436,8 @@ namespace libsecondlife if (prim.Acceleration != LLVector3.Zero && prim.Velocity == LLVector3.Zero) { prim.Position += (prim.Velocity + (0.5f * (adjSeconds - HAVOK_TIMESTEP)) * - prim.Acceleration) * adjSeconds; - prim.Velocity = prim.Velocity + prim.Acceleration * adjSeconds; + prim.Acceleration) * adjSeconds; + prim.Velocity += prim.Acceleration * adjSeconds; } #endregion Linear Motion } @@ -2456,7 +2454,7 @@ namespace libsecondlife Client.Log("Unhandled joint type " + prim.Joint, Helpers.LogLevel.Warning); } } - } + ); } } diff --git a/libsecondlife/Types.cs b/libsecondlife/Types.cs index 37be7cec..3a648a8f 100644 --- a/libsecondlife/Types.cs +++ b/libsecondlife/Types.cs @@ -2034,11 +2034,13 @@ namespace libsecondlife /// public static LLQuaternion operator *(LLQuaternion lhs, LLQuaternion rhs) { - LLQuaternion ret = new LLQuaternion(); - ret.W = lhs.W * rhs.W - lhs.X * rhs.X - lhs.Y * rhs.Y - lhs.Z * rhs.Z; - ret.X = lhs.W * rhs.X + lhs.X * rhs.W + lhs.Y * rhs.Z - lhs.Z * rhs.Y; - ret.Y = lhs.W * rhs.Y + lhs.Y * rhs.W + lhs.Z * rhs.X - lhs.X * rhs.Z; - ret.Z = lhs.W * rhs.Z + lhs.Z * rhs.W + lhs.X * rhs.Y - lhs.Y * rhs.X; + LLQuaternion ret = new LLQuaternion( + rhs.W * lhs.X + rhs.X * lhs.W + rhs.Y * lhs.Z - rhs.Z * lhs.Y, + rhs.W * lhs.Y + rhs.Y * lhs.W + rhs.Z * lhs.X - rhs.X * lhs.Z, + rhs.W * lhs.Z + rhs.Z * lhs.W + rhs.X * lhs.Y - rhs.Y * lhs.X, + rhs.W * lhs.W - rhs.X * lhs.X - rhs.Y * lhs.Y - rhs.Z * lhs.Z + ); + return ret; }