From a110a7bd6aceffd9d69efde7270870b6d33a65bc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 14 Dec 2011 18:03:25 +0000 Subject: Eliminate _taintedPrimsH and _taintedPrimsL (and _taintedPrimLock) in favour of just a _taintedPrims HashSet. There's no point maintaining a list because any pending taint operations are all carried out in the same call anyway. --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 59 +++++++--------------------- 1 file changed, 14 insertions(+), 45 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index c1a3e61..6ceb106 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -205,27 +205,9 @@ namespace OpenSim.Region.Physics.OdePlugin private readonly HashSet _activeprims = new HashSet(); /// - /// Used to lock on manipulation of _taintedPrimL and _taintedPrimH + /// Prims that the simulator has created/deleted/updated and so need updating in ODE. /// - private readonly Object _taintedPrimLock = new Object(); - - /// - /// List of tainted prims. - /// - /// - /// A tainted prim is one that has taints to process before performing any other operations. The list is - /// cleared after processing. - /// - private readonly List _taintedPrimL = new List(); - - /// - /// HashSet of tainted prims. - /// - /// - /// A tainted prim is one that has taints to process before performing any other operations. The hashset is - /// cleared after processing. - /// - private readonly HashSet _taintedPrimH = new HashSet(); + private readonly HashSet _taintedPrims = new HashSet(); /// /// Record a character that has taints to be processed. @@ -767,7 +749,7 @@ namespace OpenSim.Region.Physics.OdePlugin } catch (AccessViolationException) { - m_log.Warn("[ODE SCENE]: Unable to collide test a space"); + m_log.Error("[ODE SCENE]: Unable to collide test a space"); return; } //Colliding a space or a geom with a space or a geom. so drill down @@ -829,7 +811,7 @@ namespace OpenSim.Region.Physics.OdePlugin } catch (Exception e) { - m_log.WarnFormat("[ODE SCENE]: Unable to collide test an object: {0}", e.Message); + m_log.ErrorFormat("[ODE SCENE]: Unable to collide test an object: {0}", e.Message); return; } @@ -1554,7 +1536,7 @@ namespace OpenSim.Region.Physics.OdePlugin } catch (AccessViolationException) { - m_log.WarnFormat("[ODE SCENE]: Unable to space collide {0}", Name); + m_log.ErrorFormat("[ODE SCENE]: Unable to space collide {0}", Name); } //float terrainheight = GetTerrainHeightAtXY(chr.Position.X, chr.Position.Y); @@ -1585,13 +1567,14 @@ namespace OpenSim.Region.Physics.OdePlugin removeprims = new List(); } removeprims.Add(chr); - m_log.Debug("[ODE SCENE]: unable to collide test active prim against space. The space was zero, the geom was zero or it was in the process of being removed. Removed it from the active prim list. This needs to be fixed!"); + m_log.Error( + "[ODE SCENE]: unable to collide test active prim against space. The space was zero, the geom was zero or it was in the process of being removed. Removed it from the active prim list. This needs to be fixed!"); } } } catch (AccessViolationException) { - m_log.Warn("[ODE SCENE]: Unable to space collide"); + m_log.Error("[ODE SCENE]: Unable to space collide"); } } } @@ -2621,17 +2604,8 @@ namespace OpenSim.Region.Physics.OdePlugin if (actor is OdePrim) { OdePrim taintedprim = ((OdePrim)actor); - lock (_taintedPrimLock) - { - if (!(_taintedPrimH.Contains(taintedprim))) - { -#if SPAM -Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); -#endif - _taintedPrimH.Add(taintedprim); // HashSet for searching - _taintedPrimL.Add(taintedprim); // List for ordered readout - } - } + lock (_taintedPrims) + _taintedPrims.Add(taintedprim); } else if (actor is OdeCharacter) { @@ -2750,9 +2724,9 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); } } - lock (_taintedPrimLock) + lock (_taintedPrims) { - foreach (OdePrim prim in _taintedPrimL) + foreach (OdePrim prim in _taintedPrims) { if (prim.m_taintremove) { @@ -2777,12 +2751,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); if (SupportsNINJAJoints) SimulatePendingNINJAJoints(); - if (_taintedPrimL.Count > 0) - { -//Console.WriteLine("Simulate calls Clear of _taintedPrim list"); - _taintedPrimH.Clear(); - _taintedPrimL.Clear(); - } + _taintedPrims.Clear(); } // Move characters @@ -2854,7 +2823,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); foreach (OdeCharacter actor in _characters) { if (actor.bad) - m_log.WarnFormat("[ODE SCENE]: BAD Actor {0} in _characters list was not removed?", actor.m_uuid); + m_log.ErrorFormat("[ODE SCENE]: BAD Actor {0} in _characters list was not removed?", actor.m_uuid); actor.UpdatePositionAndVelocity(defects); } -- cgit v1.1 From e830a778607337a6aab27dd29e5657e3f8aa6b76 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 14 Dec 2011 18:33:44 +0000 Subject: Simplify some manipulation of _taintedActors in OdeScene --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 6ceb106..a6c2eca 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -2612,12 +2612,9 @@ namespace OpenSim.Region.Physics.OdePlugin OdeCharacter taintedchar = ((OdeCharacter)actor); lock (_taintedActors) { - if (!(_taintedActors.Contains(taintedchar))) - { - _taintedActors.Add(taintedchar); - if (taintedchar.bad) - m_log.DebugFormat("[ODE SCENE]: Added BAD actor {0} to tainted actors", taintedchar.m_uuid); - } + _taintedActors.Add(taintedchar); + if (taintedchar.bad) + m_log.ErrorFormat("[ODE SCENE]: Added BAD actor {0} to tainted actors", taintedchar.m_uuid); } } } @@ -2714,14 +2711,10 @@ namespace OpenSim.Region.Physics.OdePlugin { lock (_taintedActors) { - if (_taintedActors.Count > 0) - { - foreach (OdeCharacter character in _taintedActors) - character.ProcessTaints(); + foreach (OdeCharacter character in _taintedActors) + character.ProcessTaints(); - if (_taintedActors.Count > 0) - _taintedActors.Clear(); - } + _taintedActors.Clear(); } lock (_taintedPrims) -- cgit v1.1 From 6f2d80cc930c83e81cc351f6e66a206141cf084a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 14 Dec 2011 21:27:47 +0000 Subject: minor: add some currently commented log lines for use in debugging --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index a6c2eca..da540fa 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -1699,6 +1699,10 @@ namespace OpenSim.Region.Physics.OdePlugin public override void RemoveAvatar(PhysicsActor actor) { +// m_log.DebugFormat( +// "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2}", +// actor.Name, actor.LocalID, Name); + //m_log.Debug("[PHYSICS]:ODELOCK"); ((OdeCharacter) actor).Destroy(); } @@ -1707,6 +1711,9 @@ namespace OpenSim.Region.Physics.OdePlugin { if (!_characters.Contains(chr)) { +// m_log.DebugFormat( +// "[ODE SCENE]: Adding physics character {0} {1} to physics scene {2}", chr.Name, chr.LocalID, Name); + _characters.Add(chr); if (chr.bad) @@ -1765,7 +1772,7 @@ namespace OpenSim.Region.Physics.OdePlugin public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { -// m_log.DebugFormat("[ODE SCENE]: Adding physics actor to {0} {1}", primName, localid); +// m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid); } -- cgit v1.1 From 58ba81ae4e0a30268d3f843a8b6df6ecd8fe2f84 Mon Sep 17 00:00:00 2001 From: nebadon Date: Thu, 15 Dec 2011 10:49:15 -0700 Subject: minor fix to MegaRegions, typo spotted by Ubit! --- OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 9b468dd..09da97a 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -415,7 +415,7 @@ namespace OpenSim.Region.RegionCombinerModule //xxy //xxx //xxx - if ((((int)conn.X * (int)Constants.RegionSize) + conn.YEnd + if ((((int)conn.X * (int)Constants.RegionSize) + conn.XEnd >= (regionConnections.X * (int)Constants.RegionSize)) && (((int)conn.Y * (int)Constants.RegionSize) + conn.YEnd >= (regionConnections.Y * (int)Constants.RegionSize))) -- cgit v1.1 From 937c06db54f8152486d37a4ba604ffb3bcdccbb4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 15 Dec 2011 21:57:22 +0000 Subject: Code cleanup related to ScenePresence.PhysicsActor and OdeScene/OdeCharacter Stop hiding RemoveAvatar failure, add log messages when characters are removed through defects or re-added unexpectedly. Add commented out log lines for future use. Use automatic property for PhysicsActor for better code readability and simplicity --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 59 +++++++++++++----------- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 6 +-- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 26 +++++++++-- 3 files changed, 56 insertions(+), 35 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index beff239..6f5b6fe 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -285,16 +285,10 @@ namespace OpenSim.Region.Framework.Scenes #region Properties - protected PhysicsActor m_physicsActor; - /// /// Physical scene representation of this Avatar. /// - public PhysicsActor PhysicsActor - { - set { m_physicsActor = value; } - get { return m_physicsActor; } - } + public PhysicsActor PhysicsActor { get; private set; } private byte m_movementflag; @@ -1032,18 +1026,19 @@ namespace OpenSim.Region.Framework.Scenes { if (PhysicsActor != null) { - try - { - PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; - PhysicsActor.OnOutOfBounds -= OutOfBoundsCall; - m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); - PhysicsActor.UnSubscribeEvents(); - PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; - PhysicsActor = null; - } - catch - { } +// PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; + PhysicsActor.OnOutOfBounds -= OutOfBoundsCall; + m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); + PhysicsActor.UnSubscribeEvents(); + PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; + PhysicsActor = null; } +// else +// { +// m_log.ErrorFormat( +// "[SCENE PRESENCE]: Attempt to remove physics actor for {0} on {1} but this scene presence has no physics actor", +// Name, Scene.RegionInfo.RegionName); +// } } /// @@ -1925,7 +1920,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat("[SCENE PRESENCE]: {0} {1}", SitTargetisSet, SitTargetUnOccupied); if (PhysicsActor != null) - m_sitAvatarHeight = m_physicsActor.Size.Z; + m_sitAvatarHeight = PhysicsActor.Size.Z; bool canSit = false; pos = part.AbsolutePosition + offset; @@ -2570,7 +2565,10 @@ namespace OpenSim.Region.Framework.Scenes // only send update from root agents to other clients; children are only "listening posts" if (IsChildAgent) { - m_log.Warn("[SCENE PRESENCE]: Attempt to send avatar data from a child agent"); + m_log.WarnFormat( + "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}", + Name, Scene.RegionInfo.RegionName); + return; } @@ -2628,7 +2626,10 @@ namespace OpenSim.Region.Framework.Scenes // only send update from root agents to other clients; children are only "listening posts" if (IsChildAgent) { - m_log.Warn("[SCENE PRESENCE]: Attempt to send avatar data from a child agent"); + m_log.WarnFormat( + "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}", + Name, Scene.RegionInfo.RegionName); + return; } @@ -3039,8 +3040,6 @@ namespace OpenSim.Region.Framework.Scenes CameraPosition = cAgentData.Center + offset; - //SetHeight(cAgentData.AVHeight); - if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); @@ -3251,6 +3250,13 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE PRESENCE]: Adding physics actor for {0}, ifFlying = {1} in {2}", // Name, isFlying, Scene.RegionInfo.RegionName); + if (PhysicsActor != null) + { + m_log.ErrorFormat( + "[SCENE PRESENCE]: Adding physics actor for {0} to {1} but this scene presence already has a physics actor", + Name, Scene.RegionInfo.RegionName); + } + if (Appearance.AvatarHeight == 0) Appearance.SetHeight(); @@ -3258,11 +3264,10 @@ namespace OpenSim.Region.Framework.Scenes Vector3 pVec = AbsolutePosition; - // Old bug where the height was in centimeters instead of meters - PhysicsActor = scene.AddAvatar(LocalId, Firstname + "." + Lastname, pVec, - new Vector3(0f, 0f, Appearance.AvatarHeight), isFlying); + PhysicsActor = scene.AddAvatar( + LocalId, Firstname + "." + Lastname, pVec, + new Vector3(0f, 0f, Appearance.AvatarHeight), isFlying); - scene.AddPhysicsActorTaint(PhysicsActor); //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 73c1c02..9c7e0ef 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -137,7 +137,7 @@ namespace OpenSim.Region.Physics.OdePlugin internal IntPtr Body = IntPtr.Zero; private OdeScene _parent_scene; internal IntPtr Shell = IntPtr.Zero; - internal IntPtr Amotor = IntPtr.Zero; + private IntPtr Amotor = IntPtr.Zero; private d.Mass ShellMass; private int m_eventsubscription = 0; @@ -549,8 +549,8 @@ namespace OpenSim.Region.Physics.OdePlugin { get { - float AVvolume = (float) (Math.PI*Math.Pow(CAPSULE_RADIUS, 2)*CAPSULE_LENGTH); - return m_density*AVvolume; + float AVvolume = (float)(Math.PI * Math.Pow(CAPSULE_RADIUS, 2) * CAPSULE_LENGTH); + return m_density * AVvolume; } } diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index da540fa..afe646c 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -1703,7 +1703,6 @@ namespace OpenSim.Region.Physics.OdePlugin // "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2}", // actor.Name, actor.LocalID, Name); - //m_log.Debug("[PHYSICS]:ODELOCK"); ((OdeCharacter) actor).Destroy(); } @@ -1711,11 +1710,12 @@ namespace OpenSim.Region.Physics.OdePlugin { if (!_characters.Contains(chr)) { -// m_log.DebugFormat( -// "[ODE SCENE]: Adding physics character {0} {1} to physics scene {2}", chr.Name, chr.LocalID, Name); - _characters.Add(chr); +// m_log.DebugFormat( +// "[ODE SCENE]: Adding physics character {0} {1} to physics scene {2}. Count now {3}", +// chr.Name, chr.LocalID, Name, _characters.Count); + if (chr.bad) m_log.ErrorFormat("[ODE SCENE]: Added BAD actor {0} to characters list", chr.m_uuid); } @@ -1730,11 +1730,19 @@ namespace OpenSim.Region.Physics.OdePlugin internal void RemoveCharacter(OdeCharacter chr) { if (_characters.Contains(chr)) + { _characters.Remove(chr); + +// m_log.DebugFormat( +// "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2}. Count now {3}", +// chr.Name, chr.LocalID, Name, _characters.Count); + } else + { m_log.ErrorFormat( "[ODE SCENE]: Tried to remove character {0} {1} but they are not in the list!", chr.Name, chr.LocalID); + } } private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, @@ -1772,7 +1780,7 @@ namespace OpenSim.Region.Physics.OdePlugin public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { -// m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); + m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid); } @@ -2762,6 +2770,10 @@ namespace OpenSim.Region.Physics.OdePlugin { foreach (OdeCharacter actor in defects) { + m_log.ErrorFormat( + "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2} due to defect found when moving", + actor.Name, actor.LocalID, Name); + RemoveCharacter(actor); actor.DestroyOdeStructures(); } @@ -2832,6 +2844,10 @@ namespace OpenSim.Region.Physics.OdePlugin { foreach (OdeCharacter actor in defects) { + m_log.ErrorFormat( + "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2} due to defect found when updating position and velocity", + actor.Name, actor.LocalID, Name); + RemoveCharacter(actor); actor.DestroyOdeStructures(); } -- cgit v1.1 From c0ba99e5ada0b734b932091befce69dbd53d149a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 15 Dec 2011 22:29:36 +0000 Subject: Stop having to call SetHeight again in ScenePresence.AddToPhysicalScene() when we've already passed size information to the avatar at PhysicsScene.AddAvatar() Eliminate some copypasta for height setting in OdeCharacter --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 ++--- .../BasicPhysicsPlugin/BasicPhysicsActor.cs | 3 +- .../BasicPhysicsPlugin/BasicPhysicsScene.cs | 2 +- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 38 +++++++++++++--------- 4 files changed, 27 insertions(+), 24 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6f5b6fe..ac58dae 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1149,13 +1149,11 @@ namespace OpenSim.Region.Framework.Scenes /// /// Sets avatar height in the physics plugin /// + /// New height of avatar public void SetHeight(float height) { if (PhysicsActor != null && !IsChildAgent) - { - Vector3 SetSize = new Vector3(0.45f, 0.6f, height); - PhysicsActor.Size = SetSize; - } + PhysicsActor.Size = new Vector3(0.45f, 0.6f, height); } /// @@ -3273,8 +3271,6 @@ namespace OpenSim.Region.Framework.Scenes PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong PhysicsActor.SubscribeEvents(500); PhysicsActor.LocalID = LocalId; - - SetHeight(Appearance.AvatarHeight); } private void OutOfBoundsCall(Vector3 pos) diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs index 5e2eeeb..1e1d5e3 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs @@ -44,8 +44,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin private bool flying; private bool iscolliding; - public BasicActor() + public BasicActor(Vector3 size) { + Size = size; } public override int PhysicsActorType diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs index 1ceed1a..2e14216 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin } public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying) { - BasicActor act = new BasicActor(); + BasicActor act = new BasicActor(size); act.Position = position; act.Flying = isFlying; _actors.Add(act); diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 9c7e0ef..9200016 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -199,9 +199,11 @@ namespace OpenSim.Region.Physics.OdePlugin { m_colliderarr[i] = false; } - CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f; - //m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH.ToString()); - m_tainted_CAPSULE_LENGTH = CAPSULE_LENGTH; + + // We can set taint and actual to be the same here, since the entire character will be set up when the + // m_tainted_isPhysical is processed. + SetTaintedCapsuleLength(size); + CAPSULE_LENGTH = m_tainted_CAPSULE_LENGTH; m_isPhysical = false; // current status: no ODE information exists m_tainted_isPhysical = true; // new tainted status: need to create ODE information @@ -457,24 +459,28 @@ namespace OpenSim.Region.Physics.OdePlugin get { return new Vector3(CAPSULE_RADIUS * 2, CAPSULE_RADIUS * 2, CAPSULE_LENGTH); } set { - if (value.IsFinite()) - { - m_pidControllerActive = true; - - Vector3 SetSize = value; - m_tainted_CAPSULE_LENGTH = (SetSize.Z * 1.15f) - CAPSULE_RADIUS * 2.0f; -// m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH); + SetTaintedCapsuleLength(value); // If we reset velocity here, then an avatar stalls when it crosses a border for the first time // (as the height of the new root agent is set). // Velocity = Vector3.Zero; - _parent_scene.AddPhysicsActorTaint(this); - } - else - { - m_log.WarnFormat("[ODE CHARACTER]: Got a NaN Size from Scene on {0}", Name); - } + _parent_scene.AddPhysicsActorTaint(this); + } + } + + private void SetTaintedCapsuleLength(Vector3 size) + { + if (size.IsFinite()) + { + m_pidControllerActive = true; + + m_tainted_CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f; +// m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH); + } + else + { + m_log.WarnFormat("[ODE CHARACTER]: Got a NaN Size for {0} in {1}", Name, _parent_scene.Name); } } -- cgit v1.1 From 8013c0d2f5cf964bde3bb212b5828f708ad3c816 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 15 Dec 2011 22:33:14 +0000 Subject: Stop pointlessly setting the m_colliderarr[] to false in the ODECharacter constructor --- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 9200016..f2bb4bf 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -195,11 +195,6 @@ namespace OpenSim.Region.Physics.OdePlugin // new d.Matrix3(0.5f, 0.7071068f, 0.5f, -0.7071068f, 0f, 0.7071068f, 0.5f, -0.7071068f, // 0.5f); - for (int i = 0; i < 11; i++) - { - m_colliderarr[i] = false; - } - // We can set taint and actual to be the same here, since the entire character will be set up when the // m_tainted_isPhysical is processed. SetTaintedCapsuleLength(size); -- cgit v1.1 From 7e4a2d69d56713cbe77da4c1e5718be9bb423647 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 16 Dec 2011 08:48:29 -0800 Subject: HG minor bug fix and marked one method obsolete in UAS. --- .../CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index a87279a..cc9ba97 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -123,7 +123,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer { m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID); - m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI); + if (real_destination != null) + m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI); + else + m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI); return real_destination; } return region; -- cgit v1.1 From 3bf699ad36081c9c53ee6845a5c85a3a1856b923 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 16 Dec 2011 08:59:33 -0800 Subject: No functional changes. Changed the prefix of that log message [CONNECTION BEGIN] to [SCENE] because that's where the message happens. Also changed the instantiation of a vector object to be done only once instead of every time we receive a position update. --- OpenSim/Region/Framework/Scenes/Scene.cs | 12 ++++++------ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4ab6fe4..b43b227 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2512,7 +2512,7 @@ namespace OpenSim.Region.Framework.Scenes if (sp == null) { m_log.DebugFormat( - "[SCENE]: Adding new child scene presence {0} to scene {1}", client.Name, RegionInfo.RegionName); + "[SCENE]: Adding new child scene presence {0} to scene {1} at pos {2}", client.Name, RegionInfo.RegionName, client.StartPos); m_clientManager.Add(client); SubscribeToClientEvents(client); @@ -3249,9 +3249,9 @@ namespace OpenSim.Region.Framework.Scenes // Don't disable this log message - it's too helpful m_log.DebugFormat( - "[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6})", + "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6}, position {7})", RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, - agent.AgentID, agent.circuitcode, teleportFlags); + agent.AgentID, agent.circuitcode, teleportFlags, agent.startpos); if (LoginsDisabled) { @@ -3294,7 +3294,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[CONNECTION BEGIN]: Exception verifying presence {0}{1}", e.Message, e.StackTrace); + "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace); return false; } } @@ -3307,12 +3307,12 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[CONNECTION BEGIN]: Exception authorizing user {0}{1}", e.Message, e.StackTrace); + "[SCENE]: Exception authorizing user {0}{1}", e.Message, e.StackTrace); return false; } m_log.InfoFormat( - "[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", + "[SCENE]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, agent.AgentID, agent.circuitcode); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ac58dae..800b7e0 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -502,9 +502,9 @@ namespace OpenSim.Region.Framework.Scenes { m_pos = PhysicsActor.Position; -// m_log.DebugFormat( -// "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!", -// m_pos, Name, Scene.RegionInfo.RegionName); + //m_log.DebugFormat( + // "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!", + // m_pos, Name, Scene.RegionInfo.RegionName); } else { @@ -534,7 +534,6 @@ namespace OpenSim.Region.Framework.Scenes } } } - return m_pos; } set @@ -554,9 +553,9 @@ namespace OpenSim.Region.Framework.Scenes m_pos = value; ParentPosition = Vector3.Zero; -// m_log.DebugFormat( -// "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", -// Scene.RegionInfo.RegionName, Name, m_pos); + //m_log.DebugFormat( + // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", + // Scene.RegionInfo.RegionName, Name, m_pos); } } @@ -3006,6 +3005,7 @@ namespace OpenSim.Region.Framework.Scenes CopyFrom(cAgentData); } + private static Vector3 marker = new Vector3(-1f, -1f, -1f); /// /// This updates important decision making data about a child agent /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region @@ -3026,8 +3026,8 @@ namespace OpenSim.Region.Framework.Scenes // region's draw distance. // DrawDistance = cAgentData.Far; DrawDistance = Scene.DefaultDrawDistance; - - if (cAgentData.Position != new Vector3(-1f, -1f, -1f)) // UGH!! + + if (cAgentData.Position != marker) // UGH!! m_pos = cAgentData.Position + offset; if (Vector3.Distance(AbsolutePosition, posLastSignificantMove) >= Scene.ChildReprioritizationDistance) -- cgit v1.1 From 8300bb651e3d1b3c41bc7923cefde3f3ea96923d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 16 Dec 2011 09:33:22 -0800 Subject: Sends the consistent child agent position upon creation of the child agent in other regions, as opposed to <128, 128, 70> --- .../Framework/EntityTransfer/EntityTransferModule.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 2f947fd..87f292c 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1213,7 +1213,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); agent.BaseFolder = UUID.Zero; agent.InventoryFolder = UUID.Zero; - agent.startpos = new Vector3(128, 128, 70); + agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour); agent.child = true; agent.Appearance = sp.Appearance; if (currentAgentCircuit != null) @@ -1305,6 +1305,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } } + Vector3 CalculateOffset(ScenePresence sp, GridRegion neighbour) + { + int rRegionX = (int)sp.Scene.RegionInfo.RegionLocX; + int rRegionY = (int)sp.Scene.RegionInfo.RegionLocY; + int tRegionX = neighbour.RegionLocX / (int)Constants.RegionSize; + int tRegionY = neighbour.RegionLocY / (int)Constants.RegionSize; + int shiftx = (rRegionX - tRegionX) * (int)Constants.RegionSize; + int shifty = (rRegionY - tRegionY) * (int)Constants.RegionSize; + return new Vector3(shiftx, shifty, 0f); + } + private void InformClientOfNeighbourCompleted(IAsyncResult iar) { InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState; -- cgit v1.1 From a9b39d6e5d7961a03043e4a793dce8534035214a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Dec 2011 20:53:50 +0000 Subject: Tunnel [GroupsModule] DebugEnabled setting down into XmlRpcGroupsServicesConnectorModule so that we can record cache misses --- .../OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 9 +-------- .../XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | 12 +++++++++--- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index d452905..8baeaa4 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -29,25 +29,18 @@ using System; using System.Collections.Generic; using System.Reflection; using System.Timers; - using log4net; using Mono.Addins; using Nini.Config; - using OpenMetaverse; using OpenMetaverse.StructuredData; - using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; - using OpenSim.Services.Interfaces; - using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags; - - namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] @@ -90,7 +83,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // Configuration settings private bool m_groupsEnabled = false; private bool m_groupNoticesEnabled = true; - private bool m_debugEnabled = true; + private bool m_debugEnabled = false; #region IRegionModuleBase Members diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index a08bcd0..52fc27d 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs @@ -52,6 +52,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private bool m_debugEnabled = false; + public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | GroupPowers.Accountable | GroupPowers.JoinChat | @@ -81,7 +83,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups private Dictionary> m_groupsAgentsDroppedFromChatSession = new Dictionary>(); private Dictionary> m_groupsAgentsInvitedToChatSession = new Dictionary>(); - #region IRegionModuleBase Members public string Name @@ -115,7 +116,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups return; } - m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name); + m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name); m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); if ((m_groupsServerURI == null) || @@ -142,6 +143,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Timeout set to {0}.", m_cacheTimeout); } + m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false); + // If we got all the config options we need, lets start'er'up m_memoryCache = new ExpiringCache(); m_connectorEnabled = true; @@ -150,7 +153,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups public void Close() { - m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Closing {0}", this.Name); + m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Closing {0}", this.Name); } public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene) @@ -958,6 +961,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (resp == null) { + if (m_debugEnabled) + m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Cache miss for key {0}", CacheKey); + string UserService; UUID SessionID; GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); -- cgit v1.1 From 5d79f857b0020715f4fed4fdd9d9b764c1864960 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Dec 2011 20:54:28 +0000 Subject: Comment out accidentally left in "Adding physics prim" log message --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index afe646c..f716687 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -1780,7 +1780,7 @@ namespace OpenSim.Region.Physics.OdePlugin public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { - m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); +// m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name); return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid); } -- cgit v1.1 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') 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/ClientStack/Linden/UDP/LLClientView.cs | 1 + .../Region/Framework/Scenes/SceneObjectGroup.cs | 5 ++--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 26 +++++++--------------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 ----- 4 files changed, 11 insertions(+), 27 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 9c86c74..8b41c49 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -10345,6 +10345,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return true; } + private bool HandleGroupRoleMembersRequest(IClientAPI sender, Packet Pack) { GroupRoleMembersRequestPacket groupRoleMembersRequest = 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') 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 7f019cc196c046acd00aa8b58460f9aedcb650bb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 17 Dec 2011 00:27:19 +0000 Subject: If a startup simulator script is present, run it after the normal region selection code rather than before. This allows the script to change the selected region without having it immediately undone. Thanks to Garmin Kawaguichi for this patch. --- OpenSim/Region/Application/OpenSim.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 8d98cc9..ea09893 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -188,6 +188,18 @@ namespace OpenSim } } + // Hook up to the watchdog timer + Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler; + + PrintFileToConsole("startuplogo.txt"); + + // For now, start at the 'root' level by default + if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it + ChangeSelectedRegion("region", + new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName}); + else + ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); + //Run Startup Commands if (String.IsNullOrEmpty(m_startupCommandsFile)) { @@ -206,18 +218,6 @@ namespace OpenSim m_scriptTimer.Interval = 1200*1000; m_scriptTimer.Elapsed += RunAutoTimerScript; } - - // Hook up to the watchdog timer - Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler; - - PrintFileToConsole("startuplogo.txt"); - - // For now, start at the 'root' level by default - if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it - ChangeSelectedRegion("region", - new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName}); - else - ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); } /// -- cgit v1.1 From 964ec57ffe5ce2e9feac4295ade9cc4a5a223d69 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 16 Dec 2011 17:24:50 -0800 Subject: Changed the async approach on close child agents. This may improve crossings a little bit. --- OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 9 +++------ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 ++++- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index d76ed3e..58a7b20 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -204,13 +204,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendCloseChildAgentConnections(UUID agentID, List regionslst) { - Util.FireAndForget(delegate + foreach (ulong handle in regionslst) { - foreach (ulong handle in regionslst) - { - SendCloseChildAgent(agentID, handle); - } - }); + SendCloseChildAgent(agentID, handle); + } } public List RequestNamedRegions(string name, int maxNumber) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 800b7e0..b16eaba 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2955,7 +2955,10 @@ namespace OpenSim.Region.Framework.Scenes if (byebyeRegions.Count > 0) { m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents"); - m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, byebyeRegions); + Util.FireAndForget(delegate + { + m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, byebyeRegions); + }); } foreach (ulong handle in byebyeRegions) -- 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 --- .../World/Permissions/PermissionsModule.cs | 12 +++++++--- OpenSim/Region/Framework/Scenes/Scene.cs | 4 +--- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 14 ----------- .../Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 ++++ .../Avatar/XmlRpcGroups/GroupsModule.cs | 27 +++++++++++++++++++++- 6 files changed, 43 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 7760382..cdecd2f 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -384,9 +384,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_debugPermissions) m_log.Debug("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName); } - - // Checks if the given group is active and if the user is a group member - // with the powers requested (powers = 0 for no powers check) + + /// + /// Checks if the given group is active and if the user is a group member + /// with the powers requested (powers = 0 for no powers check) + /// + /// + /// + /// + /// protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers) { if (null == m_groupsModule) 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); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 8baeaa4..9969a15 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -218,6 +218,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; + client.OnObjectGroupRequest += HandleObjectGroupUpdate; client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; client.OnDirFindQuery += OnDirFindQuery; client.OnRequestAvatarProperties += OnRequestAvatarProperties; @@ -225,7 +226,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // Used for Notices and Group Invites/Accept/Reject client.OnInstantMessage += OnInstantMessage; - // Send client thier groups information. + // Send client their groups information. SendAgentGroupDataUpdate(client, client.AgentId); } @@ -328,6 +329,30 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups remoteClient.SendGroupNameReply(GroupID, GroupName); } + private void HandleObjectGroupUpdate( + IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage) + { + GroupMembershipData gmd = 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); + } + } + } + private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); -- cgit v1.1 From 684482352c2f580f2868704e2ba2236a751c5bc4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 17 Dec 2011 02:35:08 +0000 Subject: Fix bug where objects couldn't be set back to the "none" group. This is handled by treating UUID.Zero as a special case. Currently, asking for the "none" group returns nothing because XMLRPC groups, at least, is not properly handling this case. It may be better in the future to have GroupsModule return an appropriate GroupsData structure instead or require the underlying services to behave appropriately. This is a further component of http://opensimulator.org/mantis/view.php?id=5588 --- .../Avatar/XmlRpcGroups/GroupsModule.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 9969a15..e959821 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -332,15 +332,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups private void HandleObjectGroupUpdate( IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage) { - GroupMembershipData gmd = GetMembershipData(GroupID, remoteClient.AgentId); - - if (gmd == null) + // 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) { -// 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; + GroupMembershipData gmd = 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); -- cgit v1.1 From 4d065f04534e4b5f1be451796386808347d6e72e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 17 Dec 2011 02:42:43 +0000 Subject: Provide user feedback on execution of "backup" region console command --- OpenSim/Region/Application/OpenSim.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index ea09893..3a1a8c7 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -796,6 +796,7 @@ namespace OpenSim break; case "backup": + MainConsole.Instance.Output("Triggering save of pending object updates to persistent store"); m_sceneManager.BackupCurrentScene(); break; @@ -806,7 +807,7 @@ namespace OpenSim if (m_sceneManager.TryGetScene(regRemoveName, out removeScene)) RemoveRegion(removeScene, false); else - MainConsole.Instance.Output("no region with that name"); + MainConsole.Instance.Output("No region with that name"); break; case "delete-region": -- 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. --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 17 +++++-- .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 57 +++++++++++++++++++--- .../Framework/Interfaces/IAvatarFactoryModule.cs | 11 ++++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- .../Avatar/Appearance/AppearanceInfoModule.cs | 34 +------------ 5 files changed, 74 insertions(+), 47 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 8b41c49..f9a6643 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -441,6 +441,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP public LLClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode) { +// DebugPacketLevel = 1; + RegisterInterface(this); RegisterInterface(this); RegisterInterface(this); @@ -6001,7 +6003,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP // for the client session anyway, in order to protect ourselves against bad code in plugins try { - byte[] visualparams = new byte[appear.VisualParam.Length]; for (int i = 0; i < appear.VisualParam.Length; i++) visualparams[i] = appear.VisualParam[i].ParamValue; @@ -11219,9 +11220,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// Send a response back to a client when it asks the asset server (via the region server) if it has /// its appearance texture cached. - /// - /// At the moment, we always reply that there is no cached texture. /// + /// + /// At the moment, we always reply that there is no cached texture. + /// /// /// /// @@ -11231,7 +11233,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet; AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); - if (cachedtex.AgentData.SessionID != SessionId) return false; + if (cachedtex.AgentData.SessionID != SessionId) + return false; // TODO: don't create new blocks if recycling an old packet cachedresp.AgentData.AgentID = AgentId; @@ -11629,6 +11632,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (DebugPacketLevel <= 50 && packet.Type == PacketType.ImprovedTerseObjectUpdate) logPacket = false; + if (DebugPacketLevel <= 25 && packet.Type == PacketType.ObjectPropertiesFamily) + logPacket = false; + if (logPacket) m_log.DebugFormat( "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}", @@ -11686,6 +11692,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) logPacket = false; + if (DebugPacketLevel <= 25 && packet.Type == PacketType.RequestObjectPropertiesFamily) + logPacket = false; + if (logPacket) m_log.DebugFormat( "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}", diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 29e3580..f1a81ae 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -26,16 +26,15 @@ */ using System; +using System.Collections.Generic; using System.Reflection; +using System.Threading; +using System.Text; +using System.Timers; using log4net; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; - -using System.Threading; -using System.Timers; -using System.Collections.Generic; - using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; @@ -45,6 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public const string BAKED_TEXTURES_REPORT_FORMAT = "{0,-9} {1}"; + private Scene m_scene = null; private int m_savetime = 5; // seconds to wait before saving changed appearance @@ -147,9 +149,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // Process the baked texture array if (textureEntry != null) { + m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID); + +// WriteBakedTexturesReport(sp, m_log.DebugFormat); + changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; - m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID); +// WriteBakedTexturesReport(sp, m_log.DebugFormat); ValidateBakedTextureCache(sp, false); // This appears to be set only in the final stage of the appearance @@ -254,9 +260,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } /// - /// Queue up a request to send appearance, makes it possible to - /// accumulate changes without sending out each one separately. + /// Queue up a request to send appearance. /// + /// + /// Makes it possible to accumulate changes without sending out each one separately. + /// + /// public void QueueAppearanceSend(UUID agentid) { // m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); @@ -557,5 +566,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } } #endregion + + public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction) + { + outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName); + outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID"); + + Dictionary bakedTextures = GetBakedTextureFaces(sp.UUID); + + foreach (BakeType bt in bakedTextures.Keys) + { + string rawTextureID; + + if (bakedTextures[bt] == null) + { + rawTextureID = "not set"; + } + else + { + rawTextureID = bakedTextures[bt].TextureID.ToString(); + + if (m_scene.AssetService.Get(rawTextureID) == null) + rawTextureID += " (not found)"; + else + rawTextureID += " (uploaded)"; + } + + outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID); + } + + bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp); + outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); + } } } 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()); diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs index 40cbc60..1ce24f1 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs @@ -50,8 +50,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}"; - private Dictionary m_scenes = new Dictionary(); // private IAvatarFactoryModule m_avatarFactory; @@ -197,37 +195,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance { ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); if (sp != null && !sp.IsChildAgent) - { - MainConsole.Instance.OutputFormat("For {0} in {1}", sp.Name, scene.RegionInfo.RegionName); - MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, "Bake Type", "UUID"); - - Dictionary bakedTextures - = scene.AvatarFactory.GetBakedTextureFaces(sp.UUID); - foreach (BakeType bt in bakedTextures.Keys) - { - string rawTextureID; - - if (bakedTextures[bt] == null) - { - rawTextureID = "not set"; - } - else - { - rawTextureID = bakedTextures[bt].TextureID.ToString(); - - if (scene.AssetService.Get(rawTextureID) == null) - rawTextureID += " (not found)"; - else - rawTextureID += " (uploaded)"; - } - - MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, bt, rawTextureID); - } - - bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); - MainConsole.Instance.OutputFormat( - "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); - } + scene.AvatarFactory.WriteBakedTexturesReport(sp, MainConsole.Instance.OutputFormat); } else { -- cgit v1.1 From e8fbeeba5f2c02bf89ade1d8c0fa135d065096e7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 19 Dec 2011 19:08:24 +0000 Subject: Fix race condition where the appearance update timer could be stopped just after another thread had started it on QueueAppearanceSave() or *Send() However, the window for this race is very small, and the next queued appearance save or send would restart the timer anyway. --- .../CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index f1a81ae..e8aee3e 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -417,10 +417,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory m_savequeue.Remove(avatarID); } } - } - if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) - m_updateTimer.Stop(); + // We must lock both queues here so that QueueAppearanceSave() or *Send() don't m_updateTimer.Start() on + // another thread inbetween the first count calls and m_updateTimer.Stop() on this thread. + lock (m_sendqueue) + if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) + m_updateTimer.Stop(); + } } private void SaveAppearance(UUID agentid) -- cgit v1.1 From 2899de1a5c8060397e813ee853c525572a81db03 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 19 Dec 2011 19:19:05 +0000 Subject: Stop unnecessarily sending the TextureEntry in client avatar updates. As far as I know, viewers don't use this mechanism to recieve new TextureEntry data for avatars. This is done via the AvatarAppearance packet instead. Tested this back to viewer 1.23. Replacing with Utils.EmptyBytes since converting the texture entry to bytes on each AvatarUpdate (or which there are many) is not cost-free. --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f9a6643..b37fd54 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -4895,8 +4895,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP update.Scale = new Vector3(0.45f, 0.6f, 1.9f); update.Text = Utils.EmptyBytes; update.TextColor = new byte[4]; + + // Don't send texture anim for avatars - this has no meaning for them. update.TextureAnim = Utils.EmptyBytes; - update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes; + + // Don't send texture entry for avatars here - this is accomplished via the AvatarAppearance packet + update.TextureEntry = Utils.EmptyBytes; +// update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes; + update.UpdateFlags = (uint)( PrimFlags.Physics | PrimFlags.ObjectModify | PrimFlags.ObjectCopy | PrimFlags.ObjectAnyOwner | PrimFlags.ObjectYouOwner | PrimFlags.ObjectMove | PrimFlags.InventoryEmpty | PrimFlags.ObjectTransfer | -- 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') 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 +++--- .../Avatar/XmlRpcGroups/GroupsModule.cs | 30 ----------------- 3 files changed, 44 insertions(+), 36 deletions(-) (limited to 'OpenSim/Region') 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) { diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index e959821..740dbdd 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -218,7 +218,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; - client.OnObjectGroupRequest += HandleObjectGroupUpdate; client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; client.OnDirFindQuery += OnDirFindQuery; client.OnRequestAvatarProperties += OnRequestAvatarProperties; @@ -329,35 +328,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups remoteClient.SendGroupNameReply(GroupID, GroupName); } - private void HandleObjectGroupUpdate( - IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage) - { - // 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 = 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); - } - } - } - private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); -- cgit v1.1 From 25cbba9bca9388b414b3d4fe1e6d09a9fd5f7667 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 20 Dec 2011 09:43:39 -0800 Subject: Fixed bug of avie going under the terrain when crossing regions in certain directions. This was a 1-off bug: the terrain was being placed in 127, 127 resulting in a bounding box if -2, 256. I placed it in 128, 128 resulting in a bounding box of -1, 257. --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index afe646c..d8aad7b 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -3430,7 +3430,7 @@ namespace OpenSim.Region.Physics.OdePlugin private void SetTerrain(float[] heightMap, Vector3 pOffset) { int startTime = Util.EnvironmentTickCount(); - m_log.DebugFormat("[ODE SCENE]: Setting terrain for {0}", Name); + m_log.DebugFormat("[ODE SCENE]: Setting terrain for {0} with offset {1}", Name, pOffset); // this._heightmap[i] = (double)heightMap[i]; // dbm (danx0r) -- creating a buffer zone of one extra sample all around @@ -3544,7 +3544,7 @@ namespace OpenSim.Region.Physics.OdePlugin d.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle); d.GeomSetRotation(GroundGeom, ref R); - d.GeomSetPosition(GroundGeom, (pOffset.X + ((int)Constants.RegionSize * 0.5f)) - 1, (pOffset.Y + ((int)Constants.RegionSize * 0.5f)) - 1, 0); + d.GeomSetPosition(GroundGeom, (pOffset.X + ((int)Constants.RegionSize * 0.5f)), (pOffset.Y + ((int)Constants.RegionSize * 0.5f)), 0); IntPtr testGround = IntPtr.Zero; if (RegionTerrain.TryGetValue(pOffset, out testGround)) { -- cgit v1.1 From fa0a71253f0c824b6fc952c1a8927c8f189892b9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 20 Dec 2011 18:54:15 +0000 Subject: Though the viewer warns about receiving this, not sending appears to break baked texture caching when crossing region boundaries. Needs further investigation. Revert "Stop sending the viewer its own AvatarAppearance packet." This reverts commit 92039f295d7fe66bf1a09b29483f9057e395839e. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 36d8c0b..b8ae553 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2532,10 +2532,7 @@ 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(); - - // Sending us our own appearance does not seem to be necessary, and the viewer warns in the log if you do - // this. -// SendAppearanceToAgent(this); + SendAppearanceToAgent(this); // If we are using the the cached appearance then send it out to everyone if (cachedappearance) -- cgit v1.1 From 41b02a7208a8363f8edefb812e4f93238759d2bd Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Tue, 20 Dec 2011 14:45:32 -0800 Subject: Remove unused SetAcceleration and add set on Acceleration parameter --- OpenSim/Region/Application/OpenSimBase.cs | 2 +- OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs | 6 +----- OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 3 ++- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 3 ++- OpenSim/Region/Physics/Manager/PhysicsActor.cs | 3 ++- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 7 +------ OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 1 + OpenSim/Region/Physics/POSPlugin/POSCharacter.cs | 6 +----- OpenSim/Region/Physics/POSPlugin/POSPrim.cs | 6 +----- OpenSim/Region/Physics/PhysXPlugin/PhysXCharacter.cs | 6 +----- OpenSim/Region/Physics/PhysXPlugin/PhysXPrim.cs | 6 +----- 11 files changed, 14 insertions(+), 35 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 55ba18a..9f9b4f0 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -46,7 +46,7 @@ using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; -using OpenSim.Server.Base; +using OpenSim.Server.Base; using OpenSim.Services.Base; using OpenSim.Services.Interfaces; using OpenSim.Services.UserAccountService; diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs index 1e1d5e3..b1a3ff9 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs @@ -233,6 +233,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin public override Vector3 Acceleration { get { return _acceleration; } + set { _acceleration = value; } } public override bool Kinematic @@ -253,11 +254,6 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin { } - public void SetAcceleration(Vector3 accel) - { - _acceleration = accel; - } - public override void AddForce(Vector3 force, bool pushforce) { } diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 9a6857b..0cab5d1 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs @@ -231,7 +231,8 @@ public class BSCharacter : PhysicsActor } } public override Vector3 Acceleration { - get { return _acceleration; } + get { return _acceleration; } + set { _acceleration = value; } } public override Quaternion Orientation { get { return _orientation; } diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 8782e62..898436b 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -417,7 +417,8 @@ public sealed class BSPrim : PhysicsActor } } public override OMV.Vector3 Acceleration { - get { return _acceleration; } + get { return _acceleration; } + set { _acceleration = value; } } public override OMV.Quaternion Orientation { get { return _orientation; } diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index c2acf97..0587054 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -261,7 +261,7 @@ namespace OpenSim.Region.Physics.Manager public abstract Vector3 Torque { get; set; } public abstract float CollisionScore { get; set;} - public abstract Vector3 Acceleration { get; } + public abstract Vector3 Acceleration { get; set; } public abstract Quaternion Orientation { get; set; } public abstract int PhysicsActorType { get; set; } public abstract bool IsPhysical { get; set; } @@ -458,6 +458,7 @@ namespace OpenSim.Region.Physics.Manager public override Vector3 Acceleration { get { return Vector3.Zero; } + set { } } public override bool IsPhysical diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index f2bb4bf..68999fc 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -690,12 +690,7 @@ namespace OpenSim.Region.Physics.OdePlugin public override Vector3 Acceleration { get { return _acceleration; } - } - - public void SetAcceleration(Vector3 accel) - { - m_pidControllerActive = true; - _acceleration = accel; + set { _acceleration = value; } } /// diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 94e6185..75364b7 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -2497,6 +2497,7 @@ Console.WriteLine(" JointCreateFixed"); public override Vector3 Acceleration { get { return _acceleration; } + set { _acceleration = value; } } public override void AddForce(Vector3 force, bool pushforce) diff --git a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs index a70179b..ae534ea 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs @@ -231,6 +231,7 @@ namespace OpenSim.Region.Physics.POSPlugin public override Vector3 Acceleration { get { return _acceleration; } + set { _acceleration = value; } } public override bool Kinematic @@ -251,11 +252,6 @@ namespace OpenSim.Region.Physics.POSPlugin { } - public void SetAcceleration(Vector3 accel) - { - _acceleration = accel; - } - public override void AddForce(Vector3 force, bool pushforce) { } diff --git a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs index 91ec3df..e4fd7eb 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs @@ -193,6 +193,7 @@ namespace OpenSim.Region.Physics.POSPlugin public override Vector3 Acceleration { get { return _acceleration; } + set { _acceleration = value; } } public override bool Kinematic @@ -201,11 +202,6 @@ namespace OpenSim.Region.Physics.POSPlugin set { } } - public void SetAcceleration(Vector3 accel) - { - _acceleration = accel; - } - public override void AddForce(Vector3 force, bool pushforce) { } diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXCharacter.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXCharacter.cs index 92261cd..9216a9e 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXCharacter.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXCharacter.cs @@ -233,11 +233,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin public override Vector3 Acceleration { get { return _acceleration; } - } - - public void SetAcceleration(Vector3 accel) - { - _acceleration = accel; + set { _acceleration = value; } } public override void AddForce(Vector3 force, bool pushforce) diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPrim.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPrim.cs index c0e24fd..42bd119 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPrim.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPrim.cs @@ -207,11 +207,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin public override Vector3 Acceleration { get { return _acceleration; } - } - - public void SetAcceleration(Vector3 accel) - { - _acceleration = accel; + set { _acceleration = value; } } public override void AddForce(Vector3 force, bool pushforce) -- cgit v1.1