- convert comments into documentation
- minor formatting adjustments - remove some trailing whitespace0.6.0-stable
parent
4da1901ed9
commit
3e124a3dba
|
@ -60,11 +60,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public delegate void SynchronizeSceneHandler(Scene scene);
|
public delegate void SynchronizeSceneHandler(Scene scene);
|
||||||
public SynchronizeSceneHandler SynchronizeScene = null;
|
public SynchronizeSceneHandler SynchronizeScene = null;
|
||||||
public int splitID = 0;
|
public int splitID = 0;
|
||||||
|
|
||||||
|
|
||||||
#region Fields
|
#region Fields
|
||||||
|
|
||||||
|
|
||||||
protected Timer m_restartWaitTimer = new Timer();
|
protected Timer m_restartWaitTimer = new Timer();
|
||||||
|
|
||||||
protected SimStatsReporter m_statsReporter;
|
protected SimStatsReporter m_statsReporter;
|
||||||
|
@ -84,8 +82,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
private int m_timePhase = 24;
|
private int m_timePhase = 24;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Are we applying physics to any of the prims in this scene?
|
/// Are we applying physics to any of the prims in this scene?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -262,7 +258,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
|
bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
|
||||||
{
|
{
|
||||||
m_config = config;
|
m_config = config;
|
||||||
|
|
||||||
m_moduleLoader = moduleLoader;
|
m_moduleLoader = moduleLoader;
|
||||||
m_authenticateHandler = authen;
|
m_authenticateHandler = authen;
|
||||||
CommsManager = commsMan;
|
CommsManager = commsMan;
|
||||||
|
@ -280,7 +276,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
m_eventManager = new EventManager();
|
m_eventManager = new EventManager();
|
||||||
m_externalChecks = new SceneExternalChecks(this);
|
m_externalChecks = new SceneExternalChecks(this);
|
||||||
m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
|
m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
|
||||||
|
|
||||||
// Load region settings
|
// Load region settings
|
||||||
m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
|
m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
|
||||||
|
@ -349,18 +345,21 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return m_simulatorVersion;
|
return m_simulatorVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Another region is up. Gets called from Grid Comms:
|
||||||
|
/// (OGS1 -> LocalBackEnd -> RegionListened -> SceneCommunicationService)
|
||||||
|
/// We have to tell all our ScenePresences about it, and add it to the
|
||||||
|
/// neighbor list.
|
||||||
|
///
|
||||||
|
/// We only add it to the neighbor list if it's within 1 region from here.
|
||||||
|
/// Agents may have draw distance values that cross two regions though, so
|
||||||
|
/// we add it to the notify list regardless of distance. We'll check
|
||||||
|
/// the agent's draw distance before notifying them though.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="otherRegion">RegionInfo handle for the new region.</param>
|
||||||
|
/// <returns>True after all operations complete, throws exceptions otherwise.</returns>
|
||||||
public override bool OtherRegionUp(RegionInfo otherRegion)
|
public override bool OtherRegionUp(RegionInfo otherRegion)
|
||||||
{
|
{
|
||||||
// Another region is up.
|
|
||||||
// Gets called from Grid Comms (SceneCommunicationService<---RegionListener<----LocalBackEnd<----OGS1)
|
|
||||||
// We have to tell all our ScenePresences about it..
|
|
||||||
// and add it to the neighbor list.
|
|
||||||
|
|
||||||
// We only add it to the neighbor list if it's within 1 region from here.
|
|
||||||
// Agents may have draw distance values that cross two regions though, so
|
|
||||||
// we add it to the notify list regardless of distance.
|
|
||||||
// We'll check the agent's draw distance before notifying them though.
|
|
||||||
|
|
||||||
if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
|
if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_neighbours.Count; i++)
|
for (int i = 0; i < m_neighbours.Count; i++)
|
||||||
|
@ -391,8 +390,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
//m_log.Info("[UP]: " + otherRegion.RegionHandle.ToString());
|
//m_log.Info("[UP]: " + otherRegion.RegionHandle.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If these are cast to INT because long + negative values + abs returns invalid data
|
|
||||||
|
|
||||||
|
// If these are cast to INT because long + negative values + abs returns invalid data
|
||||||
int resultX = Math.Abs((int)otherRegion.RegionLocX - (int)RegionInfo.RegionLocX);
|
int resultX = Math.Abs((int)otherRegion.RegionLocX - (int)RegionInfo.RegionLocX);
|
||||||
int resultY = Math.Abs((int)otherRegion.RegionLocY - (int)RegionInfo.RegionLocY);
|
int resultY = Math.Abs((int)otherRegion.RegionLocY - (int)RegionInfo.RegionLocY);
|
||||||
if (resultX <= 1 && resultY <= 1)
|
if (resultX <= 1 && resultY <= 1)
|
||||||
|
@ -428,7 +427,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Given float seconds, this will restart the region.
|
|
||||||
public void AddNeighborRegion(RegionInfo region)
|
public void AddNeighborRegion(RegionInfo region)
|
||||||
{
|
{
|
||||||
lock (m_neighbours)
|
lock (m_neighbours)
|
||||||
|
@ -457,6 +455,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Given float seconds, this will restart the region.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="seconds">float indicating duration before restart.</param>
|
||||||
public virtual void Restart(float seconds)
|
public virtual void Restart(float seconds)
|
||||||
{
|
{
|
||||||
// notifications are done in 15 second increments
|
// notifications are done in 15 second increments
|
||||||
|
@ -853,7 +855,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
maintc = System.Environment.TickCount - maintc;
|
maintc = System.Environment.TickCount - maintc;
|
||||||
maintc = (int)(m_timespan * 1000) - maintc;
|
maintc = (int)(m_timespan * 1000) - maintc;
|
||||||
|
|
||||||
if ((maintc < (m_timespan * 1000)) && maintc > 0)
|
if ((maintc < (m_timespan * 1000)) && maintc > 0)
|
||||||
Thread.Sleep(maintc);
|
Thread.Sleep(maintc);
|
||||||
}
|
}
|
||||||
|
@ -1916,9 +1918,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Move the given scene object into a new region depending on which region its absolute position has moved
|
/// Move the given scene object into a new region depending on which region its absolute position has moved
|
||||||
/// into.
|
/// into.
|
||||||
///
|
///
|
||||||
/// This method locates the new region handle and offsets the prim position for the new region
|
/// This method locates the new region handle and offsets the prim position for the new region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="attemptedPosition">the attempted out of region position of the scene object</param>
|
/// <param name="attemptedPosition">the attempted out of region position of the scene object</param>
|
||||||
|
@ -1943,7 +1945,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int thisx = (int)RegionInfo.RegionLocX;
|
int thisx = (int)RegionInfo.RegionLocX;
|
||||||
int thisy = (int)RegionInfo.RegionLocY;
|
int thisy = (int)RegionInfo.RegionLocY;
|
||||||
|
|
||||||
|
@ -1953,14 +1955,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (attemptedPosition.X > Constants.RegionSize + 0.1f)
|
if (attemptedPosition.X > Constants.RegionSize + 0.1f)
|
||||||
{
|
{
|
||||||
pos.X = ((pos.X - Constants.RegionSize));
|
pos.X = ((pos.X - Constants.RegionSize));
|
||||||
newRegionHandle
|
newRegionHandle
|
||||||
= Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize));
|
= Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize));
|
||||||
// x + 1
|
// x + 1
|
||||||
}
|
}
|
||||||
else if (attemptedPosition.X < -0.1f)
|
else if (attemptedPosition.X < -0.1f)
|
||||||
{
|
{
|
||||||
pos.X = ((pos.X + Constants.RegionSize));
|
pos.X = ((pos.X + Constants.RegionSize));
|
||||||
newRegionHandle
|
newRegionHandle
|
||||||
= Util.UIntsToLong((uint)((thisx - 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize));
|
= Util.UIntsToLong((uint)((thisx - 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize));
|
||||||
// x - 1
|
// x - 1
|
||||||
}
|
}
|
||||||
|
@ -1968,14 +1970,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (attemptedPosition.Y > Constants.RegionSize + 0.1f)
|
if (attemptedPosition.Y > Constants.RegionSize + 0.1f)
|
||||||
{
|
{
|
||||||
pos.Y = ((pos.Y - Constants.RegionSize));
|
pos.Y = ((pos.Y - Constants.RegionSize));
|
||||||
newRegionHandle
|
newRegionHandle
|
||||||
= Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + 1) * Constants.RegionSize));
|
= Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + 1) * Constants.RegionSize));
|
||||||
// y + 1
|
// y + 1
|
||||||
}
|
}
|
||||||
else if (attemptedPosition.Y < -0.1f)
|
else if (attemptedPosition.Y < -0.1f)
|
||||||
{
|
{
|
||||||
pos.Y = ((pos.Y + Constants.RegionSize));
|
pos.Y = ((pos.Y + Constants.RegionSize));
|
||||||
newRegionHandle
|
newRegionHandle
|
||||||
= Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - 1) * Constants.RegionSize));
|
= Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - 1) * Constants.RegionSize));
|
||||||
// y - 1
|
// y - 1
|
||||||
}
|
}
|
||||||
|
@ -1986,8 +1988,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
// If we fail to cross the border, then reset the position of the scene object on that border.
|
// If we fail to cross the border, then reset the position of the scene object on that border.
|
||||||
if (!CrossPrimGroupIntoNewRegion(newRegionHandle, grp))
|
if (!CrossPrimGroupIntoNewRegion(newRegionHandle, grp))
|
||||||
{
|
{
|
||||||
grp.OffsetForNewRegion(oldGroupPosition);
|
grp.OffsetForNewRegion(oldGroupPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1995,16 +1997,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// Move the given scene object into a new region
|
/// Move the given scene object into a new region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="newRegionHandle"></param>
|
/// <param name="newRegionHandle"></param>
|
||||||
/// <param name="grp">Scene Object Group that we're crossing</param>
|
/// <param name="grp">Scene Object Group that we're crossing</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// true if the crossing itself was successful, false on failure
|
/// true if the crossing itself was successful, false on failure
|
||||||
/// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region
|
/// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public bool CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp)
|
public bool CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp)
|
||||||
{
|
{
|
||||||
bool successYN = false;
|
bool successYN = false;
|
||||||
int primcrossingXMLmethod = 0;
|
int primcrossingXMLmethod = 0;
|
||||||
|
|
||||||
if (newRegionHandle != 0)
|
if (newRegionHandle != 0)
|
||||||
{
|
{
|
||||||
successYN
|
successYN
|
||||||
|
@ -2021,7 +2023,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat(
|
m_log.ErrorFormat(
|
||||||
"[INTERREGION]: Exception deleting the old object left behind on a border crossing for {0}, {1}",
|
"[INTERREGION]: Exception deleting the old object left behind on a border crossing for {0}, {1}",
|
||||||
grp, e);
|
grp, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2034,7 +2036,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
grp.RootPart.PhysActor.CrossingFailure();
|
grp.RootPart.PhysActor.CrossingFailure();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.ErrorFormat("[INTERREGION]: Prim crossing failed for {0}", grp);
|
m_log.ErrorFormat("[INTERREGION]: Prim crossing failed for {0}", grp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2042,7 +2044,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
m_log.Error("[INTERREGION]: region handle was unexpectedly 0 in Scene.CrossPrimGroupIntoNewRegion()");
|
m_log.Error("[INTERREGION]: region handle was unexpectedly 0 in Scene.CrossPrimGroupIntoNewRegion()");
|
||||||
}
|
}
|
||||||
|
|
||||||
return successYN;
|
return successYN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2300,7 +2302,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
m_log.DebugFormat("gesture : {0} ", gestureId.ToString());
|
m_log.DebugFormat("gesture : {0} ", gestureId.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Teleport an avatar to their home region
|
/// Teleport an avatar to their home region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2325,7 +2327,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RequestTeleportLocation(
|
RequestTeleportLocation(
|
||||||
client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt,
|
client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt,
|
||||||
(uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome));
|
(uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3929,7 +3931,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a named prim contained in this scene (will return the first
|
/// Get a named prim contained in this scene (will return the first
|
||||||
/// found, if there are more than one prim with the same name)
|
/// found, if there are more than one prim with the same name)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
|
|
Loading…
Reference in New Issue