From af3cd00048fb6476eb5140bcfccda926627363f2 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 9 Dec 2011 23:07:53 +0000
Subject: Get rid of IScene.PresenceChildStatus() which always had to execute a
lookup in favour of IClientAPI.ISceneAgent.IsChildAgent instead.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 11 -----------
OpenSim/Region/Framework/Scenes/SceneBase.cs | 5 -----
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 15 ++-------------
3 files changed, 2 insertions(+), 29 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 11505cc..9fdf395 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4193,17 +4193,6 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Returns true if scene presence is a child (no avatar in this scene)
- ///
- ///
- ///
- public override bool PresenceChildStatus(UUID avatarID)
- {
- ScenePresence sp;
- return TryGetScenePresence(avatarID, out sp) && sp.IsChildAgent;
- }
-
- ///
/// Performs action on all avatars in the scene (root scene presences)
/// Avatars may be an NPC or a 'real' client.
///
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index da15491..712e094 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -211,11 +211,6 @@ namespace OpenSim.Region.Framework.Scenes
}
#region admin stuff
-
- public virtual bool PresenceChildStatus(UUID avatarID)
- {
- return false;
- }
public abstract void OtherRegionUp(GridRegion otherRegion);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index cebf51b..fa731a7 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -612,19 +612,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- ///
- /// If this is true, agent doesn't have a representation in this scene.
- /// this is an agent 'looking into' this scene from a nearby scene(region)
- ///
- /// if False, this agent has a representation in this scene
- ///
- private bool m_isChildAgent = true;
-
- public bool IsChildAgent
- {
- get { return m_isChildAgent; }
- set { m_isChildAgent = value; }
- }
+ public bool IsChildAgent { get; set; }
public uint ParentID
{
@@ -741,6 +729,7 @@ namespace OpenSim.Region.Framework.Scenes
{
AttachmentsSyncLock = new Object();
+ IsChildAgent = true;
m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
Animator = new ScenePresenceAnimator(this);
PresenceType = type;
--
cgit v1.1
From 13b1c8c1730147a0c7cf1a0a0039ed493e1cbb29 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 9 Dec 2011 23:21:54 +0000
Subject: Do some clean up Scene.cs log messages.
This prints out both exception message and stacktrace (Exception.ToString()) isn't enough on Windows.
This also uses m_log.*Format() which is more efficient than string concat.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 62 +++++++++++++++++++-------------
1 file changed, 38 insertions(+), 24 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 9fdf395..85debc4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -760,7 +760,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- m_log.Info("[SCENE]: Using the " + m_priorityScheme + " prioritization scheme");
+ m_log.InfoFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
#endregion Interest Management
@@ -891,9 +891,9 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
- m_log.Info("[INTERGRID]: Got notice about far away Region: " + otherRegion.RegionName.ToString() +
- " at (" + otherRegion.RegionLocX.ToString() + ", " +
- otherRegion.RegionLocY.ToString() + ")");
+ m_log.InfoFormat(
+ "[INTERGRID]: Got notice about far away Region: {0} at ({1}, {2})",
+ otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY);
}
}
}
@@ -1368,7 +1368,9 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (AccessViolationException e)
{
- m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName);
+ m_log.ErrorFormat(
+ "[REGION]: Failed on region {0} with exception {1}{2}",
+ RegionInfo.RegionName, e.Message, e.StackTrace);
}
//catch (NullReferenceException e)
//{
@@ -1376,11 +1378,15 @@ namespace OpenSim.Region.Framework.Scenes
//}
catch (InvalidOperationException e)
{
- m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName);
+ m_log.ErrorFormat(
+ "[REGION]: Failed on region {0} with exception {1}{2}",
+ RegionInfo.RegionName, e.Message, e.StackTrace);
}
catch (Exception e)
{
- m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName);
+ m_log.ErrorFormat(
+ "[REGION]: Failed on region {0} with exception {1}{2}",
+ RegionInfo.RegionName, e.Message, e.StackTrace);
}
maintc = Util.EnvironmentTickCountSubtract(maintc);
@@ -1602,7 +1608,9 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (IOException e)
{
- m_log.Warn("[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception " + e.ToString() + " Regenerating");
+ m_log.WarnFormat(
+ "[TERRAIN]: Scene.cs: LoadWorldMap() - Regenerating as failed with exception {0}{1}",
+ e.Message, e.StackTrace);
// Non standard region size. If there's an old terrain in the database, it might read past the buffer
#pragma warning disable 0162
@@ -1615,7 +1623,8 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
- m_log.Warn("[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception " + e.ToString());
+ m_log.WarnFormat(
+ "[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception {0}{1}", e.Message, e.StackTrace);
}
}
@@ -1689,7 +1698,7 @@ namespace OpenSim.Region.Framework.Scenes
List PrimsFromDB = SimulationDataService.LoadObjects(regionID);
- m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count + " objects from the datastore");
+ m_log.InfoFormat("[SCENE]: Loaded {0} objects from the datastore", PrimsFromDB.Count);
foreach (SceneObjectGroup group in PrimsFromDB)
{
@@ -1703,7 +1712,6 @@ namespace OpenSim.Region.Framework.Scenes
// group.CheckSculptAndLoad();
}
- m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
LoadingPrims = false;
EventManager.TriggerPrimsLoaded(this);
}
@@ -2326,7 +2334,7 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
- m_log.WarnFormat("[SCENE]: Problem casting object: " + e.ToString());
+ m_log.WarnFormat("[SCENE]: Problem casting object, exception {0}{1}", e.Message, e.StackTrace);
return false;
}
@@ -2402,8 +2410,7 @@ namespace OpenSim.Region.Framework.Scenes
//
if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID))
{
- m_log.Info("[INTERREGION]: Denied prim crossing for " +
- "banned avatar");
+ m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", sceneObject.OwnerID);
return false;
}
@@ -2460,8 +2467,7 @@ namespace OpenSim.Region.Framework.Scenes
{
// Deny non attachments based on parcel settings
//
- m_log.Info("[INTERREGION]: Denied prim crossing " +
- "because of parcel settings");
+ m_log.Info("[INTERREGION]: Denied prim crossing because of parcel settings");
DeleteSceneObject(sceneObject, false);
@@ -2505,7 +2511,8 @@ namespace OpenSim.Region.Framework.Scenes
// connected.
if (sp == null)
{
- m_log.Debug("[SCENE]: Adding new child scene presence " + client.Name + " to scene " + RegionInfo.RegionName);
+ m_log.DebugFormat(
+ "[SCENE]: Adding new child scene presence {0} to scene {1}", client.Name, RegionInfo.RegionName);
m_clientManager.Add(client);
SubscribeToClientEvents(client);
@@ -3141,7 +3148,7 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
- m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString());
+ m_log.ErrorFormat("[SCENE] Scene.cs:RemoveClient exception {0}{1}", e.Message, e.StackTrace);
}
m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
@@ -3286,7 +3293,8 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
- m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString());
+ m_log.ErrorFormat(
+ "[CONNECTION BEGIN]: Exception verifying presence {0}{1}", e.Message, e.StackTrace);
return false;
}
}
@@ -3298,7 +3306,8 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
- m_log.ErrorFormat("[CONNECTION BEGIN]: Exception authorizing user " + e.ToString());
+ m_log.ErrorFormat(
+ "[CONNECTION BEGIN]: Exception authorizing user {0}{1}", e.Message, e.StackTrace);
return false;
}
@@ -3509,7 +3518,9 @@ namespace OpenSim.Region.Framework.Scenes
}
}
else
+ {
m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!");
+ }
IGroupsModule groupsModule =
RequestModuleInterface();
@@ -3527,7 +3538,9 @@ namespace OpenSim.Region.Framework.Scenes
agentGroups.Add(GroupMembership[i].GroupID);
}
else
+ {
m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!");
+ }
}
bool groupAccess = false;
@@ -3545,7 +3558,9 @@ namespace OpenSim.Region.Framework.Scenes
}
}
else
+ {
m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!");
+ }
if (!m_regInfo.EstateSettings.PublicAccess &&
!m_regInfo.EstateSettings.HasAccess(agent.AgentID) &&
@@ -3662,7 +3677,7 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
- m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}", e);
+ m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace);
}
}
else
@@ -3968,7 +3983,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void HandleEditCommand(string[] cmdparams)
{
- m_log.Debug("Searching for Primitive: '" + cmdparams[2] + "'");
+ m_log.DebugFormat("Searching for Primitive: '{0}'", cmdparams[2]);
EntityBase[] entityList = GetEntities();
foreach (EntityBase ent in entityList)
@@ -3984,7 +3999,7 @@ namespace OpenSim.Region.Framework.Scenes
new Vector3(Convert.ToSingle(cmdparams[3]), Convert.ToSingle(cmdparams[4]),
Convert.ToSingle(cmdparams[5])));
- m_log.Debug("Edited scale of Primitive: " + part.Name);
+ m_log.DebugFormat("Edited scale of Primitive: {0}", part.Name);
}
}
}
@@ -4013,7 +4028,6 @@ namespace OpenSim.Region.Framework.Scenes
return LandChannel.GetLandObject((int)x, (int)y).LandData;
}
-
#endregion
#region Script Engine
--
cgit v1.1