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(-)
(limited to 'OpenSim/Region')
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(-)
(limited to 'OpenSim/Region')
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
From 2347593dac0d435851fb1437b87c42a5fd4f9060 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 22 Dec 2011 16:48:52 +0000
Subject: Harmonizing SP with Avination
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 96 ++++++++++++++----------
1 file changed, 55 insertions(+), 41 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 040cbfc..c578fc0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes
/// TODO: For some reason, we effectively have a list both here and in Appearance. Need to work out if this is
/// necessary.
///
- protected List m_attachments = new List();
+ private List m_attachments = new List();
public Object AttachmentsSyncLock { get; private set; }
@@ -550,8 +550,12 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- m_pos = value;
- ParentPosition = Vector3.Zero;
+ // Don't update while sitting
+ if (ParentID == 0)
+ {
+ m_pos = value;
+ ParentPosition = Vector3.Zero;
+ }
//m_log.DebugFormat(
// "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}",
@@ -566,6 +570,13 @@ namespace OpenSim.Region.Framework.Scenes
public Vector3 OffsetPosition
{
get { return m_pos; }
+ set
+ {
+ // There is no offset position when not seated
+ if (ParentID == 0)
+ return;
+ m_pos = value;
+ }
}
///
@@ -2740,8 +2751,10 @@ namespace OpenSim.Region.Framework.Scenes
if (IsChildAgent)
return;
- // We only do this if we have a physics actor or we're sitting on something
- if (ParentID == 0 && PhysicsActor != null || ParentID != 0)
+ if (ParentID != 0)
+ return;
+
+ if (!IsInTransit)
{
Vector3 pos2 = AbsolutePosition;
Vector3 vel = Velocity;
@@ -3100,30 +3113,28 @@ namespace OpenSim.Region.Framework.Scenes
catch { }
// Attachment objects
- lock (m_attachments)
+ List attachments = GetAttachments();
+ if (attachments.Count > 0)
{
- if (m_attachments.Count > 0)
- {
- cAgent.AttachmentObjects = new List();
- cAgent.AttachmentObjectStates = new List();
- // IScriptModule se = m_scene.RequestModuleInterface();
- InTransitScriptStates.Clear();
+ cAgent.AttachmentObjects = new List();
+ cAgent.AttachmentObjectStates = new List();
+// IScriptModule se = m_scene.RequestModuleInterface();
+ InTransitScriptStates.Clear();
- foreach (SceneObjectGroup sog in m_attachments)
- {
- // We need to make a copy and pass that copy
- // because of transfers withn the same sim
- ISceneObject clone = sog.CloneForNewScene();
- // Attachment module assumes that GroupPosition holds the offsets...!
- ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
- ((SceneObjectGroup)clone).IsAttachment = false;
- cAgent.AttachmentObjects.Add(clone);
- string state = sog.GetStateSnapshot();
- cAgent.AttachmentObjectStates.Add(state);
- InTransitScriptStates.Add(state);
- // Let's remove the scripts of the original object here
- sog.RemoveScriptInstances(true);
- }
+ foreach (SceneObjectGroup sog in attachments)
+ {
+ // We need to make a copy and pass that copy
+ // because of transfers withn the same sim
+ ISceneObject clone = sog.CloneForNewScene();
+ // Attachment module assumes that GroupPosition holds the offsets...!
+ ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
+ ((SceneObjectGroup)clone).IsAttachment = false;
+ cAgent.AttachmentObjects.Add(clone);
+ string state = sog.GetStateSnapshot();
+ cAgent.AttachmentObjectStates.Add(state);
+ InTransitScriptStates.Add(state);
+ // Let's remove the scripts of the original object here
+ sog.RemoveScriptInstances(true);
}
}
}
@@ -3531,26 +3542,29 @@ namespace OpenSim.Region.Framework.Scenes
/// The arguments for the event
public void SendScriptEventToAttachments(string eventName, Object[] args)
{
- if (m_scriptEngines.Length == 0)
- return;
-
- lock (m_attachments)
+ Util.FireAndForget(delegate(object x)
{
- foreach (SceneObjectGroup grp in m_attachments)
+ if (m_scriptEngines.Length == 0)
+ return;
+
+ lock (m_attachments)
{
- // 16384 is CHANGED_ANIMATION
- //
- // Send this to all attachment root prims
- //
- foreach (IScriptModule m in m_scriptEngines)
+ foreach (SceneObjectGroup grp in m_attachments)
{
- if (m == null) // No script engine loaded
- continue;
+ // 16384 is CHANGED_ANIMATION
+ //
+ // Send this to all attachment root prims
+ //
+ foreach (IScriptModule m in m_scriptEngines)
+ {
+ if (m == null) // No script engine loaded
+ continue;
- m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION });
+ m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION });
+ }
}
}
- }
+ });
}
internal void PushForce(Vector3 impulse)
--
cgit v1.1
From 6412349decb36a7278528477bacb5b71534ad657 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 22 Dec 2011 16:51:51 +0000
Subject: Add a few comments, correct a merge artefact
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c578fc0..fc6eb6d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -570,6 +570,8 @@ namespace OpenSim.Region.Framework.Scenes
public Vector3 OffsetPosition
{
get { return m_pos; }
+ // Don't remove setter. It's not currently used in core but
+ // upcoming Avination code needs it.
set
{
// There is no offset position when not seated
@@ -2751,7 +2753,10 @@ namespace OpenSim.Region.Framework.Scenes
if (IsChildAgent)
return;
- if (ParentID != 0)
+ // If we don't have a PhysActor, we can't cross anyway
+ // Also don't do this while sat, sitting avatars cross with the
+ // object they sit on.
+ if (ParentID != 0 || PhysActor == null)
return;
if (!IsInTransit)
--
cgit v1.1
From 7f527814d524fe6b0fb5243dbdb558e5b661e4a5 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 22 Dec 2011 16:57:49 +0000
Subject: And a typo fix
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index fc6eb6d..3d1c1b5 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2756,7 +2756,7 @@ namespace OpenSim.Region.Framework.Scenes
// If we don't have a PhysActor, we can't cross anyway
// Also don't do this while sat, sitting avatars cross with the
// object they sit on.
- if (ParentID != 0 || PhysActor == null)
+ if (ParentID != 0 || PhysicsActor == null)
return;
if (!IsInTransit)
--
cgit v1.1
From 469955889ed5499ed1dbb8fcc224d6912c651d06 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 22 Dec 2011 09:30:06 -0800
Subject: Region crossings redone: (1) removed WaitForCallback. Now that we are
passing the entire agent with attachs in one big message we don't necessarily
need to wait for confirmation. The callback sometimes is problematic and it
adds delay to the process. (2) Z velocity sent to the viewer = 0. This is an
heuristic; the Z velocity usually is negative, and it makes the viewer move
the avie down. This only matters while the agent is in transit and therefore
not being physically simulated by neither region. As soon as the receiving
region receives CompleteMovement from the viewer, the position and velocity
get corrected.
---
.../EntityTransfer/EntityTransferModule.cs | 71 ++++++++++------------
1 file changed, 32 insertions(+), 39 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 87f292c..b9d5d32 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -676,9 +676,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
Vector3 eastCross = new Vector3(boundaryDistance, 0, 0);
Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0);
- // distance to edge that will trigger crossing
-
-
// distance into new region to place avatar
const float enterDistance = 0.5f;
@@ -960,29 +957,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.",
agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName);
-
- pos = pos + (agent.Velocity);
-
+
+ pos = pos + agent.Velocity;
+ Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0);
+
+ agent.RemoveFromPhysicalScene();
SetInTransit(agent.UUID);
- AgentData cAgent = new AgentData();
+
+ AgentData cAgent = new AgentData();
agent.CopyTo(cAgent);
cAgent.Position = pos;
if (isFlying)
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
- cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
- "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
-
+
+ // We don't need the callback anymnore
+ cAgent.CallbackURI = String.Empty;
+
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
{
// region doesn't take it
ReInstantiateScripts(agent);
+ agent.AddToPhysicalScene(isFlying);
ResetFromTransit(agent.UUID);
return agent;
}
- // Next, let's close the child agent connections that are too far away.
- agent.CloseChildAgents(neighbourx, neighboury);
-
//AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
agent.ControllingClient.RequestClientInfo();
@@ -999,11 +998,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
-
+
IEventQueue eq = agent.Scene.RequestModuleInterface();
if (eq != null)
{
- eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
+ eq.CrossRegion(neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint,
capsPath, agent.UUID, agent.ControllingClient.SessionId);
}
else
@@ -1011,32 +1010,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
capsPath);
}
-
- if (!WaitForCallback(agent.UUID))
- {
- m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent");
- ReInstantiateScripts(agent);
- ResetFromTransit(agent.UUID);
-
- // Yikes! We should just have a ref to scene here.
- //agent.Scene.InformClientOfNeighbours(agent);
- EnableChildAgents(agent);
-
- return agent;
- }
-
+
+ // SUCCESS!
agent.MakeChildAgent();
-
+ ResetFromTransit(agent.UUID);
+
// now we have a child agent in this region. Request all interesting data about other (root) agents
agent.SendOtherAgentsAvatarDataToMe();
agent.SendOtherAgentsAppearanceToMe();
-
- // Backwards compatibility
+
+ // Backwards compatibility. Best effort
if (version == "Unknown" || version == string.Empty)
{
- m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one...");
+ m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
+ Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
}
+
+
+ // Next, let's close the child agent connections that are too far away.
+ agent.CloseChildAgents(neighbourx, neighboury);
AgentHasMovedAway(agent, false);
@@ -1069,16 +1062,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState;
ScenePresence agent = icon.EndInvoke(iar);
- // If the cross was successful, this agent is a child agent
- if (agent.IsChildAgent)
- agent.Reset();
- else // Not successful
- agent.RestoreInCurrentScene();
+ //// If the cross was successful, this agent is a child agent
+ //if (agent.IsChildAgent)
+ // agent.Reset();
+ //else // Not successful
+ // agent.RestoreInCurrentScene();
// In any case
agent.IsInTransit = false;
- //m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
+ m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
}
#endregion
--
cgit v1.1
From 48113f0fc811f21f4a113176caa9dbd78c0d3446 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 Dec 2011 19:44:52 +0000
Subject: Make it possible to force all prims to be phantom via the
collidable_prim boolean setting in the OpenSim.ini config [Startup] section.
Naturally, default is true.
When set to false, "phantom" flags on prims can be set as usual but all prims remain phantom.
This setting is for test purposes.
This switch does not affect the collision of avatars with the terrain.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 9 +++++++++
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 ++++-
2 files changed, 13 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6666328..96e6863 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -79,6 +79,14 @@ namespace OpenSim.Region.Framework.Scenes
///
public bool m_physicalPrim;
+ ///
+ /// Controls whether prims can be collided with.
+ ///
+ ///
+ /// If this is set to false then prims cannot be subject to physics either.
+ ///
+ public bool CollidablePrims { get; private set; }
+
public float m_maxNonphys = 256;
public float m_maxPhys = 10;
public bool m_clampPrimSize;
@@ -651,6 +659,7 @@ namespace OpenSim.Region.Framework.Scenes
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
m_physicalPrim = startupConfig.GetBoolean("physical_prim", true);
+ CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
if (RegionInfo.NonphysPrimMax > 0)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index b29ecc6..8fd136d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1473,6 +1473,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive)
{
+ if (!ParentGroup.Scene.CollidablePrims)
+ return;
+
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}",
// Name, LocalId, UUID, m_physicalPrim);
@@ -4318,7 +4321,7 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup.Scene == null)
return;
- if (PhysActor == null)
+ if (ParentGroup.Scene.CollidablePrims && PhysActor == null)
{
// It's not phantom anymore. So make sure the physics engine get's knowledge of it
PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape(
--
cgit v1.1
From f7dbdba447cf91b03749c09d24709b03bc9f7831 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 Dec 2011 19:52:09 +0000
Subject: Remove unused m_physicalPrim parameter from SOG.ApplyPhysics()
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 1 -
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 ++---
2 files changed, 2 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index a3e4b46..1e2901b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -333,7 +333,6 @@ namespace OpenSim.Region.Framework.Scenes
if (rot != null)
sceneObject.UpdateGroupRotationR((Quaternion)rot);
- //group.ApplyPhysics(m_physicalPrim);
if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
{
sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index abea788..0585477 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -669,7 +669,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
}
- ApplyPhysics(m_scene.m_physicalPrim);
+ ApplyPhysics();
// 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.
@@ -1239,8 +1239,7 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Apply physics to this group
///
- ///
- public void ApplyPhysics(bool m_physicalPrim)
+ public void ApplyPhysics()
{
// Apply physics to the root prim
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
--
cgit v1.1
From 7ccd8f8f1d8accb0c5f67e9e3bc9a43fbbfd93e2 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 Dec 2011 19:57:50 +0000
Subject: rename Scene.m_physicalPrim to PhysicalPrims since its public and
access external as a property
---
OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++--
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 96e6863..b4972d6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -77,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Controls whether physics can be applied to prims. Even if false, prims still have entries in a
/// PhysicsScene in order to perform collision detection
///
- public bool m_physicalPrim;
+ public bool PhysicalPrims { get; private set; }
///
/// Controls whether prims can be collided with.
@@ -658,7 +658,7 @@ namespace OpenSim.Region.Framework.Scenes
//Animation states
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
- m_physicalPrim = startupConfig.GetBoolean("physical_prim", true);
+ PhysicalPrims = startupConfig.GetBoolean("physical_prim", true);
CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 8fd136d..aea47e6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1742,7 +1742,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
{
- if (!ParentGroup.Scene.m_physicalPrim && UsePhysics)
+ if (!ParentGroup.Scene.PhysicalPrims && UsePhysics)
return;
if (IsJoint())
--
cgit v1.1
From 790ca65c84b8597b20f63ba48556c0fb2141a4f0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 Dec 2011 20:22:15 +0000
Subject: Align default ODE_STEPSIZE with that already used through
OpenSimDefaults.ini
---
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 04ba738..2194ff0 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private const uint m_regionWidth = Constants.RegionSize;
private const uint m_regionHeight = Constants.RegionSize;
- private float ODE_STEPSIZE = 0.020f;
+ private float ODE_STEPSIZE = 0.0178f;
private float metersInSpace = 29.9f;
private float m_timeDilation = 1.0f;
@@ -456,7 +456,7 @@ namespace OpenSim.Region.Physics.OdePlugin
mAvatarObjectContactFriction = physicsconfig.GetFloat("m_avatarobjectcontact_friction", 75f);
mAvatarObjectContactBounce = physicsconfig.GetFloat("m_avatarobjectcontact_bounce", 0.1f);
- ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", 0.020f);
+ ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE);
m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10);
avDensity = physicsconfig.GetFloat("av_density", 80f);
--
cgit v1.1
From f394cb2e8f1605809dbf3d5503b9ae00dc1f5180 Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Thu, 22 Dec 2011 16:21:32 -0800
Subject: fix the UsesPhysics flag to reference the physics flag rather than
the temponrez flag
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0585477..8860764 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -210,7 +210,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public bool UsesPhysics
{
- get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; }
+ get { return (RootPart.Flags & PrimFlags.Physics) != 0; }
}
///
--
cgit v1.1
From 456c89a7a30c5c2ec2e228beb717b9c611106364 Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Thu, 22 Dec 2011 16:59:51 -0800
Subject: Fixes some problems with objects that attempt to cross a region
boundary into a region that does not exist. This is particularly problematic
for physical objects where the velocity continues to move them out of the
region causing an infinite number of failed region crossings. The patch
forces an object that fails a crossing to be non-physical and moves it back
into the starting region.
---
.../EntityTransfer/EntityTransferModule.cs | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index b9d5d32..098e5cb 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1705,6 +1705,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
uint x = 0, y = 0;
Utils.LongToUInts(newRegionHandle, out x, out y);
GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
+
+ if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent))
+ {
+ m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
+
+ // We are going to move the object back to the old position so long as the old position
+ // is in the region
+ oldGroupPosition.X = Util.Clamp(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1);
+ oldGroupPosition.Y = Util.Clamp(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1);
+ oldGroupPosition.Z = Util.Clamp(oldGroupPosition.Z,1.0f,4096.0f);
+
+ grp.RootPart.GroupPosition = oldGroupPosition;
+
+ // Need to turn off the physics flags, otherwise the object will continue to attempt to
+ // move out of the region creating an infinite loop of failed attempts to cross
+ grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false);
+
+ grp.ScheduleGroupForFullUpdate();
+ }
+
+
+
+
+
if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent))
{
grp.RootPart.GroupPosition = oldGroupPosition;
--
cgit v1.1
From c6ce464dbc64dc24878a8032412e82b02b9314f6 Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Fri, 23 Dec 2011 10:13:32 -0800
Subject: remove the old region crossing handler
---
.../Framework/EntityTransfer/EntityTransferModule.cs | 10 ----------
1 file changed, 10 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 098e5cb..cbef6ce 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1724,16 +1724,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
grp.ScheduleGroupForFullUpdate();
}
-
-
-
-
-
- if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent))
- {
- grp.RootPart.GroupPosition = oldGroupPosition;
- grp.ScheduleGroupForFullUpdate();
- }
}
--
cgit v1.1
From f9a1fd5748a0f33adad3b8b06702f9474dbf6908 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 23 Dec 2011 15:08:13 -0800
Subject: HG: one more adjustment with trailing /s
---
.../CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index 81b65c5..d20c9eb 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -73,7 +73,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
public AssetBase FetchAsset(string url, UUID assetID)
{
- AssetBase asset = m_scene.AssetService.Get(url + "/" + assetID.ToString());
+ if (!url.EndsWith("/") && !url.EndsWith("="))
+ url = url + "/";
+
+ AssetBase asset = m_scene.AssetService.Get(url + assetID.ToString());
if (asset != null)
{
@@ -87,6 +90,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
if (asset != null)
{
+ if (!url.EndsWith("/") && !url.EndsWith("="))
+ url = url + "/";
+
// See long comment in AssetCache.AddAsset
if (!asset.Temporary || asset.Local)
{
@@ -99,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
Copy(asset, asset1);
try
{
- asset1.ID = url + "/" + asset.ID;
+ asset1.ID = url + asset.ID;
}
catch
{
--
cgit v1.1
From b6cfe15c7c0b3697709179cbbf32818576919642 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 24 Dec 2011 07:44:26 -0800
Subject: HG: more / love for Xmas
---
OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
index e9e2dca..1dea87e 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
@@ -385,8 +385,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
string assetServerURL = string.Empty;
if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL))
{
- m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id);
- AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived);
+ if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("="))
+ assetServerURL = assetServerURL + "/";
+
+ m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id);
+ AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived);
return;
}
}
--
cgit v1.1
From 5b52440e61648a98d418cff11b588352a3cfff67 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sat, 24 Dec 2011 16:18:01 +0100
Subject: Introduce a LightShare kill packet ans send it when needed. Currently
only understood by AVN v0.3
---
.../Region/CoreModules/LightShare/LightShareModule.cs | 17 ++++++++++++-----
.../ScriptEngine/Shared/Api/Implementation/LS_Api.cs | 1 +
2 files changed, 13 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
index cabbd31..16cbbf5 100644
--- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
+++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
@@ -153,10 +153,18 @@ namespace OpenSim.Region.CoreModules.World.LightShare
public void SendProfileToClient(IClientAPI client, RegionLightShareData wl)
{
- if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid)
+ if (m_enableWindlight)
{
- List param = compileWindlightSettings(wl);
- client.SendGenericMessage("Windlight", param);
+ if (m_scene.RegionInfo.WindlightSettings.valid)
+ {
+ List param = compileWindlightSettings(wl);
+ client.SendGenericMessage("Windlight", param);
+ }
+ else
+ {
+ List param = new List();
+ client.SendGenericMessage("WindlightReset", param);
+ }
}
}
@@ -175,8 +183,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
private void EventManager_OnSaveNewWindlightProfile()
{
- if (m_scene.RegionInfo.WindlightSettings.valid)
- m_scene.ForEachRootClient(SendProfileToClient);
+ m_scene.ForEachRootClient(SendProfileToClient);
}
public void PostInitialise()
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
index cb0d765..77a784d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
@@ -486,6 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false;
if (m_host.ParentGroup.Scene.SimulationDataService != null)
m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID);
+ m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile();
}
///
/// Set the current Windlight scene to a target avatar
--
cgit v1.1
From 70e36ee2b41da03e41b4f61ab348bc85bd872801 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 29 Dec 2011 12:17:58 -0800
Subject: HG: more adjustments for making HG Simian work. Added server_uri as
new key on get_agent_home in UAS.
---
.../CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index cc9ba97..841363c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -227,8 +227,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
IEventQueue eq = sp.Scene.RequestModuleInterface();
GridRegion homeGatekeeper = MakeRegion(aCircuit);
- m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}:{5}",
- aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName);
+ m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}",
+ aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName);
DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq);
}
@@ -347,6 +347,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
region.ExternalHostName = uri.Host;
region.HttpPort = (uint)uri.Port;
+ region.ServerURI = uri.ToString();
region.RegionName = string.Empty;
region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0);
return region;
--
cgit v1.1
From ef4d989f37bdfbdc6ae34c4d0fc444341b806296 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 29 Dec 2011 15:21:56 -0800
Subject: Deleted unused methods from HGAssetBroker
---
.../ServiceConnectorsOut/Asset/HGAssetBroker.cs | 18 ------------------
1 file changed, 18 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
index e31be21..8395f83 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
@@ -382,23 +382,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
return result;
}
- #region IHyperAssetService
-
- public string GetUserAssetServer(UUID userID)
- {
- UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID);
-
- if (account != null && account.ServiceURLs.ContainsKey("AssetServerURI") && account.ServiceURLs["AssetServerURI"] != null)
- return account.ServiceURLs["AssetServerURI"].ToString();
-
- return string.Empty;
- }
-
- public string GetSimAssetServer()
- {
- return m_LocalAssetServiceURI;
- }
-
- #endregion
}
}
--
cgit v1.1
From 98ab3dffa35a007986a43fd15b9ce93202c92ef5 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 29 Dec 2011 15:33:04 -0800
Subject: Deleted two obsolete files in Inventory modules.
---
.../Inventory/BaseInventoryConnector.cs | 223 -------------------
.../Inventory/InventoryCache.cs | 237 ---------------------
2 files changed, 460 deletions(-)
delete mode 100644 OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
delete mode 100644 OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
deleted file mode 100644
index dcf08e3..0000000
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) Contributors, http://opensimulator.org/
- * See CONTRIBUTORS.TXT for a full list of copyright holders.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the OpenSimulator Project nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using OpenMetaverse;
-using Nini.Config;
-using log4net;
-using OpenSim.Framework;
-using OpenSim.Services.Interfaces;
-
-namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
-{
- public abstract class BaseInventoryConnector : IInventoryService
- {
- protected static InventoryCache m_cache;
- private static bool m_Initialized;
-
- protected virtual void Init(IConfigSource source)
- {
- if (!m_Initialized)
- {
- m_cache = new InventoryCache();
- m_cache.Init(source, this);
- m_Initialized = true;
- }
- }
-
- ///
- /// Create the entire inventory for a given user
- ///
- ///
- ///
- public abstract bool CreateUserInventory(UUID user);
-
- ///
- /// Gets the skeleton of the inventory -- folders only
- ///
- ///
- ///
- public abstract List GetInventorySkeleton(UUID userId);
-
- ///
- /// Synchronous inventory fetch.
- ///
- ///
- ///
- public abstract InventoryCollection GetUserInventory(UUID userID);
-
- ///
- /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
- /// inventory has been received
- ///
- ///
- ///
- public abstract void GetUserInventory(UUID userID, InventoryReceiptCallback callback);
-
- ///
- /// Retrieve the root inventory folder for the given user.
- ///
- ///
- /// null if no root folder was found
- public InventoryFolderBase GetRootFolder(UUID userID)
- {
- // Root folder is here as system type Folder.
- return m_cache.GetFolderForType(userID, AssetType.Folder);
- }
-
- public abstract Dictionary GetSystemFolders(UUID userID);
-
- ///
- /// Gets the user folder for the given folder-type
- ///
- ///
- ///
- ///
- public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
- {
- return m_cache.GetFolderForType(userID, type);
- }
-
- ///
- /// Gets everything (folders and items) inside a folder
- ///
- ///
- ///
- ///
- public abstract InventoryCollection GetFolderContent(UUID userID, UUID folderID);
-
- ///
- /// Gets the items inside a folder
- ///
- ///
- ///
- ///
- public abstract List GetFolderItems(UUID userID, UUID folderID);
-
- ///
- /// Add a new folder to the user's inventory
- ///
- ///
- /// true if the folder was successfully added
- public abstract bool AddFolder(InventoryFolderBase folder);
-
- ///
- /// Update a folder in the user's inventory
- ///
- ///
- /// true if the folder was successfully updated
- public abstract bool UpdateFolder(InventoryFolderBase folder);
-
- ///
- /// Move an inventory folder to a new location
- ///
- /// A folder containing the details of the new location
- /// true if the folder was successfully moved
- public abstract bool MoveFolder(InventoryFolderBase folder);
-
- ///
- /// Delete a list of inventory folders (from trash)
- ///
- public abstract bool DeleteFolders(UUID ownerID, List folderIDs);
-
- ///
- /// Purge an inventory folder of all its items and subfolders.
- ///
- ///
- /// true if the folder was successfully purged
- public abstract bool PurgeFolder(InventoryFolderBase folder);
-
- ///
- /// Add a new item to the user's inventory.
- /// If the given item has to parent folder, it tries to find the most
- /// suitable folder for it.
- ///
- ///
- /// true if the item was successfully added
- public bool AddItem(InventoryItemBase item)
- {
- if (item == null)
- return false;
-
- if (item.Folder == UUID.Zero)
- {
- InventoryFolderBase f = GetFolderForType(item.Owner, (AssetType)item.AssetType);
- if (f != null)
- item.Folder = f.ID;
- else
- {
- f = GetRootFolder(item.Owner);
- if (f != null)
- item.Folder = f.ID;
- else
- return false;
- }
- }
-
- return AddItemPlain(item);
- }
-
- protected abstract bool AddItemPlain(InventoryItemBase item);
-
- ///
- /// Update an item in the user's inventory
- ///
- ///
- /// true if the item was successfully updated
- public abstract bool UpdateItem(InventoryItemBase item);
-
- public abstract bool MoveItems(UUID ownerID, List items);
-
- ///
- /// Delete an item from the user's inventory
- ///
- ///
- /// true if the item was successfully deleted
- public abstract bool DeleteItems(UUID ownerID, List itemIDs);
-
- public abstract InventoryItemBase GetItem(InventoryItemBase item);
-
- public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder);
-
- ///
- /// Does the given user have an inventory structure?
- ///
- ///
- ///
- public abstract bool HasInventoryForUser(UUID userID);
-
- ///
- /// Get the active gestures of the agent.
- ///
- ///
- ///
- public abstract List GetActiveGestures(UUID userId);
-
- public abstract int GetAssetPermissions(UUID userID, UUID assetID);
- }
-}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
deleted file mode 100644
index 2322d7c..0000000
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (c) Contributors, http://opensimulator.org/
- * See CONTRIBUTORS.TXT for a full list of copyright holders.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the OpenSimulator Project nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-using OpenSim.Framework;
-using OpenSim.Framework.Client;
-using OpenSim.Region.Framework.Scenes;
-
-using OpenMetaverse;
-using Nini.Config;
-using log4net;
-
-namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
-{
- public class InventoryCache
- {
- private static readonly ILog m_log =
- LogManager.GetLogger(
- MethodBase.GetCurrentMethod().DeclaringType);
-
- protected BaseInventoryConnector m_Connector;
- protected List m_Scenes;
-
- // The cache proper
- protected Dictionary> m_InventoryCache;
-
- // A cache of userIDs --> ServiceURLs, for HGBroker only
- protected Dictionary m_InventoryURLs =
- new Dictionary();
-
- public virtual void Init(IConfigSource source, BaseInventoryConnector connector)
- {
- m_Scenes = new List();
- m_InventoryCache = new Dictionary>();
- m_Connector = connector;
- }
-
- public virtual void AddRegion(Scene scene)
- {
- m_Scenes.Add(scene);
- scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
- scene.EventManager.OnClientClosed += OnClientClosed;
- }
-
- public virtual void RemoveRegion(Scene scene)
- {
- if ((m_Scenes != null) && m_Scenes.Contains(scene))
- {
- m_Scenes.Remove(scene);
- }
- }
-
- void OnMakeRootAgent(ScenePresence presence)
- {
- // Get system folders
-
- // First check if they're here already
- lock (m_InventoryCache)
- {
- if (m_InventoryCache.ContainsKey(presence.UUID))
- {
- m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent, system folders for {0} {1} already in cache", presence.Firstname, presence.Lastname);
- return;
- }
- }
-
- // If not, go get them and place them in the cache
- Dictionary folders = CacheSystemFolders(presence.UUID);
- CacheInventoryServiceURL(presence.Scene, presence.UUID);
-
- m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}",
- presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count);
-
- }
-
- void OnClientClosed(UUID clientID, Scene scene)
- {
- if (m_InventoryCache.ContainsKey(clientID)) // if it's still in cache
- {
- ScenePresence sp = null;
- foreach (Scene s in m_Scenes)
- {
- s.TryGetScenePresence(clientID, out sp);
- if ((sp != null) && !sp.IsChildAgent && (s != scene))
- {
- m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache",
- scene.RegionInfo.RegionName, clientID);
- return;
- }
- }
-
- m_log.DebugFormat(
- "[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders",
- scene.RegionInfo.RegionName, clientID);
- DropCachedSystemFolders(clientID);
- DropInventoryServiceURL(clientID);
- }
- }
-
- ///
- /// Cache a user's 'system' folders.
- ///
- ///
- /// Folders cached
- protected Dictionary CacheSystemFolders(UUID userID)
- {
- // If not, go get them and place them in the cache
- Dictionary folders = m_Connector.GetSystemFolders(userID);
-
- if (folders.Count > 0)
- lock (m_InventoryCache)
- m_InventoryCache.Add(userID, folders);
-
- return folders;
- }
-
- ///
- /// Drop a user's cached 'system' folders
- ///
- ///
- protected void DropCachedSystemFolders(UUID userID)
- {
- // Drop system folders
- lock (m_InventoryCache)
- if (m_InventoryCache.ContainsKey(userID))
- m_InventoryCache.Remove(userID);
- }
-
- ///
- /// Get the system folder for a particular asset type
- ///
- ///
- ///
- ///
- public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
- {
- m_log.DebugFormat("[INVENTORY CACHE]: Getting folder for asset type {0} for user {1}", type, userID);
-
- Dictionary folders = null;
-
- lock (m_InventoryCache)
- {
- m_InventoryCache.TryGetValue(userID, out folders);
-
- // In some situations (such as non-secured standalones), system folders can be requested without
- // the user being logged in. So we need to try caching them here if we don't already have them.
- if (null == folders)
- CacheSystemFolders(userID);
-
- m_InventoryCache.TryGetValue(userID, out folders);
- }
-
- if ((folders != null) && folders.ContainsKey(type))
- {
- m_log.DebugFormat(
- "[INVENTORY CACHE]: Returning folder {0} as type {1} for {2}", folders[type], type, userID);
-
- return folders[type];
- }
-
- m_log.WarnFormat("[INVENTORY CACHE]: Could not find folder for system type {0} for {1}", type, userID);
-
- return null;
- }
-
- ///
- /// Gets the user's inventory URL from its serviceURLs, if the user is foreign,
- /// and sticks it in the cache
- ///
- ///
- private void CacheInventoryServiceURL(Scene scene, UUID userID)
- {
- if (scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, userID) == null)
- {
- // The user does not have a local account; let's cache its service URL
- string inventoryURL = string.Empty;
- ScenePresence sp = null;
- scene.TryGetScenePresence(userID, out sp);
- if (sp != null)
- {
- AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
- if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI"))
- {
- inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString();
- if (inventoryURL != null && inventoryURL != string.Empty)
- {
- inventoryURL = inventoryURL.Trim(new char[] { '/' });
- m_InventoryURLs.Add(userID, inventoryURL);
- }
- }
- }
- }
- }
-
- private void DropInventoryServiceURL(UUID userID)
- {
- lock (m_InventoryURLs)
- if (m_InventoryURLs.ContainsKey(userID))
- m_InventoryURLs.Remove(userID);
- }
-
- public string GetInventoryServiceURL(UUID userID)
- {
- if (m_InventoryURLs.ContainsKey(userID))
- return m_InventoryURLs[userID];
-
- return null;
- }
- }
-}
--
cgit v1.1
From 571efeddb20f38bb4164074b3c217be5387ca2e0 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 29 Dec 2011 16:12:06 -0800
Subject: Added UserManagementModule.IsLocalGridUser(UUID) to be used
throughout region Scenes and Modules. Changed existing modules to use it
instead of assuming that foreign = null account.
---
.../CoreModules/Avatar/Friends/HGFriendsModule.cs | 81 ++++++++++++++++------
.../InstantMessage/HGMessageTransferModule.cs | 3 +-
.../EntityTransfer/HGEntityTransferModule.cs | 7 +-
.../InventoryAccess/HGInventoryAccessModule.cs | 10 +--
.../UserManagement/UserManagementModule.cs | 9 +++
.../Inventory/HGInventoryBroker.cs | 4 +-
.../Region/Framework/Interfaces/IUserManagement.cs | 2 +
7 files changed, 80 insertions(+), 36 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index 9a97925..a77646c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -50,6 +50,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ IUserManagement m_uMan;
+ IUserManagement UserManagementModule
+ {
+ get
+ {
+ if (m_uMan == null)
+ m_uMan = m_Scenes[0].RequestModuleInterface();
+ return m_uMan;
+ }
+ }
+
#region ISharedRegionModule
public override string Name
{
@@ -369,9 +380,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override FriendInfo[] GetFriendsFromService(IClientAPI client)
{
// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
+ Boolean agentIsLocal = true;
+ if (UserManagementModule != null)
+ agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId);
- UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, client.AgentId);
- if (account1 != null)
+ if (agentIsLocal)
return base.GetFriendsFromService(client);
FriendInfo[] finfos = new FriendInfo[0];
@@ -392,16 +405,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override bool StoreRights(UUID agentID, UUID friendID, int rights)
{
- UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
- UserAccount account2 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID);
+ Boolean agentIsLocal = true;
+ Boolean friendIsLocal = true;
+ if (UserManagementModule != null)
+ {
+ agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
+ friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
+ }
+
// Are they both local users?
- if (account1 != null && account2 != null)
+ if (agentIsLocal && friendIsLocal)
{
// local grid users
return base.StoreRights(agentID, friendID, rights);
}
- if (account1 != null) // agent is local, friend is foreigner
+ if (agentIsLocal) // agent is local, friend is foreigner
{
FriendInfo[] finfos = GetFriends(agentID);
FriendInfo finfo = GetFriend(finfos, friendID);
@@ -412,7 +431,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
- if (account2 != null) // agent is foreigner, friend is local
+ if (friendIsLocal) // agent is foreigner, friend is local
{
string agentUUI = GetUUI(friendID, agentID);
if (agentUUI != string.Empty)
@@ -427,10 +446,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override void StoreBackwards(UUID friendID, UUID agentID)
{
- UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
- UserAccount account2 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID);
+ Boolean agentIsLocal = true;
+ Boolean friendIsLocal = true;
+ if (UserManagementModule != null)
+ {
+ agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
+ friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
+ }
+
// Are they both local users?
- if (account1 != null && account2 != null)
+ if (agentIsLocal && friendIsLocal)
{
// local grid users
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
@@ -444,10 +469,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override void StoreFriendships(UUID agentID, UUID friendID)
{
- UserAccount agentAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
- UserAccount friendAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID);
+ Boolean agentIsLocal = true;
+ Boolean friendIsLocal = true;
+ if (UserManagementModule != null)
+ {
+ agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
+ friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
+ }
+
// Are they both local users?
- if (agentAccount != null && friendAccount != null)
+ if (agentIsLocal && friendIsLocal)
{
// local grid users
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
@@ -465,13 +496,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
string agentFriendService = string.Empty;
string friendFriendService = string.Empty;
- if (agentClient != null)
+ if (agentIsLocal)
{
agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode);
agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit);
agentFriendService = agentClientCircuit.ServiceURLs["FriendsServerURI"].ToString();
}
- if (friendClient != null)
+ if (friendIsLocal)
{
friendClientCircuit = ((Scene)(friendClient.Scene)).AuthenticateHandler.GetAgentCircuitData(friendClient.CircuitCode);
friendUUI = Util.ProduceUserUniversalIdentifier(friendClientCircuit);
@@ -484,7 +515,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// Generate a random 8-character hex number that will sign this friendship
string secret = UUID.Random().ToString().Substring(0, 8);
- if (agentAccount != null) // agent is local, 'friend' is foreigner
+ if (agentIsLocal) // agent is local, 'friend' is foreigner
{
// This may happen when the agent returned home, in which case the friend is not there
// We need to look for its information in the friends list itself
@@ -520,7 +551,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
friendsConn.NewFriendship(friendID, agentUUI + ";" + secret);
}
}
- else if (friendAccount != null) // 'friend' is local, agent is foreigner
+ else if (friendIsLocal) // 'friend' is local, agent is foreigner
{
// store in the local friends service a reference to the foreign agent
FriendsService.StoreFriend(friendID.ToString(), agentUUI + ";" + secret, 1);
@@ -553,10 +584,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override bool DeleteFriendship(UUID agentID, UUID exfriendID)
{
- UserAccount agentAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
- UserAccount friendAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, exfriendID);
+ Boolean agentIsLocal = true;
+ Boolean friendIsLocal = true;
+ if (UserManagementModule != null)
+ {
+ agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
+ friendIsLocal = UserManagementModule.IsLocalGridUser(exfriendID);
+ }
+
// Are they both local users?
- if (agentAccount != null && friendAccount != null)
+ if (agentIsLocal && friendIsLocal)
{
// local grid users
return base.DeleteFriendship(agentID, exfriendID);
@@ -566,7 +603,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
string agentUUI = string.Empty;
string friendUUI = string.Empty;
- if (agentAccount != null) // agent is local, 'friend' is foreigner
+ if (agentIsLocal) // agent is local, 'friend' is foreigner
{
// We need to look for its information in the friends list itself
FriendInfo[] finfos = GetFriends(agentID);
@@ -587,7 +624,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
return true;
}
}
- else if (friendAccount != null) // agent is foreigner, 'friend' is local
+ else if (friendIsLocal) // agent is foreigner, 'friend' is local
{
agentUUI = GetUUI(exfriendID, agentID);
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
index 560d913..bf1d787 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
@@ -180,10 +180,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
// Is the user a local user?
- UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, toAgentID);
string url = string.Empty;
bool foreigner = false;
- if (account == null) // foreign user
+ if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(toAgentID)) // foreign user
{
url = UserManagementModule.GetUserServerURL(toAgentID, "IMServerURI");
foreigner = true;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 841363c..8d41728 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -187,8 +187,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
// Let's find out if this is a foreign user or a local user
- UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, id);
- if (account != null)
+ IUserManagement uMan = m_aScene.RequestModuleInterface();
+ if (uMan != null && uMan.IsLocalGridUser(id))
{
// local grid user
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
@@ -313,8 +313,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
// Let's find out if this is a foreign user or a local user
+ IUserManagement uMan = m_aScene.RequestModuleInterface();
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId);
- if (account != null)
+ if (uMan != null && uMan.IsLocalGridUser(obj.AgentId))
{
// local grid user
return;
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 49d484b..bf24ebc 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -124,8 +124,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
protected override string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix)
{
- UserAccount account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, presence.UUID);
- if (account == null)
+ if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(presence.UUID))
prefix = "HG ";
else
prefix = string.Empty;
@@ -210,12 +209,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
public override bool IsForeignUser(UUID userID, out string assetServerURL)
{
assetServerURL = string.Empty;
- UserAccount account = null;
- if (m_Scene.UserAccountService != null)
- account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, userID);
- if (account == null) // foreign
- {
+ if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID))
+ { // foreign
ScenePresence sp = null;
if (m_Scene.TryGetScenePresence(userID, out sp))
{
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index a40a6a4..dbe2560 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -425,6 +425,15 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
//}
+ public bool IsLocalGridUser(UUID uuid)
+ {
+ UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid);
+ if (account == null || (account != null && !account.LocalToGrid))
+ return false;
+
+ return true;
+ }
+
#endregion IUserManagement
private void HandleShowUsers(string module, string[] cmd)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 0d121ed..b5c0af6 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -218,9 +218,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
///
private void CacheInventoryServiceURL(UUID userID)
{
- if (m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID) == null)
+ if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID))
{
- // The user does not have a local account; let's cache its service URL
+ // The user is not local; let's cache its service URL
string inventoryURL = string.Empty;
ScenePresence sp = null;
foreach (Scene scene in m_Scenes)
diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
index c66e053..ea0ba59 100644
--- a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
+++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
@@ -48,5 +48,7 @@ namespace OpenSim.Region.Framework.Interfaces
///
///
void AddUser(UUID uuid, string firstName, string lastName, string profileURL);
+
+ bool IsLocalGridUser(UUID uuid);
}
}
--
cgit v1.1
From 56dbcae402000e199e556827944dfdd1bb3a64be Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 30 Dec 2011 21:32:28 -0800
Subject: Bug fix in map tiles in standalone: the map has been blank since
commit 01ae916bad672722aa62ee712b7b580d6f5f4370 r/17324 (Nov.18, justincc).
But the root cause comes from commit 02e54c57c4901167779f07ed3e89fb1d24ffc22a
Author: Oren Hurvitz Date: 7/22/2011 This is a nasty situation. The map tile
UUID is, in principle, stored authoritatively in RegionSettings. However, it
also needs to be stored in the Grid Service because that's how other sims can
retrieve it to send it in Map Blocks to non-V3 viewers. So every time the
tile image changes, that change needs to propagate to the Grid Service, and
this is done via RegisterRegion (ugh!). Interestingly, this problem didn't
affect grids because by default AllowRemoteDelete is false, so the prior
images aren't being deleted from the asset servers -- but they were not being
correctly updated in the map either, the map was stuck with old images.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 33 +++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b4972d6..0f84da9 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -710,7 +710,7 @@ namespace OpenSim.Region.Framework.Scenes
if (maptileRefresh != 0)
{
m_mapGenerationTimer.Interval = maptileRefresh * 1000;
- m_mapGenerationTimer.Elapsed += RegenerateMaptile;
+ m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister;
m_mapGenerationTimer.AutoReset = true;
m_mapGenerationTimer.Start();
}
@@ -1647,21 +1647,17 @@ namespace OpenSim.Region.Framework.Scenes
{
m_sceneGridService.SetScene(this);
+ //// Unfortunately this needs to be here and it can't be async.
+ //// The map tile image is stored in RegionSettings, but it also needs to be
+ //// stored in the GridService, because that's what the world map module uses
+ //// to send the map image UUIDs (of other regions) to the viewer...
+ if (m_generateMaptiles)
+ RegenerateMaptile();
+
GridRegion region = new GridRegion(RegionInfo);
string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
if (error != String.Empty)
- {
throw new Exception(error);
- }
-
- // Generate the maptile asynchronously, because sometimes it can be very slow and we
- // don't want this to delay starting the region.
- if (m_generateMaptiles)
- {
- Util.FireAndForget(delegate {
- RegenerateMaptile(null, null);
- });
- }
}
#endregion
@@ -5032,13 +5028,24 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- public void RegenerateMaptile(object sender, ElapsedEventArgs e)
+ private void RegenerateMaptile()
{
IWorldMapModule mapModule = RequestModuleInterface();
if (mapModule != null)
mapModule.GenerateMaptile();
}
+ private void RegenerateMaptileAndReregister(object sender, ElapsedEventArgs e)
+ {
+ RegenerateMaptile();
+
+ // We need to propagate the new image UUID to the grid service
+ // so that all simulators can retrieve it
+ string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo));
+ if (error != string.Empty)
+ throw new Exception(error);
+ }
+
// This method is called across the simulation connector to
// determine if a given agent is allowed in this region
// AS A ROOT AGENT. Returning false here will prevent them
--
cgit v1.1
From 87374274b9a53003de40828f7eb2906ecd9ed8ed Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Sun, 1 Jan 2012 23:44:46 -0500
Subject: Fix for failed http request status
Thanks "sendapatch" for fixes to llHTTPRequest status reporting.
---
.../Scripting/HttpRequest/ScriptsHttpRequests.cs | 31 ++++++++++++----------
1 file changed, 17 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index 43672d1..8fb5d75 100644
--- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -411,8 +411,21 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
}
Request.Timeout = HttpTimeout;
- // execute the request
- response = (HttpWebResponse) Request.GetResponse();
+ try
+ {
+ // execute the request
+ response = (HttpWebResponse) Request.GetResponse();
+ }
+ catch (WebException e)
+ {
+ if (e.Status != WebExceptionStatus.ProtocolError)
+ {
+ throw;
+ }
+ response = (HttpWebResponse)e.Response;
+ }
+
+ Status = (int)response.StatusCode;
Stream resStream = response.GetResponseStream();
@@ -436,17 +449,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
}
catch (Exception e)
{
- if (e is WebException && ((WebException)e).Status == WebExceptionStatus.ProtocolError)
- {
- HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response;
- Status = (int)webRsp.StatusCode;
- ResponseBody = webRsp.StatusDescription;
- }
- else
- {
- Status = (int)OSHttpStatusCode.ClientErrorJoker;
- ResponseBody = e.Message;
- }
+ Status = (int)OSHttpStatusCode.ClientErrorJoker;
+ ResponseBody = e.Message;
_finished = true;
return;
@@ -457,7 +461,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
response.Close();
}
- Status = (int)OSHttpStatusCode.SuccessOk;
_finished = true;
}
--
cgit v1.1
From 014a86c26b138e4fc861fd30634e866b83dbabdb Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 2 Jan 2012 19:46:30 +0000
Subject: Adding commented out log messages and some minor formatting for
future bug hunting. No functional changes.
---
OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs | 9 ++++++++-
.../Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs | 3 +++
.../ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | 2 ++
OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 1 +
4 files changed, 14 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
index 9e0db12..5c4a662 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
@@ -39,6 +39,9 @@ using log4net;
namespace OpenSim.Region.ClientStack.LindenUDP
{
+ ///
+ /// This class handles UDP texture requests.
+ ///
public class LLImageManager
{
private sealed class J2KImageComparer : IComparer
@@ -228,15 +231,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
image.PriorityQueueHandle = null;
lock (m_syncRoot)
+ {
try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); }
catch (Exception) { }
+ }
}
void RemoveImageFromQueue(J2KImage image)
{
lock (m_syncRoot)
+ {
try { m_priorityQueue.Delete(image.PriorityQueueHandle); }
catch (Exception) { }
+ }
}
void UpdateImageInQueue(J2KImage image)
@@ -254,4 +261,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion Priority Queue Helpers
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
index 1386e86..7dd9087 100644
--- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
@@ -152,6 +152,9 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
/// JPEG2000 data
private void DoJ2KDecode(UUID assetID, byte[] j2kData)
{
+// m_log.DebugFormat(
+// "[J2KDecoderModule]: Doing J2K decoding of {0} bytes for asset {1}", j2kData.Length, assetID);
+
//int DecodeTime = 0;
//DecodeTime = Environment.TickCount;
OpenJPEG.J2KLayerInfo[] layers;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
index cc5d061..2e6ec90 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
@@ -170,6 +170,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
public AssetBase GetCached(string id)
{
+// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Cache request for {0}", id);
+
if (m_Cache != null)
return m_Cache.Get(id);
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 2194ff0..228eca9 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -2822,6 +2822,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_global_contactcount = 0;
d.WorldQuickStep(world, ODE_STEPSIZE);
+
d.JointGroupEmpty(contactgroup);
}
catch (Exception e)
--
cgit v1.1
From fac8c258515c533854549109f14615b8be3ddc15 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 2 Jan 2012 21:31:42 +0000
Subject: Reduce accessibility of some J2KImage/LLImageManager properties and
methods to reduce potential code complexity and make code reading easier.
---
OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | 16 ++++++++--------
OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs | 8 ++++----
2 files changed, 12 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
index 1dea87e..cb9692a 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
@@ -56,9 +56,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public IAssetService AssetService;
public UUID AgentID;
public IInventoryAccessModule InventoryAccessModule;
- public OpenJPEG.J2KLayerInfo[] Layers;
- public bool IsDecoded;
- public bool HasAsset;
+ private OpenJPEG.J2KLayerInfo[] m_layers;
+ public bool IsDecoded { get; private set; }
+ public bool HasAsset { get; private set; }
public C5.IPriorityQueueHandle PriorityQueueHandle;
private uint m_currentPacket;
@@ -170,14 +170,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (DiscardLevel >= 0 || m_stopPacket == 0)
{
// This shouldn't happen, but if it does, we really can't proceed
- if (Layers == null)
+ if (m_layers == null)
{
m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer");
m_currentPacket = m_stopPacket;
return;
}
- int maxDiscardLevel = Math.Max(0, Layers.Length - 1);
+ int maxDiscardLevel = Math.Max(0, m_layers.Length - 1);
// Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel
if (DiscardLevel < 0 && m_stopPacket == 0)
@@ -187,9 +187,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel);
//Calculate the m_stopPacket
- if (Layers.Length > 0)
+ if (m_layers.Length > 0)
{
- m_stopPacket = (uint)GetPacketForBytePosition(Layers[(Layers.Length - 1) - DiscardLevel].End);
+ m_stopPacket = (uint)GetPacketForBytePosition(m_layers[(m_layers.Length - 1) - DiscardLevel].End);
//I don't know why, but the viewer seems to expect the final packet if the file
//is just one packet bigger.
if (TexturePacketCount() == m_stopPacket + 1)
@@ -341,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
{
- Layers = layers;
+ m_layers = layers;
IsDecoded = true;
RunUpdate();
}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
index 5c4a662..e3a881f 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
@@ -211,7 +211,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region Priority Queue Helpers
- J2KImage GetHighestPriorityImage()
+ private J2KImage GetHighestPriorityImage()
{
J2KImage image = null;
@@ -226,7 +226,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return image;
}
- void AddImageToQueue(J2KImage image)
+ private void AddImageToQueue(J2KImage image)
{
image.PriorityQueueHandle = null;
@@ -237,7 +237,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
- void RemoveImageFromQueue(J2KImage image)
+ private void RemoveImageFromQueue(J2KImage image)
{
lock (m_syncRoot)
{
@@ -246,7 +246,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
- void UpdateImageInQueue(J2KImage image)
+ private void UpdateImageInQueue(J2KImage image)
{
lock (m_syncRoot)
{
--
cgit v1.1
From 6941058824e418bcdc2932c35f226bbcc5cea2ad Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Sun, 1 Jan 2012 14:57:13 -0500
Subject: Profile Updates
Update basic profile to use the replaceable interface, making configuration less error-prone. Add support to query avatar's home user account and profile service for regions usng the updated OpenProfileModule with Hypergrid.
---
.../Avatar/Profile/BasicProfileModule.cs | 12 +--
.../UserManagement/UserManagementModule.cs | 93 ++++++++++++++++++++++
.../Region/Framework/Interfaces/IUserManagement.cs | 3 +
3 files changed, 103 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs
index dee0ad4..eb1e4b5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs
@@ -43,7 +43,7 @@ using OpenSim.Services.Interfaces;
namespace OpenSim.Region.CoreModules.Avatar.Profile
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
- public class BasicProfileModule : ISharedRegionModule
+ public class BasicProfileModule : IProfileModule, ISharedRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -57,6 +57,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
public void Initialise(IConfigSource config)
{
+ // This can be reduced later as the loader will determine
+ // whether we are needed
if (config.Configs["Profile"] != null)
{
if (config.Configs["Profile"].GetString("Module", string.Empty) != "BasicProfileModule")
@@ -65,14 +67,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
m_log.DebugFormat("[PROFILE MODULE]: Basic Profile Module enabled");
m_Enabled = true;
-
}
public void AddRegion(Scene scene)
{
if (!m_Enabled)
return;
-
+
lock (m_Scenes)
{
if (!m_Scenes.Contains(scene))
@@ -80,6 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
m_Scenes.Add(scene);
// Hook up events
scene.EventManager.OnNewClient += OnNewClient;
+ scene.RegisterModuleInterface(this);
}
}
}
@@ -116,7 +118,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
public Type ReplaceableInterface
{
- get { return null; }
+ get { return typeof(IProfileModule); }
}
#endregion
@@ -170,4 +172,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index dbe2560..37292d6 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -50,6 +50,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
public string LastName { get; set; }
public string HomeURL { get; set; }
public Dictionary ServerURLs { get; set; }
+ public string Title { get; set; }
+ public int Flags { get; set; }
+ public int Created { get; set; }
}
public class UserManagementModule : ISharedRegionModule, IUserManagement
@@ -281,6 +284,94 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
return string.Empty;
}
+ public int GetUserFlags(UUID userID)
+ {
+ UserData userdata;
+ lock (m_UserCache)
+ m_UserCache.TryGetValue(userID, out userdata);
+
+ if (userdata.Flags == -1)
+ GetUserInfo(userID);
+
+ if (userdata.Flags != -1)
+ return userdata.Flags;
+
+ return 0;
+ }
+
+ public int GetUserCreated(UUID userID)
+ {
+ UserData userdata;
+ lock (m_UserCache)
+ m_UserCache.TryGetValue(userID, out userdata);
+
+ if (userdata.Flags == -1)
+ GetUserInfo(userID);
+
+ if (userdata.Created != -1)
+ return userdata.Created;
+
+ return 0;
+ }
+
+ public string GetUserTitle(UUID userID)
+ {
+ UserData userdata;
+ lock (m_UserCache)
+ m_UserCache.TryGetValue(userID, out userdata);
+
+ if (userdata.Flags == -1)
+ GetUserInfo(userID);
+
+ if (userdata.Created != -1)
+ return userdata.Title;
+
+ return string.Empty;
+ }
+
+ // This will cache the user data
+ // Change this to return bool
+ private bool GetUserInfo(UUID userID)
+ {
+ UserData userdata;
+ lock (m_UserCache)
+ m_UserCache.TryGetValue(userID, out userdata);
+
+ if (userdata != null)
+ {
+// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Requested url type {0} for {1}", serverType, userID);
+
+ if (userdata.Flags >= 0)
+ {
+ // This is already populated
+ return true;
+ }
+
+ if (userdata.HomeURL != null && userdata.HomeURL != string.Empty)
+ {
+ m_log.DebugFormat(
+ "[USER MANAGEMENT MODULE]: Requesting user flags from '{0}' for {1}",
+ userdata.HomeURL, userID);
+
+ UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL);
+ Dictionary info = uConn.GetUserInfo(userID);
+
+ // Pull our data now
+ if (info["result"].ToString() == "success")
+ {
+ userdata.Flags = (int)info["user_flags"];
+ userdata.Created = (int)info["user_created"];
+ userdata.Title = (string)info["user_title"];
+
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+
public string GetUserUUI(UUID userID)
{
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID);
@@ -352,6 +443,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
UserData user = new UserData();
user.Id = id;
+ user.Flags = -1;
+ user.Created = -1;
if (creatorData != null && creatorData != string.Empty)
{
diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
index ea0ba59..54dfaf4 100644
--- a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
+++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
@@ -14,6 +14,9 @@ namespace OpenSim.Region.Framework.Interfaces
string GetUserHomeURL(UUID uuid);
string GetUserUUI(UUID uuid);
string GetUserServerURL(UUID uuid, string serverType);
+ int GetUserFlags(UUID userID);
+ int GetUserCreated(UUID userID);
+ string GetUserTitle(UUID userID);
///
/// Add a user.
--
cgit v1.1
From 983b49c0c872e997576d7fc167319e28e6f970e3 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 3 Jan 2012 18:25:31 +0000
Subject: commented out "Prevented flyoff" log message for now as this becomes
problematic with bot testing.
Please uncomment if still needed.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3d1c1b5..42cd4be 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2844,7 +2844,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);
}
--
cgit v1.1