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(-) 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 From 651f9f47d0dec64e70bc257f4695313fad839b7a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 21 Dec 2011 14:56:38 -0800 Subject: HG: Verify that the user is local --- OpenSim/Services/HypergridService/UserAgentService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index cdc560c..8538660 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -161,6 +161,14 @@ namespace OpenSim.Services.HypergridService { m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI); + + if (m_UserAccountService.GetUserAccount(UUID.Zero, agentCircuit.AgentID) == null) + { + m_log.WarnFormat("[USER AGENT SERVICE]: Someone attempted to lauch a foreign user from here {0} {1}", agentCircuit.firstname, agentCircuit.lastname); + reason = "Forbidden to launch your agents from here"; + return false; + } + // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination GridRegion region = new GridRegion(gatekeeper); region.ServerURI = gatekeeper.ServerURI; -- cgit v1.1 From ddff2f246cb4862abcac5308ae2532c9828691fb Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 21 Dec 2011 15:17:26 -0800 Subject: Moved an external test into the method that uses those preconditions. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 30 +++++++++--------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 36d8c0b..526fab3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1161,10 +1161,10 @@ namespace OpenSim.Region.Framework.Scenes public void CompleteMovement(IClientAPI client, bool openChildAgents) { // DateTime startTime = DateTime.Now; - -// m_log.DebugFormat( -// "[SCENE PRESENCE]: Completing movement of {0} into region {1}", -// client.Name, Scene.RegionInfo.RegionName); + + m_log.DebugFormat( + "[SCENE PRESENCE]: Completing movement of {0} into region {1} in position {2}", + client.Name, Scene.RegionInfo.RegionName, AbsolutePosition); Vector3 look = Velocity; if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) @@ -2383,9 +2383,7 @@ namespace OpenSim.Region.Framework.Scenes m_lastVelocity = Velocity; } - // followed suggestion from mic bowman. reversed the two lines below. - if (ParentID == 0 && PhysicsActor != null || ParentID != 0) // Check that we have a physics actor or we're sitting on something - CheckForBorderCrossing(); + CheckForBorderCrossing(); CheckForSignificantMovement(); // sends update to the modules. } @@ -2741,7 +2739,8 @@ namespace OpenSim.Region.Framework.Scenes /// protected void CheckForBorderCrossing() { - if (IsChildAgent) + // Check that we we are not a child and have a physics actor or we're sitting on something + if (IsChildAgent || (ParentID == 0 && PhysicsActor != null || ParentID != 0)) return; Vector3 pos2 = AbsolutePosition; @@ -2757,7 +2756,6 @@ namespace OpenSim.Region.Framework.Scenes if (!IsInTransit) { // Checks if where it's headed exists a region - bool needsTransit = false; if (m_scene.TestBorderCross(pos2, Cardinals.W)) { @@ -2828,7 +2826,7 @@ namespace OpenSim.Region.Framework.Scenes Velocity = Vector3.Zero; AbsolutePosition = pos; -// m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); + m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); AddToPhysicalScene(isFlying); } @@ -2861,22 +2859,16 @@ namespace OpenSim.Region.Framework.Scenes } } else - { - // We must remove the agent from the physical scene if it has been placed in transit. If we don't, - // then this method continues to be called from ScenePresence.Update() until the handover of the client between - // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms - // event queue polling response from the server), this results in the avatar pausing on the border - // for the handover period. - RemoveFromPhysicalScene(); - + { // This constant has been inferred from experimentation // I'm not sure what this value should be, so I tried a few values. timeStep = 0.04f; pos2 = AbsolutePosition; pos2.X = pos2.X + (vel.X * timeStep); pos2.Y = pos2.Y + (vel.Y * timeStep); - pos2.Z = pos2.Z + (vel.Z * timeStep); + // Don't touch the Z m_pos = pos2; + m_log.ErrorFormat("m_pos={0}", m_pos); } } -- cgit v1.1 From 219ec7ef20ccefb257be5ec650a13758b2a3cda3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 22 Dec 2011 08:18:03 -0800 Subject: Fixing a bug introduced yesterday. This put the precondition test inside CheckForBorderCrossing the right way. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 214 ++++++++++++----------- 1 file changed, 109 insertions(+), 105 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6f02475..040cbfc 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2736,137 +2736,141 @@ namespace OpenSim.Region.Framework.Scenes /// protected void CheckForBorderCrossing() { - // Check that we we are not a child and have a physics actor or we're sitting on something - if (IsChildAgent || (ParentID == 0 && PhysicsActor != null || ParentID != 0)) + // Check that we we are not a child + if (IsChildAgent) return; - Vector3 pos2 = AbsolutePosition; - Vector3 vel = Velocity; - int neighbor = 0; - int[] fix = new int[2]; + // We only do this if we have a physics actor or we're sitting on something + if (ParentID == 0 && PhysicsActor != null || ParentID != 0) + { + Vector3 pos2 = AbsolutePosition; + Vector3 vel = Velocity; + int neighbor = 0; + int[] fix = new int[2]; - float timeStep = 0.1f; - pos2.X = pos2.X + (vel.X*timeStep); - pos2.Y = pos2.Y + (vel.Y*timeStep); - pos2.Z = pos2.Z + (vel.Z*timeStep); + float timeStep = 0.1f; + pos2.X = pos2.X + (vel.X * timeStep); + pos2.Y = pos2.Y + (vel.Y * timeStep); + pos2.Z = pos2.Z + (vel.Z * timeStep); - if (!IsInTransit) - { - // Checks if where it's headed exists a region - bool needsTransit = false; - if (m_scene.TestBorderCross(pos2, Cardinals.W)) + if (!IsInTransit) { - if (m_scene.TestBorderCross(pos2, Cardinals.S)) + // Checks if where it's headed exists a region + bool needsTransit = false; + if (m_scene.TestBorderCross(pos2, Cardinals.W)) { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.SW, ref fix); - } - else if (m_scene.TestBorderCross(pos2, Cardinals.N)) - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.NW, ref fix); + if (m_scene.TestBorderCross(pos2, Cardinals.S)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.SW, ref fix); + } + else if (m_scene.TestBorderCross(pos2, Cardinals.N)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.NW, ref fix); + } + else + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.W, ref fix); + } } - else + else if (m_scene.TestBorderCross(pos2, Cardinals.E)) { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.W, ref fix); + if (m_scene.TestBorderCross(pos2, Cardinals.S)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.SE, ref fix); + } + else if (m_scene.TestBorderCross(pos2, Cardinals.N)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.NE, ref fix); + } + else + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.E, ref fix); + } } - } - else if (m_scene.TestBorderCross(pos2, Cardinals.E)) - { - if (m_scene.TestBorderCross(pos2, Cardinals.S)) + else if (m_scene.TestBorderCross(pos2, Cardinals.S)) { needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.SE, ref fix); + neighbor = m_scene.HaveNeighbor(Cardinals.S, ref fix); } else if (m_scene.TestBorderCross(pos2, Cardinals.N)) { needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.NE, ref fix); + neighbor = m_scene.HaveNeighbor(Cardinals.N, ref fix); } - else - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.E, ref fix); - } - } - else if (m_scene.TestBorderCross(pos2, Cardinals.S)) - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.S, ref fix); - } - else if (m_scene.TestBorderCross(pos2, Cardinals.N)) - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.N, ref fix); - } - // Makes sure avatar does not end up outside region - if (neighbor <= 0) - { - if (needsTransit) + // Makes sure avatar does not end up outside region + if (neighbor <= 0) { - if (m_requestedSitTargetUUID == UUID.Zero) + if (needsTransit) { - bool isFlying = Flying; - RemoveFromPhysicalScene(); - - Vector3 pos = AbsolutePosition; - if (AbsolutePosition.X < 0) - pos.X += Velocity.X * 2; - else if (AbsolutePosition.X > Constants.RegionSize) - pos.X -= Velocity.X * 2; - if (AbsolutePosition.Y < 0) - pos.Y += Velocity.Y * 2; - else if (AbsolutePosition.Y > Constants.RegionSize) - pos.Y -= Velocity.Y * 2; - Velocity = Vector3.Zero; - AbsolutePosition = pos; - - m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); - - AddToPhysicalScene(isFlying); + if (m_requestedSitTargetUUID == UUID.Zero) + { + bool isFlying = Flying; + RemoveFromPhysicalScene(); + + Vector3 pos = AbsolutePosition; + if (AbsolutePosition.X < 0) + pos.X += Velocity.X * 2; + else if (AbsolutePosition.X > Constants.RegionSize) + pos.X -= Velocity.X * 2; + if (AbsolutePosition.Y < 0) + pos.Y += Velocity.Y * 2; + else if (AbsolutePosition.Y > Constants.RegionSize) + pos.Y -= Velocity.Y * 2; + Velocity = Vector3.Zero; + AbsolutePosition = pos; + + m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); + + AddToPhysicalScene(isFlying); + } } } - } - else if (neighbor > 0) - { - if (!CrossToNewRegion()) + else if (neighbor > 0) { - if (m_requestedSitTargetUUID == UUID.Zero) + if (!CrossToNewRegion()) { - bool isFlying = Flying; - RemoveFromPhysicalScene(); - - Vector3 pos = AbsolutePosition; - if (AbsolutePosition.X < 0) - pos.X += Velocity.X * 2; - else if (AbsolutePosition.X > Constants.RegionSize) - pos.X -= Velocity.X * 2; - if (AbsolutePosition.Y < 0) - pos.Y += Velocity.Y * 2; - else if (AbsolutePosition.Y > Constants.RegionSize) - pos.Y -= Velocity.Y * 2; - Velocity = Vector3.Zero; - AbsolutePosition = pos; - - AddToPhysicalScene(isFlying); + if (m_requestedSitTargetUUID == UUID.Zero) + { + bool isFlying = Flying; + RemoveFromPhysicalScene(); + + Vector3 pos = AbsolutePosition; + if (AbsolutePosition.X < 0) + pos.X += Velocity.X * 2; + else if (AbsolutePosition.X > Constants.RegionSize) + pos.X -= Velocity.X * 2; + if (AbsolutePosition.Y < 0) + pos.Y += Velocity.Y * 2; + else if (AbsolutePosition.Y > Constants.RegionSize) + pos.Y -= Velocity.Y * 2; + Velocity = Vector3.Zero; + AbsolutePosition = pos; + + AddToPhysicalScene(isFlying); + } } } } - } - else - { - // This constant has been inferred from experimentation - // I'm not sure what this value should be, so I tried a few values. - timeStep = 0.04f; - pos2 = AbsolutePosition; - pos2.X = pos2.X + (vel.X * timeStep); - pos2.Y = pos2.Y + (vel.Y * timeStep); - // Don't touch the Z - m_pos = pos2; - m_log.ErrorFormat("m_pos={0}", m_pos); - } + else + { + // This constant has been inferred from experimentation + // I'm not sure what this value should be, so I tried a few values. + timeStep = 0.04f; + pos2 = AbsolutePosition; + pos2.X = pos2.X + (vel.X * timeStep); + pos2.Y = pos2.Y + (vel.Y * timeStep); + // Don't touch the Z + m_pos = pos2; + m_log.DebugFormat("[SCENE PRESENCE]: In transit m_pos={0}", m_pos); + } + } } /// -- cgit v1.1