Fixed the whitespace in Scene.cs

The whitespace in this file was fubared recently
0.8.2-post-fixes
Oren Hurvitz 2015-07-13 12:37:18 +03:00
parent f3f748ed11
commit e174dc87fb
1 changed files with 515 additions and 515 deletions

View File

@ -1,29 +1,29 @@
/*
* 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.
*/
* 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;
@ -3440,7 +3440,7 @@ namespace OpenSim.Region.Framework.Scenes
}
/// <summary>
/// Get the avatar apperance for the given client.
/// Get the avatar appearance for the given client.
/// </summary>
/// <param name="client"></param>
/// <param name="appearance"></param>
@ -3796,15 +3796,15 @@ namespace OpenSim.Region.Framework.Scenes
// vulnerable to an issue when a viewer quits a region without sending a proper logout but then
// re-establishes the connection on a relogin. This could wrongly set the DoNotCloseAfterTeleport
// flag when no teleport had taken place (and hence no close was going to come).
// if (!acd.ChildrenCapSeeds.ContainsKey(RegionInfo.RegionHandle))
// {
// m_log.DebugFormat(
// "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because source will attempt close.",
// sp.Name, Name);
//
// sp.DoNotCloseAfterTeleport = true;
// }
// else if (EntityTransferModule.IsInTransit(sp.UUID))
// if (!acd.ChildrenCapSeeds.ContainsKey(RegionInfo.RegionHandle))
// {
// m_log.DebugFormat(
// "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because source will attempt close.",
// sp.Name, Name);
//
// sp.DoNotCloseAfterTeleport = true;
// }
// else if (EntityTransferModule.IsInTransit(sp.UUID))
sp.LifecycleState = ScenePresenceState.Running;
@ -3968,7 +3968,7 @@ namespace OpenSim.Region.Framework.Scenes
if (vialogin)
{
// CleanDroppedAttachments();
// CleanDroppedAttachments();
// Make sure avatar position is in the region (why it wouldn't be is a mystery but do sanity checking)
if (acd.startpos.X < 0) acd.startpos.X = 1f;
@ -3976,9 +3976,9 @@ namespace OpenSim.Region.Framework.Scenes
if (acd.startpos.Y < 0) acd.startpos.Y = 1f;
if (acd.startpos.Y >= RegionInfo.RegionSizeY) acd.startpos.Y = RegionInfo.RegionSizeY - 1f;
// m_log.DebugFormat(
// "[SCENE]: Found telehub object {0} for new user connection {1} to {2}",
// RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
// m_log.DebugFormat(
// "[SCENE]: Found telehub object {0} for new user connection {1} to {2}",
// RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
// Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
@ -4295,69 +4295,69 @@ namespace OpenSim.Region.Framework.Scenes
return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc);
}
// /// <summary>
// /// The Grid has requested that we log-off a user. Log them off.
// /// </summary>
// /// <param name="AvatarID">Unique ID of the avatar to log-off</param>
// /// <param name="RegionSecret">SecureSessionID of the user, or the RegionSecret text when logging on to the grid</param>
// /// <param name="message">message to display to the user. Reason for being logged off</param>
// public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
// {
// ScenePresence loggingOffUser = GetScenePresence(AvatarID);
// if (loggingOffUser != null)
// {
// UUID localRegionSecret = UUID.Zero;
// bool parsedsecret = UUID.TryParse(RegionInfo.regionSecret, out localRegionSecret);
//
// // Region Secret is used here in case a new sessionid overwrites an old one on the user server.
// // Will update the user server in a few revisions to use it.
//
// if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret))
// {
// m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles);
// loggingOffUser.ControllingClient.Kick(message);
// // Give them a second to receive the message!
// Thread.Sleep(1000);
// loggingOffUser.ControllingClient.Close();
// }
// else
// {
// m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
// }
// }
// else
// {
// m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
// }
// }
// /// <summary>
// /// The Grid has requested that we log-off a user. Log them off.
// /// </summary>
// /// <param name="AvatarID">Unique ID of the avatar to log-off</param>
// /// <param name="RegionSecret">SecureSessionID of the user, or the RegionSecret text when logging on to the grid</param>
// /// <param name="message">message to display to the user. Reason for being logged off</param>
// public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
// {
// ScenePresence loggingOffUser = GetScenePresence(AvatarID);
// if (loggingOffUser != null)
// {
// UUID localRegionSecret = UUID.Zero;
// bool parsedsecret = UUID.TryParse(RegionInfo.regionSecret, out localRegionSecret);
//
// // Region Secret is used here in case a new sessionid overwrites an old one on the user server.
// // Will update the user server in a few revisions to use it.
//
// if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret))
// {
// m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles);
// loggingOffUser.ControllingClient.Kick(message);
// // Give them a second to receive the message!
// Thread.Sleep(1000);
// loggingOffUser.ControllingClient.Close();
// }
// else
// {
// m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
// }
// }
// else
// {
// m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
// }
// }
// /// <summary>
// /// Triggered when an agent crosses into this sim. Also happens on initial login.
// /// </summary>
// /// <param name="agentID"></param>
// /// <param name="position"></param>
// /// <param name="isFlying"></param>
// public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
// {
// ScenePresence presence = GetScenePresence(agentID);
// if (presence != null)
// {
// try
// {
// presence.MakeRootAgent(position, isFlying);
// }
// catch (Exception e)
// {
// m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace);
// }
// }
// else
// {
// m_log.ErrorFormat(
// "[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
// agentID, RegionInfo.RegionName);
// }
// }
// /// <summary>
// /// Triggered when an agent crosses into this sim. Also happens on initial login.
// /// </summary>
// /// <param name="agentID"></param>
// /// <param name="position"></param>
// /// <param name="isFlying"></param>
// public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
// {
// ScenePresence presence = GetScenePresence(agentID);
// if (presence != null)
// {
// try
// {
// presence.MakeRootAgent(position, isFlying);
// }
// catch (Exception e)
// {
// m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace);
// }
// }
// else
// {
// m_log.ErrorFormat(
// "[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
// agentID, RegionInfo.RegionName);
// }
// }
/// <summary>
/// We've got an update about an agent that sees into this region,
@ -4435,17 +4435,17 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>true if we handled it.</returns>
public virtual bool IncomingUpdateChildAgent(AgentPosition cAgentData)
{
// m_log.DebugFormat(
// "[SCENE PRESENCE]: IncomingChildAgentDataUpdate POSITION for {0} in {1}, position {2}",
// cAgentData.AgentID, Name, cAgentData.Position);
// m_log.DebugFormat(
// "[SCENE PRESENCE]: IncomingChildAgentDataUpdate POSITION for {0} in {1}, position {2}",
// cAgentData.AgentID, Name, cAgentData.Position);
ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
if (childAgentUpdate != null)
{
// if (childAgentUpdate.ControllingClient.SessionId != cAgentData.SessionID)
// // Only warn for now
// m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?",
// childAgentUpdate.UUID, cAgentData.SessionID);
// if (childAgentUpdate.ControllingClient.SessionId != cAgentData.SessionID)
// // Only warn for now
// m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?",
// childAgentUpdate.UUID, cAgentData.SessionID);
// I can't imagine *yet* why we would get an update if the agent is a root agent..
// however to avoid a race condition crossing borders..
@ -5163,15 +5163,15 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
// Commented pending deletion since this method no longer appears to do anything at all
// public bool NeedSceneCacheClear(UUID agentID)
// {
// IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
// if (inv == null)
// return true;
//
// return inv.NeedSceneCacheClear(agentID, this);
// }
// Commented pending deletion since this method no longer appears to do anything at all
// public bool NeedSceneCacheClear(UUID agentID)
// {
// IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
// if (inv == null)
// return true;
//
// return inv.NeedSceneCacheClear(agentID, this);
// }
public void CleanTempObjects()
{
@ -5227,7 +5227,7 @@ namespace OpenSim.Region.Framework.Scenes
else
return health;
// CheckHeartbeat();
// CheckHeartbeat();
return health;
}
@ -5419,14 +5419,14 @@ namespace OpenSim.Region.Framework.Scenes
return (((vsn.X * xdiff) + (vsn.Y * ydiff)) / (-1 * vsn.Z)) + p0.Z;
}
// private void CheckHeartbeat()
// {
// if (m_firstHeartbeat)
// return;
//
// if (Util.EnvironmentTickCountSubtract(m_lastFrameTick) > 2000)
// StartTimer();
// }
// private void CheckHeartbeat()
// {
// if (m_firstHeartbeat)
// return;
//
// if (Util.EnvironmentTickCountSubtract(m_lastFrameTick) > 2000)
// StartTimer();
// }
public override ISceneObject DeserializeObject(string representation)
{
@ -5690,9 +5690,9 @@ namespace OpenSim.Region.Framework.Scenes
g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ);
// m_log.DebugFormat(
// "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}",
// g.Name, new Vector3(ominX, ominY, ominZ), new Vector3(omaxX, omaxY, omaxZ));
// m_log.DebugFormat(
// "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}",
// g.Name, new Vector3(ominX, ominY, ominZ), new Vector3(omaxX, omaxY, omaxZ));
ominX += vec.X;
omaxX += vec.X;
@ -5919,15 +5919,15 @@ namespace OpenSim.Region.Framework.Scenes
if (presence.MovingToTarget)
{
double distanceToTarget = Util.GetDistanceTo(presence.AbsolutePosition, presence.MoveToPositionTarget);
// m_log.DebugFormat(
// "[SCENE]: Abs pos of {0} is {1}, target {2}, distance {3}",
// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget);
// m_log.DebugFormat(
// "[SCENE]: Abs pos of {0} is {1}, target {2}, distance {3}",
// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget);
// Check the error term of the current position in relation to the target position
if (distanceToTarget <= ScenePresence.SIGNIFICANT_MOVEMENT)
{
// We are close enough to the target
// m_log.DebugFormat("[SCENEE]: Stopping autopilot of {0}", presence.Name);
// m_log.DebugFormat("[SCENEE]: Stopping autopilot of {0}", presence.Name);
presence.Velocity = Vector3.Zero;
presence.AbsolutePosition = presence.MoveToPositionTarget;
@ -5946,23 +5946,23 @@ namespace OpenSim.Region.Framework.Scenes
if (presence.LandAtTarget)
presence.Flying = false;
// Vector3 targetPos = presence.MoveToPositionTarget;
// float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y];
// if (targetPos.Z - terrainHeight < 0.2)
// {
// presence.Flying = false;
// }
// Vector3 targetPos = presence.MoveToPositionTarget;
// float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y];
// if (targetPos.Z - terrainHeight < 0.2)
// {
// presence.Flying = false;
// }
}
// m_log.DebugFormat(
// "[SCENE]: AgentControlFlags {0}, MovementFlag {1} for {2}",
// presence.AgentControlFlags, presence.MovementFlag, presence.Name);
// m_log.DebugFormat(
// "[SCENE]: AgentControlFlags {0}, MovementFlag {1} for {2}",
// presence.AgentControlFlags, presence.MovementFlag, presence.Name);
}
else
{
// m_log.DebugFormat(
// "[SCENE]: Updating npc {0} at {1} for next movement to {2}",
// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
// m_log.DebugFormat(
// "[SCENE]: Updating npc {0} at {1} for next movement to {2}",
// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
Vector3 agent_control_v3 = new Vector3();
presence.HandleMoveToTargetUpdate(1, ref agent_control_v3);