From 2028787c0dee934eb97c07fe7d16909dc92789c3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 13 Jan 2013 12:25:41 +0000 Subject: [PATCH 01/15] prevent potencial invalid refs --- .../UbitOdePlugin/ODERayCastRequestManager.cs | 207 ++++-------------- .../Region/Physics/UbitOdePlugin/OdeScene.cs | 16 +- 2 files changed, 53 insertions(+), 170 deletions(-) diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs index 7fe3109267..4f598ea41c 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs @@ -68,7 +68,6 @@ namespace OpenSim.Region.Physics.OdePlugin /// ODE near callback delegate /// private d.NearCallback nearCallback; - private d.NearCallback nearProbeCallback; private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List m_contactResults = new List(); private RayFilterFlags CurrentRayFilter; @@ -78,7 +77,6 @@ namespace OpenSim.Region.Physics.OdePlugin { m_scene = pScene; nearCallback = near; - nearProbeCallback = nearProbe; ray = d.CreateRay(IntPtr.Zero, 1.0f); d.GeomSetCategoryBits(ray, 0); Box = d.CreateBox(IntPtr.Zero, 1.0f, 1.0f, 1.0f); @@ -125,6 +123,24 @@ namespace OpenSim.Region.Physics.OdePlugin { if (req.callbackMethod != null) { + IntPtr geom = IntPtr.Zero; + if (req.actor != null) + { + if (m_scene.haveActor(req.actor)) + { + if (req.actor is OdePrim) + geom = ((OdePrim)req.actor).prim_geom; + else if (req.actor is OdeCharacter) + geom = ((OdePrim)req.actor).prim_geom; + } + if (geom == IntPtr.Zero) + { + NoContacts(req); + continue; + } + } + + CurrentRayFilter = req.filter; CurrentMaxCount = req.Count; @@ -188,7 +204,7 @@ namespace OpenSim.Region.Physics.OdePlugin CollisionContactGeomsPerTest |= (int)d.CONTACTS_UNIMPORTANT; } - if (req.geom == IntPtr.Zero) + if (geom == IntPtr.Zero) { // translate ray filter to Collision flags catflags = 0; @@ -226,7 +242,7 @@ namespace OpenSim.Region.Physics.OdePlugin catflags |= CollisionCategories.Space; d.GeomSetCollideBits(Plane, (uint)catflags); d.GeomSetCategoryBits(Plane, (uint)catflags); - doPlane(req); + doPlane(req,IntPtr.Zero); } else { @@ -242,12 +258,12 @@ namespace OpenSim.Region.Physics.OdePlugin if (req.callbackMethod is ProbePlaneCallback) { d.GeomSetCollideBits(Plane, (uint)CollisionCategories.All); - doPlane(req); + doPlane(req,geom); } else { d.GeomSetCollideBits(ray, (uint)CollisionCategories.All); - doGeomRay(req); + doGeomRay(req,geom); } } } @@ -267,6 +283,23 @@ namespace OpenSim.Region.Physics.OdePlugin /// /// + private void NoContacts(ODERayRequest req) + { + if (req.callbackMethod is RaycastCallback) + { + ((RaycastCallback)req.callbackMethod)(false, Vector3.Zero, 0, 0, Vector3.Zero); + return; + } + List cresult = new List(); + + if (req.callbackMethod is RayCallback) + ((RayCallback)req.callbackMethod)(cresult); + else if (req.callbackMethod is ProbeBoxCallback) + ((ProbeBoxCallback)req.callbackMethod)(cresult); + else if (req.callbackMethod is ProbeSphereCallback) + ((ProbeSphereCallback)req.callbackMethod)(cresult); + } + private const RayFilterFlags FilterActiveSpace = RayFilterFlags.agent | RayFilterFlags.physical | RayFilterFlags.LSLPhanton; // private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.land | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton; private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton; @@ -358,10 +391,10 @@ namespace OpenSim.Region.Physics.OdePlugin ((ProbeSphereCallback)req.callbackMethod)(cresult); } - private void doPlane(ODERayRequest req) + private void doPlane(ODERayRequest req,IntPtr geom) { // Collide tests - if (req.geom == IntPtr.Zero) + if (geom == IntPtr.Zero) { if ((CurrentRayFilter & FilterActiveSpace) != 0) { @@ -375,7 +408,7 @@ namespace OpenSim.Region.Physics.OdePlugin } else { - d.SpaceCollide2(Plane, req.geom, IntPtr.Zero, nearCallback); + d.SpaceCollide2(Plane, geom, IntPtr.Zero, nearCallback); } List cresult = new List(m_contactResults.Count); @@ -392,10 +425,10 @@ namespace OpenSim.Region.Physics.OdePlugin /// Method that actually initiates the raycast with a geom /// /// - private void doGeomRay(ODERayRequest req) + private void doGeomRay(ODERayRequest req, IntPtr geom) { // Collide test - d.SpaceCollide2(ray, req.geom, IntPtr.Zero, nearCallback); // still do this to have full AABB pre test + d.SpaceCollide2(ray, geom, IntPtr.Zero, nearCallback); // still do this to have full AABB pre test if (req.callbackMethod is RaycastCallback) { @@ -607,156 +640,6 @@ namespace OpenSim.Region.Physics.OdePlugin } } - private void nearProbe(IntPtr space, IntPtr g1, IntPtr g2) - { - if (g1 == IntPtr.Zero || g1 == g2) - return; - - if (m_contactResults.Count >= CurrentMaxCount) - return; - - if (d.GeomIsSpace(g1)) - { - try - { - d.SpaceCollide2(g1, g2, IntPtr.Zero, nearProbeCallback); - } - catch (Exception e) - { - m_log.WarnFormat("[PHYSICS Ray]: Unable to Space collide test an object: {0}", e.Message); - } - return; - } - - int count = 0; - try - { - count = d.CollidePtr(g1, g2, CollisionContactGeomsPerTest, m_scene.ContactgeomsArray, d.ContactGeom.unmanagedSizeOf); - } - catch (Exception e) - { - m_log.WarnFormat("[PHYSICS Ray]: Unable to collide test an object: {0}", e.Message); - return; - } - - if (count == 0) - return; - - uint ID = 0; - PhysicsActor p1 = null; - - m_scene.actor_name_map.TryGetValue(g1, out p1); - - if (p1 == null) - return; - - switch (p1.PhysicsActorType) - { - case (int)ActorTypes.Prim: - - RayFilterFlags thisFlags; - - if (p1.IsPhysical) - thisFlags = RayFilterFlags.physical; - else - thisFlags = RayFilterFlags.nonphysical; - - if (p1.Phantom) - thisFlags |= RayFilterFlags.phantom; - - if (p1.IsVolumeDtc) - thisFlags |= RayFilterFlags.volumedtc; - - if ((thisFlags & CurrentRayFilter) == 0) - return; - - ID = ((OdePrim)p1).LocalID; - break; - - case (int)ActorTypes.Agent: - - if ((CurrentRayFilter & RayFilterFlags.agent) == 0) - return; - else - ID = ((OdeCharacter)p1).LocalID; - break; - - case (int)ActorTypes.Ground: - - if ((CurrentRayFilter & RayFilterFlags.land) == 0) - return; - break; - - case (int)ActorTypes.Water: - - if ((CurrentRayFilter & RayFilterFlags.water) == 0) - return; - break; - - default: - break; - } - - d.ContactGeom curcontact = new d.ContactGeom(); - - // closestHit for now only works for meshs, so must do it for others - if ((CurrentRayFilter & RayFilterFlags.ClosestHit) == 0) - { - // Loop all contacts, build results. - for (int i = 0; i < count; i++) - { - if (!GetCurContactGeom(i, ref curcontact)) - break; - - ContactResult collisionresult = new ContactResult(); - collisionresult.ConsumerID = ID; - collisionresult.Pos.X = curcontact.pos.X; - collisionresult.Pos.Y = curcontact.pos.Y; - collisionresult.Pos.Z = curcontact.pos.Z; - collisionresult.Depth = curcontact.depth; - collisionresult.Normal.X = curcontact.normal.X; - collisionresult.Normal.Y = curcontact.normal.Y; - collisionresult.Normal.Z = curcontact.normal.Z; - lock (m_contactResults) - { - m_contactResults.Add(collisionresult); - if (m_contactResults.Count >= CurrentMaxCount) - return; - } - } - } - else - { - // keep only closest contact - ContactResult collisionresult = new ContactResult(); - collisionresult.ConsumerID = ID; - collisionresult.Depth = float.MaxValue; - - for (int i = 0; i < count; i++) - { - if (!GetCurContactGeom(i, ref curcontact)) - break; - - if (curcontact.depth < collisionresult.Depth) - { - collisionresult.Pos.X = curcontact.pos.X; - collisionresult.Pos.Y = curcontact.pos.Y; - collisionresult.Pos.Z = curcontact.pos.Z; - collisionresult.Depth = curcontact.depth; - collisionresult.Normal.X = curcontact.normal.X; - collisionresult.Normal.Y = curcontact.normal.Y; - collisionresult.Normal.Z = curcontact.normal.Z; - } - } - - if (collisionresult.Depth != float.MaxValue) - { - lock (m_contactResults) - m_contactResults.Add(collisionresult); - } - } - } - /// /// Dereference the creator scene so that it can be garbage collected if needed. /// @@ -788,7 +671,7 @@ namespace OpenSim.Region.Physics.OdePlugin public struct ODERayRequest { - public IntPtr geom; + public PhysicsActor actor; public Vector3 Origin; public Vector3 Normal; public int Count; diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index 0d18adb04d..51132104ad 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs @@ -2580,7 +2580,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (retMethod != null) { ODERayRequest req = new ODERayRequest(); - req.geom = IntPtr.Zero; + req.actor = null; req.callbackMethod = retMethod; req.length = length; req.Normal = direction; @@ -2597,7 +2597,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (retMethod != null) { ODERayRequest req = new ODERayRequest(); - req.geom = IntPtr.Zero; + req.actor = null; req.callbackMethod = retMethod; req.length = length; req.Normal = direction; @@ -2625,7 +2625,7 @@ namespace OpenSim.Region.Physics.OdePlugin }; ODERayRequest req = new ODERayRequest(); - req.geom = IntPtr.Zero; + req.actor = null; req.callbackMethod = retMethod; req.length = length; req.Normal = direction; @@ -2663,7 +2663,7 @@ namespace OpenSim.Region.Physics.OdePlugin }; ODERayRequest req = new ODERayRequest(); - req.geom = IntPtr.Zero; + req.actor = null; req.callbackMethod = retMethod; req.length = length; req.Normal = direction; @@ -2710,7 +2710,7 @@ namespace OpenSim.Region.Physics.OdePlugin }; ODERayRequest req = new ODERayRequest(); - req.geom = geom; + req.actor = actor; req.callbackMethod = retMethod; req.length = length; req.Normal = direction; @@ -2745,7 +2745,7 @@ namespace OpenSim.Region.Physics.OdePlugin }; ODERayRequest req = new ODERayRequest(); - req.geom = IntPtr.Zero; + req.actor = null; req.callbackMethod = retMethod; req.Normal = size; req.Origin = position; @@ -2777,7 +2777,7 @@ namespace OpenSim.Region.Physics.OdePlugin }; ODERayRequest req = new ODERayRequest(); - req.geom = IntPtr.Zero; + req.actor = null; req.callbackMethod = retMethod; req.length = radius; req.Origin = position; @@ -2819,7 +2819,7 @@ namespace OpenSim.Region.Physics.OdePlugin }; ODERayRequest req = new ODERayRequest(); - req.geom = geom; + req.actor = null; req.callbackMethod = retMethod; req.length = plane.W; req.Normal.X = plane.X; From b263587e2104f304f084c72fcb0cc1d155dacc1e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 13 Jan 2013 15:25:51 +0000 Subject: [PATCH 02/15] try to patch getmesh Throttle (test) --- .../Region/ClientStack/Linden/Caps/GetMeshModule.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index 908f628274..6ec111539c 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs @@ -501,7 +501,8 @@ namespace OpenSim.Region.ClientStack.Linden ScenePresence p; if (m_scene.TryGetScenePresence(User, out p)) // If we don't get a user they're not here anymore. { - AlterThrottle(UserSetThrottle, p); +// AlterThrottle(UserSetThrottle, p); + UpdateThrottle(UserSetThrottle, p); } } } @@ -546,7 +547,12 @@ namespace OpenSim.Region.ClientStack.Linden // Client set throttle ! UserSetThrottle = pimagethrottle; CapSetThrottle = (int)(pimagethrottle*CapThrottleDistributon); - UDPSetThrottle = (int) (pimagethrottle*(100 - CapThrottleDistributon)); +// UDPSetThrottle = (int) (pimagethrottle*(100 - CapThrottleDistributon)); + + float udp = 1.0f - CapThrottleDistributon; + if(udp < 0.5f) + udp = 0.5f; + UDPSetThrottle = (int) ((float)pimagethrottle * udp); if (CapSetThrottle < 4068) CapSetThrottle = 4068; // at least two discovery mesh p.ControllingClient.SetAgentThrottleSilent((int) Throttle, UDPSetThrottle); From 1c79e8a779a94317670e90e99215311fe90caa9a Mon Sep 17 00:00:00 2001 From: teravus Date: Mon, 14 Jan 2013 19:37:44 -0500 Subject: [PATCH 03/15] * Document the additional Visual Params of newer browsers in AvatarAppearance.VPElement so it can be easily looked up in code/module --- OpenSim/Framework/AvatarAppearance.cs | 53 ++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index ffc3527035..041fb94ff1 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -1558,7 +1558,58 @@ namespace OpenSim.Framework SHAPE_EYELID_INNER_CORNER_UP = 214, SKIRT_SKIRT_RED = 215, SKIRT_SKIRT_GREEN = 216, - SKIRT_SKIRT_BLUE = 217 + SKIRT_SKIRT_BLUE = 217, + + /// + /// Avatar Physics section. These are 0 type visual params which get transmitted. + /// + + /// + /// Breast Part 1 + /// + BREAST_PHYSICS_MASS = 218, + BREAST_PHYSICS_GRAVITY = 219, + BREAST_PHYSICS_DRAG = 220, + BREAST_PHYSICS_UPDOWN_MAX_EFFECT = 221, + BREAST_PHYSICS_UPDOWN_SPRING = 222, + BREAST_PHYSICS_UPDOWN_GAIN = 223, + BREAST_PHYSICS_UPDOWN_DAMPING = 224, + BREAST_PHYSICS_INOUT_MAX_EFFECT = 225, + BREAST_PHYSICS_INOUT_SPRING = 226, + BREAST_PHYSICS_INOUT_GAIN = 227, + BREAST_PHYSICS_INOUT_DAMPING = 228, + /// + /// Belly + /// + BELLY_PHYISCS_MASS = 229, + BELLY_PHYSICS_GRAVITY = 230, + BELLY_PHYSICS_DRAG = 231, + BELLY_PHYISCS_UPDOWN_MAX_EFFECT = 232, + BELLY_PHYSICS_UPDOWN_SPRING = 233, + BELLY_PHYSICS_UPDOWN_GAIN = 234, + BELLY_PHYSICS_UPDOWN_DAMPING = 235, + + /// + /// Butt + /// + BUTT_PHYSICS_MASS = 236, + BUTT_PHYSICS_GRAVITY = 237, + BUTT_PHYSICS_DRAG = 238, + BUTT_PHYSICS_UPDOWN_MAX_EFFECT = 239, + BUTT_PHYSICS_UPDOWN_SPRING = 240, + BUTT_PHYSICS_UPDOWN_GAIN = 241, + BUTT_PHYSICS_UPDOWN_DAMPING = 242, + BUTT_PHYSICS_LEFTRIGHT_MAX_EFFECT = 243, + BUTT_PHYSICS_LEFTRIGHT_SPRING = 244, + BUTT_PHYSICS_LEFTRIGHT_GAIN = 245, + BUTT_PHYSICS_LEFTRIGHT_DAMPING = 246, + /// + /// Breast Part 2 + /// + BREAST_PHYSICS_LEFTRIGHT_MAX_EFFECT = 247, + BREAST_PHYSICS_LEFTRIGHT_SPRING= 248, + BREAST_PHYSICS_LEFTRIGHT_GAIN = 249, + BREAST_PHYSICS_LEFTRIGHT_DAMPING = 250 } #endregion } From 4d92c6b39f3ebb7a27517493b66d097d9d9d23dd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 16 Jan 2013 15:30:58 +0000 Subject: [PATCH 04/15] fix STATE udp queue data rate since it is in use again, after being removed by intel folks (?)( should it be used or removed ??) --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index f675377083..6485c1ac62 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -339,7 +339,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); // State is a subcategory of task that we allocate a percentage to - int state = 0; +// int state = 0; + int state = (int)((1.0f - STATE_TASK_PERCENTAGE) * (float)task); + task = (int)(STATE_TASK_PERCENTAGE * (float)task); // Make sure none of the throttles are set below our packet MTU, // otherwise a throttle could become permanently clogged @@ -350,6 +352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP task = Math.Max(task, LLUDPServer.MTU); texture = Math.Max(texture, LLUDPServer.MTU); asset = Math.Max(asset, LLUDPServer.MTU); + state = Math.Max(state, LLUDPServer.MTU); //int total = resend + land + wind + cloud + task + texture + asset; //m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}", From d92d5ca1fd2f84841881f5822316b4ba225e679d Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 16 Jan 2013 16:46:43 +0100 Subject: [PATCH 05/15] Revert " fix STATE udp queue data rate since it is in use again, after being" This reverts commit 4d92c6b39f3ebb7a27517493b66d097d9d9d23dd. --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index 6485c1ac62..f675377083 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -339,9 +339,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); // State is a subcategory of task that we allocate a percentage to -// int state = 0; - int state = (int)((1.0f - STATE_TASK_PERCENTAGE) * (float)task); - task = (int)(STATE_TASK_PERCENTAGE * (float)task); + int state = 0; // Make sure none of the throttles are set below our packet MTU, // otherwise a throttle could become permanently clogged @@ -352,7 +350,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP task = Math.Max(task, LLUDPServer.MTU); texture = Math.Max(texture, LLUDPServer.MTU); asset = Math.Max(asset, LLUDPServer.MTU); - state = Math.Max(state, LLUDPServer.MTU); //int total = resend + land + wind + cloud + task + texture + asset; //m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}", From 85aa1804dfc9edbf41f16c312d06746eecd59bc9 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 16 Jan 2013 16:45:18 +0000 Subject: [PATCH 06/15] Complete removal of the now unused state queue --- OpenSim/Framework/ThrottleOutPacketType.cs | 4 ---- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- .../Region/ClientStack/Linden/UDP/LLUDPClient.cs | 15 ++------------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/OpenSim/Framework/ThrottleOutPacketType.cs b/OpenSim/Framework/ThrottleOutPacketType.cs index d56231a397..ca4b126c97 100644 --- a/OpenSim/Framework/ThrottleOutPacketType.cs +++ b/OpenSim/Framework/ThrottleOutPacketType.cs @@ -47,9 +47,6 @@ namespace OpenSim.Framework Texture = 5, /// Non-texture assets Asset = 6, - /// Avatar and primitive data - /// This is a sub-category of Task - State = 7, } [Flags] @@ -61,6 +58,5 @@ namespace OpenSim.Framework Task = 1 << 3, Texture = 1 << 4, Asset = 1 << 5, - State = 1 << 6, } } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 0a865abcc8..3ae9dafd15 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -1607,7 +1607,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (localIDs.Count == 1 && m_scene.GetScenePresence(localIDs[0]) != null) { - OutPacket(kill, ThrottleOutPacketType.State); + OutPacket(kill, ThrottleOutPacketType.Task); } else { diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index f675377083..f1a181209a 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -279,7 +279,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public string GetStats() { return string.Format( - "{0,7} {1,7} {2,7} {3,9} {4,7} {5,7} {6,7} {7,7} {8,7} {9,8} {10,7} {11,7} {12,7}", + "{0,7} {1,7} {2,7} {3,9} {4,7} {5,7} {6,7} {7,7} {8,7} {9,8} {10,7} {11,7}", Util.EnvironmentTickCountSubtract(TickLastPacketReceived), PacketsReceived, PacketsSent, @@ -291,8 +291,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_packetOutboxes[(int)ThrottleOutPacketType.Cloud].Count, m_packetOutboxes[(int)ThrottleOutPacketType.Task].Count, m_packetOutboxes[(int)ThrottleOutPacketType.Texture].Count, - m_packetOutboxes[(int)ThrottleOutPacketType.Asset].Count, - m_packetOutboxes[(int)ThrottleOutPacketType.State].Count); + m_packetOutboxes[(int)ThrottleOutPacketType.Asset].Count); } public void SendPacketStats() @@ -338,8 +337,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); - // State is a subcategory of task that we allocate a percentage to - int state = 0; // Make sure none of the throttles are set below our packet MTU, // otherwise a throttle could become permanently clogged @@ -376,9 +373,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP bucket = m_throttleCategories[(int)ThrottleOutPacketType.Task]; bucket.RequestedDripRate = task; - bucket = m_throttleCategories[(int)ThrottleOutPacketType.State]; - bucket.RequestedDripRate = state; - bucket = m_throttleCategories[(int)ThrottleOutPacketType.Texture]; bucket.RequestedDripRate = texture; @@ -709,9 +703,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP Texture = 5, /// Non-texture assets Asset = 6, - /// Avatar and primitive data - /// This is a sub-category of Task - State = 7, */ switch (category) @@ -728,8 +719,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP return ThrottleOutPacketTypeFlags.Texture; case ThrottleOutPacketType.Asset: return ThrottleOutPacketTypeFlags.Asset; - case ThrottleOutPacketType.State: - return ThrottleOutPacketTypeFlags.State; default: return 0; } From 91138014e21e19a3c02ee1640caab7f748472038 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 16 Jan 2013 17:12:56 +0000 Subject: [PATCH 07/15] Change all uses of the removed state queue to the task queue for now. --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 3ae9dafd15..956c2c9377 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2788,7 +2788,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP Transfer.TransferInfo.Size = req.AssetInf.Data.Length; Transfer.TransferInfo.TransferID = req.TransferRequestID; Transfer.Header.Zerocoded = true; - OutPacket(Transfer, isWearable ? ThrottleOutPacketType.State : ThrottleOutPacketType.Asset); + OutPacket(Transfer, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); if (req.NumPackets == 1) { @@ -2799,7 +2799,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TransferPacket.TransferData.Data = req.AssetInf.Data; TransferPacket.TransferData.Status = 1; TransferPacket.Header.Zerocoded = true; - OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.State : ThrottleOutPacketType.Asset); + OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); } else { @@ -2832,7 +2832,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TransferPacket.TransferData.Status = 1; } TransferPacket.Header.Zerocoded = true; - OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.State : ThrottleOutPacketType.Asset); + OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); processedLength += chunkSize; packetNumber++; @@ -3605,7 +3605,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } - OutPacket(aw, ThrottleOutPacketType.State); + OutPacket(aw, ThrottleOutPacketType.Task); } public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) @@ -3630,7 +3630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP avp.Sender.IsTrial = false; avp.Sender.ID = agentID; m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); - OutPacket(avp, ThrottleOutPacketType.State); + OutPacket(avp, ThrottleOutPacketType.Task); } public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) From 582cb89beb597247ceb6d82cdfc8fc983ffe8496 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 16 Jan 2013 19:29:27 +0100 Subject: [PATCH 08/15] Add a way to put things at the front of the queue for any throttle group. Adds a DoubleLocklessQueue and uses it for the outgoing buckets. Added a flag value to the Throttle Type (again) because although it's hacky, it's the best of a bad bunch to get the message through the UDP stack to where it's needed. --- OpenSim/Framework/LocklessQueue.cs | 8 +-- OpenSim/Framework/ThrottleOutPacketType.cs | 2 + .../ClientStack/Linden/UDP/LLClientView.cs | 8 +-- .../ClientStack/Linden/UDP/LLUDPClient.cs | 54 +++++++++++++++---- .../ClientStack/Linden/UDP/LLUDPServer.cs | 10 +++- 5 files changed, 63 insertions(+), 19 deletions(-) diff --git a/OpenSim/Framework/LocklessQueue.cs b/OpenSim/Framework/LocklessQueue.cs index 84f887cc4d..9bd9baf321 100644 --- a/OpenSim/Framework/LocklessQueue.cs +++ b/OpenSim/Framework/LocklessQueue.cs @@ -29,7 +29,7 @@ using System.Threading; namespace OpenSim.Framework { - public sealed class LocklessQueue + public class LocklessQueue { private sealed class SingleLinkNode { @@ -41,7 +41,7 @@ namespace OpenSim.Framework SingleLinkNode tail; int count; - public int Count { get { return count; } } + public virtual int Count { get { return count; } } public LocklessQueue() { @@ -76,7 +76,7 @@ namespace OpenSim.Framework Interlocked.Increment(ref count); } - public bool Dequeue(out T item) + public virtual bool Dequeue(out T item) { item = default(T); SingleLinkNode oldHead = null; @@ -136,4 +136,4 @@ namespace OpenSim.Framework (object)Interlocked.CompareExchange(ref location, newValue, comparand); } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/ThrottleOutPacketType.cs b/OpenSim/Framework/ThrottleOutPacketType.cs index ca4b126c97..87899f0870 100644 --- a/OpenSim/Framework/ThrottleOutPacketType.cs +++ b/OpenSim/Framework/ThrottleOutPacketType.cs @@ -47,6 +47,8 @@ namespace OpenSim.Framework Texture = 5, /// Non-texture assets Asset = 6, + + HighPriority = 128, } [Flags] diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 956c2c9377..9550b5ab8d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2788,7 +2788,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP Transfer.TransferInfo.Size = req.AssetInf.Data.Length; Transfer.TransferInfo.TransferID = req.TransferRequestID; Transfer.Header.Zerocoded = true; - OutPacket(Transfer, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); + OutPacket(Transfer, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); if (req.NumPackets == 1) { @@ -2799,7 +2799,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TransferPacket.TransferData.Data = req.AssetInf.Data; TransferPacket.TransferData.Status = 1; TransferPacket.Header.Zerocoded = true; - OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); + OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); } else { @@ -2832,7 +2832,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TransferPacket.TransferData.Status = 1; } TransferPacket.Header.Zerocoded = true; - OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); + OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); processedLength += chunkSize; packetNumber++; @@ -3605,7 +3605,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } - OutPacket(aw, ThrottleOutPacketType.Task); + OutPacket(aw, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority); } public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index f1a181209a..e52ac37466 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// Packets we have sent that need to be ACKed by the client public readonly UnackedPacketCollection NeedAcks = new UnackedPacketCollection(); /// ACKs that are queued up, waiting to be sent to the client - public readonly OpenSim.Framework.LocklessQueue PendingAcks = new OpenSim.Framework.LocklessQueue(); + public readonly DoubleLocklessQueue PendingAcks = new DoubleLocklessQueue(); /// Current packet sequence number public int CurrentSequence; @@ -146,7 +146,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// Throttle buckets for each packet category private readonly TokenBucket[] m_throttleCategories; /// Outgoing queues for throttled packets - private readonly OpenSim.Framework.LocklessQueue[] m_packetOutboxes = new OpenSim.Framework.LocklessQueue[THROTTLE_CATEGORY_COUNT]; + private readonly DoubleLocklessQueue[] m_packetOutboxes = new DoubleLocklessQueue[THROTTLE_CATEGORY_COUNT]; /// A container that can hold one packet for each outbox, used to store /// dequeued packets that are being held for throttling private readonly OutgoingPacket[] m_nextPackets = new OutgoingPacket[THROTTLE_CATEGORY_COUNT]; @@ -202,7 +202,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ThrottleOutPacketType type = (ThrottleOutPacketType)i; // Initialize the packet outboxes, where packets sit while they are waiting for tokens - m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue(); + m_packetOutboxes[i] = new DoubleLocklessQueue(); // Initialize the token buckets that control the throttling for each category m_throttleCategories[i] = new TokenBucket(m_throttleCategory, rates.GetRate(type)); } @@ -429,16 +429,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// false if the packet has not been queued and should be sent immediately. /// public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue) + { + return EnqueueOutgoing(packet, forceQueue, false); + } + + public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue, bool highPriority) { int category = (int)packet.Category; if (category >= 0 && category < m_packetOutboxes.Length) { - OpenSim.Framework.LocklessQueue queue = m_packetOutboxes[category]; + DoubleLocklessQueue queue = m_packetOutboxes[category]; if (m_deliverPackets == false) { - queue.Enqueue(packet); + queue.Enqueue(packet, highPriority); return true; } @@ -449,7 +454,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // queued packets if (queue.Count > 0) { - queue.Enqueue(packet); + queue.Enqueue(packet, highPriority); return true; } @@ -462,7 +467,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP else { // Force queue specified or not enough tokens in the bucket, queue this packet - queue.Enqueue(packet); + queue.Enqueue(packet, highPriority); return true; } } @@ -494,7 +499,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_deliverPackets == false) return false; OutgoingPacket packet = null; - OpenSim.Framework.LocklessQueue queue; + DoubleLocklessQueue queue; TokenBucket bucket; bool packetSent = false; ThrottleOutPacketTypeFlags emptyCategories = 0; @@ -534,7 +539,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } catch { - m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue(); + m_packetOutboxes[i] = new DoubleLocklessQueue(); } if (success) { @@ -567,7 +572,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } else { - m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue(); + m_packetOutboxes[i] = new DoubleLocklessQueue(); emptyCategories |= CategoryToFlag(i); } } @@ -724,4 +729,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } } + + public class DoubleLocklessQueue : OpenSim.Framework.LocklessQueue + { + OpenSim.Framework.LocklessQueue highQueue = new OpenSim.Framework.LocklessQueue(); + + public override int Count + { + get + { + return base.Count + highQueue.Count; + } + } + + public override bool Dequeue(out T item) + { + if (highQueue.Dequeue(out item)) + return true; + + return base.Dequeue(out item); + } + + public void Enqueue(T item, bool highPriority) + { + if (highPriority) + highQueue.Enqueue(item); + else + Enqueue(item); + } + } } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 9a4abd4877..6c72edca08 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -803,6 +803,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP #region Queue or Send + bool highPriority = false; + + if (category != ThrottleOutPacketType.Unknown && (category & ThrottleOutPacketType.HighPriority) != 0) + { + category = (ThrottleOutPacketType)((int)category & 127); + highPriority = true; + } + OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category, null); // If we were not provided a method for handling unacked, use the UDPServer default method outgoingPacket.UnackedMethod = ((method == null) ? delegate(OutgoingPacket oPacket) { ResendUnacked(oPacket); } : method); @@ -811,7 +819,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // continue to display the deleted object until relog. Therefore, we need to always queue a kill object // packet so that it isn't sent before a queued update packet. bool requestQueue = type == PacketType.KillObject; - if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue)) + if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue, highPriority)) SendPacketFinal(outgoingPacket); #endregion Queue or Send From 2464e65c8aa58a2e4ca3a53c3b570270626d1a77 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 16 Jan 2013 20:27:10 +0000 Subject: [PATCH 09/15] llSetPos on child prim, send only a part terse update and not a group one --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 525e575b0e..9d4e734ea5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2309,9 +2309,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { part.OffsetPosition = (Vector3)toPos; - SceneObjectGroup parent = part.ParentGroup; - parent.HasGroupChanged = true; - parent.ScheduleGroupForTerseUpdate(); +// SceneObjectGroup parent = part.ParentGroup; +// parent.HasGroupChanged = true; +// parent.ScheduleGroupForTerseUpdate(); + part.ScheduleTerseUpdate(); } } From 30d5faa7fc6553ab66959fd5adaa69c53779dc35 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 16 Jan 2013 20:55:16 +0000 Subject: [PATCH 10/15] same for SetPrimParams --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9d4e734ea5..617f382242 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8342,9 +8342,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { part.OffsetPosition = currentPosition; - SceneObjectGroup parent = part.ParentGroup; - parent.HasGroupChanged = true; - parent.ScheduleGroupForTerseUpdate(); +// SceneObjectGroup parent = part.ParentGroup; +// parent.HasGroupChanged = true; +// parent.ScheduleGroupForTerseUpdate(); + part.ScheduleTerseUpdate(); } } } From de49440839e905cc4b3668962be96f8e274704d0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 16 Jan 2013 22:17:10 +0000 Subject: [PATCH 11/15] dont send a full grp update on stopmovetotarget. just a rootpart terse --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index b008e6698d..b4749796ec 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2369,6 +2369,8 @@ namespace OpenSim.Region.Framework.Scenes if (pa != null) pa.PIDActive = false; + + RootPart.ScheduleTerseUpdate(); // send a stop information } public void rotLookAt(Quaternion target, float strength, float damping) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ff4ae85f1f..8528edc616 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3760,7 +3760,7 @@ namespace OpenSim.Region.Framework.Scenes { ParentGroup.stopMoveToTarget(); - ParentGroup.ScheduleGroupForTerseUpdate(); +// ParentGroup.ScheduleGroupForTerseUpdate(); //ParentGroup.ScheduleGroupForFullUpdate(); } From 3e0e9a096287512f1e53b4f54c5e916958774d8e Mon Sep 17 00:00:00 2001 From: teravus Date: Wed, 16 Jan 2013 17:59:13 -0500 Subject: [PATCH 12/15] * Enables loading cached bakes on teleport by filling in the appropriate avatar fields from the bake data. No more auto rebaking on teleport assuming your wearables, bakes and cache are consistent. * Speeds up appearance sending.. since there's nothing to wait for. --- .../AvatarFactory/AvatarFactoryModule.cs | 73 ++++++++++++++++++- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 27cf20473a..7ec28605c1 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -373,6 +373,52 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { bool defonly = true; // are we only using default textures IImprovedAssetCache cache = m_scene.RequestModuleInterface(); + IBakedTextureModule bakedModule = m_scene.RequestModuleInterface(); + WearableCacheItem[] wearableCache = null; + + // Cache wearable data for teleport. + // Only makes sense if there's a bake module and a cache module + if (bakedModule != null && cache != null) + { + try + { + wearableCache = bakedModule.Get(sp.UUID); + } + catch (Exception) + { + + } + if (wearableCache != null) + { + for (int i = 0; i < wearableCache.Length; i++) + { + cache.Cache(wearableCache[i].TextureAsset); + } + } + } + /* + IBakedTextureModule bakedModule = m_scene.RequestModuleInterface(); + if (invService.GetRootFolder(userID) != null) + { + WearableCacheItem[] wearableCache = null; + if (bakedModule != null) + { + try + { + wearableCache = bakedModule.Get(userID); + appearance.WearableCacheItems = wearableCache; + appearance.WearableCacheItemsDirty = false; + foreach (WearableCacheItem item in wearableCache) + { + appearance.Texture.FaceTextures[item.TextureIndex].TextureID = item.TextureID; + } + } + catch (Exception) + { + + } + } + */ // Process the texture entry for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) @@ -380,9 +426,32 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory int idx = AvatarAppearance.BAKE_INDICES[i]; Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; - // if there is no texture entry, skip it + // No face, so lets check our baked service cache, teleport or login. if (face == null) - continue; + { + if (wearableCache != null) + { + // If we find the an appearance item, set it as the textureentry and the face + WearableCacheItem searchitem = WearableCacheItem.SearchTextureIndex((uint) idx, wearableCache); + if (searchitem != null) + { + sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint) idx); + sp.Appearance.Texture.FaceTextures[idx].TextureID = searchitem.TextureID; + face = sp.Appearance.Texture.FaceTextures[idx]; + } + else + { + // if there is no texture entry and no baked cache, skip it + continue; + } + } + else + { + //No texture entry face and no cache. Skip this face. + continue; + } + } + // m_log.DebugFormat( // "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}", From 13232718262920101ee50cfbe87192096c5c3805 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 19 Jan 2013 13:21:43 +0100 Subject: [PATCH 13/15] Kill the dumb Opensimulator Testing group again - for good. --- .../Region/CoreModules/Avatar/Groups/GroupsModule.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs index af54c1a1de..d2ef6b19e8 100644 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs @@ -73,17 +73,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups } else { - m_Enabled = groupsConfig.GetBoolean("Enabled", false); - if (!m_Enabled) + if (groupsConfig.GetBoolean("Enabled", false)) { - m_log.Info("[GROUPS]: Groups disabled in configuration"); - return; + if (groupsConfig.GetString("Module", "Default") == "Default") + m_Enabled = true; } - - if (groupsConfig.GetString("Module", "Default") != "Default") - return; } - } public void AddRegion(Scene scene) From bd77e2b7bac54112040706eb26f2d787f668d8a9 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 19 Jan 2013 14:29:09 +0100 Subject: [PATCH 14/15] Remove the core groups module --- .../CoreModules/Avatar/Groups/GroupsModule.cs | 252 ------------------ 1 file changed, 252 deletions(-) delete mode 100644 OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs deleted file mode 100644 index d2ef6b19e8..0000000000 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Reflection; -using log4net; -using Nini.Config; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; - -using Mono.Addins; - -namespace OpenSim.Region.CoreModules.Avatar.Groups -{ - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GroupsModule")] - public class GroupsModule : ISharedRegionModule - { - private static readonly ILog m_log = - LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - private Dictionary m_GroupMap = - new Dictionary(); - - private Dictionary m_ClientMap = - new Dictionary(); - - private UUID opensimulatorGroupID = - new UUID("00000000-68f9-1111-024e-222222111123"); - - private List m_SceneList = new List(); - - private static GroupMembershipData osGroup = - new GroupMembershipData(); - - private bool m_Enabled = false; - - #region ISharedRegionModule Members - - public void Initialise(IConfigSource config) - { - IConfig groupsConfig = config.Configs["Groups"]; - - if (groupsConfig == null) - { - m_log.Info("[GROUPS]: No configuration found. Using defaults"); - } - else - { - if (groupsConfig.GetBoolean("Enabled", false)) - { - if (groupsConfig.GetString("Module", "Default") == "Default") - m_Enabled = true; - } - } - } - - public void AddRegion(Scene scene) - { - if (!m_Enabled) - return; - - lock (m_SceneList) - { - if (!m_SceneList.Contains(scene)) - { - if (m_SceneList.Count == 0) - { - osGroup.GroupID = opensimulatorGroupID; - osGroup.GroupName = "OpenSimulator Testing"; - osGroup.GroupPowers = - (uint)(GroupPowers.AllowLandmark | - GroupPowers.AllowSetHome); - m_GroupMap[opensimulatorGroupID] = osGroup; - } - m_SceneList.Add(scene); - } - } - - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnClientClosed += OnClientClosed; - // scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; - } - - public void RemoveRegion(Scene scene) - { - if (!m_Enabled) - return; - - lock (m_SceneList) - { - if (m_SceneList.Contains(scene)) - m_SceneList.Remove(scene); - } - - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnClientClosed -= OnClientClosed; - } - - public void RegionLoaded(Scene scene) - { - } - - public void PostInitialise() - { - } - - public void Close() - { - if (!m_Enabled) - return; - -// m_log.Debug("[GROUPS]: Shutting down group module."); - - lock (m_ClientMap) - { - m_ClientMap.Clear(); - } - - lock (m_GroupMap) - { - m_GroupMap.Clear(); - } - } - - public string Name - { - get { return "GroupsModule"; } - } - - public Type ReplaceableInterface - { - get { return null; } - } - - #endregion - - private void OnNewClient(IClientAPI client) - { - // Subscribe to instant messages -// client.OnInstantMessage += OnInstantMessage; - client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; - client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; - lock (m_ClientMap) - { - if (!m_ClientMap.ContainsKey(client.AgentId)) - { - m_ClientMap.Add(client.AgentId, client); - } - } - - GroupMembershipData[] updateGroups = new GroupMembershipData[1]; - updateGroups[0] = osGroup; - - client.SendGroupMembership(updateGroups); - } - - private void OnAgentDataUpdateRequest(IClientAPI remoteClient, - UUID AgentID, UUID SessionID) - { - UUID ActiveGroupID; - string ActiveGroupName; - ulong ActiveGroupPowers; - - string firstname = remoteClient.FirstName; - string lastname = remoteClient.LastName; - - string ActiveGroupTitle = "I IZ N0T"; - - ActiveGroupID = osGroup.GroupID; - ActiveGroupName = osGroup.GroupName; - ActiveGroupPowers = osGroup.GroupPowers; - - remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname, - lastname, ActiveGroupPowers, ActiveGroupName, - ActiveGroupTitle); - } - -// private void OnInstantMessage(IClientAPI client, GridInstantMessage im) -// { -// } - -// private void OnGridInstantMessage(GridInstantMessage msg) -// { -// // Trigger the above event handler -// OnInstantMessage(null, msg); -// } - - private void HandleUUIDGroupNameRequest(UUID id,IClientAPI remote_client) - { - string groupnamereply = "Unknown"; - UUID groupUUID = UUID.Zero; - - lock (m_GroupMap) - { - if (m_GroupMap.ContainsKey(id)) - { - GroupMembershipData grp = m_GroupMap[id]; - groupnamereply = grp.GroupName; - groupUUID = grp.GroupID; - } - } - remote_client.SendGroupNameReply(groupUUID, groupnamereply); - } - - private void OnClientClosed(UUID agentID, Scene scene) - { - lock (m_ClientMap) - { - if (m_ClientMap.ContainsKey(agentID)) - { -// IClientAPI cli = m_ClientMap[agentID]; -// if (cli != null) -// { -// //m_log.Info("[GROUPS]: Removing all reference to groups for " + cli.Name); -// } -// else -// { -// //m_log.Info("[GROUPS]: Removing all reference to groups for " + agentID.ToString()); -// } - m_ClientMap.Remove(agentID); - } - } - } - } -} From 7bd9a0edb75ede38e71ca0f436bf89835b13d9ad Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 19 Jan 2013 14:30:38 +0100 Subject: [PATCH 15/15] Remove group IM test code also mentioning "OpenSimulator Testing" --- .../ClientStack/Linden/UDP/LLClientView.cs | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 9550b5ab8d..fd82db703b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -897,32 +897,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP msg.MessageBlock.Message = Util.StringToBytes1024(im.message); msg.MessageBlock.BinaryBucket = im.binaryBucket; - if (im.message.StartsWith("[grouptest]")) - { // this block is test code for implementing group IM - delete when group IM is finished - IEventQueue eq = Scene.RequestModuleInterface(); - if (eq != null) - { - im.dialog = 17; - - //eq.ChatterboxInvitation( - // new UUID("00000000-68f9-1111-024e-222222111123"), - // "OpenSimulator Testing", im.fromAgentID, im.message, im.toAgentID, im.fromAgentName, im.dialog, 0, - // false, 0, new Vector3(), 1, im.imSessionID, im.fromGroup, im.binaryBucket); - - eq.ChatterboxInvitation( - new UUID("00000000-68f9-1111-024e-222222111123"), - "OpenSimulator Testing", new UUID(im.fromAgentID), im.message, new UUID(im.toAgentID), im.fromAgentName, im.dialog, 0, - false, 0, new Vector3(), 1, new UUID(im.imSessionID), im.fromGroup, Util.StringToBytes256("OpenSimulator Testing")); - - eq.ChatterBoxSessionAgentListUpdates( - new UUID("00000000-68f9-1111-024e-222222111123"), - new UUID(im.fromAgentID), new UUID(im.toAgentID), false, false, false); - } - - Console.WriteLine("SendInstantMessage: " + msg); - } - else - OutPacket(msg, ThrottleOutPacketType.Task); + OutPacket(msg, ThrottleOutPacketType.Task); } }