diff options
author | Dan Lake | 2011-10-27 02:26:37 -0700 |
---|---|---|
committer | Dan Lake | 2011-10-27 02:26:37 -0700 |
commit | 272bf712796ad8e98e79aee50311a84deaf23d79 (patch) | |
tree | edda33f1e7478678a457f187768e1b73a118240b /OpenSim/Region/OptionalModules | |
parent | Continuation of previous checkin. Found more places where ForEachScenePresenc... (diff) | |
download | opensim-SC_OLD-272bf712796ad8e98e79aee50311a84deaf23d79.zip opensim-SC_OLD-272bf712796ad8e98e79aee50311a84deaf23d79.tar.gz opensim-SC_OLD-272bf712796ad8e98e79aee50311a84deaf23d79.tar.bz2 opensim-SC_OLD-272bf712796ad8e98e79aee50311a84deaf23d79.tar.xz |
Removed use of 'is' operator and casting to find the root ScenePresence in MessageTransfer modules and Groups module.
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 11 |
2 files changed, 12 insertions, 14 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs index a12e6ea..10b83e6 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs | |||
@@ -504,19 +504,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
504 | // Try root avatar first | 504 | // Try root avatar first |
505 | foreach (Scene scene in m_sceneList) | 505 | foreach (Scene scene in m_sceneList) |
506 | { | 506 | { |
507 | if (scene.Entities.ContainsKey(agentID) && | 507 | ScenePresence sp = scene.GetScenePresence(agentID); |
508 | scene.Entities[agentID] is ScenePresence) | 508 | if (sp != null) |
509 | { | 509 | { |
510 | ScenePresence user = (ScenePresence)scene.Entities[agentID]; | 510 | if (!sp.IsChildAgent) |
511 | if (!user.IsChildAgent) | ||
512 | { | 511 | { |
513 | if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", user.ControllingClient.Name); | 512 | if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", sp.ControllingClient.Name); |
514 | return user.ControllingClient; | 513 | return sp.ControllingClient; |
515 | } | 514 | } |
516 | else | 515 | else |
517 | { | 516 | { |
518 | if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", user.ControllingClient.Name); | 517 | if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", sp.ControllingClient.Name); |
519 | child = user.ControllingClient; | 518 | child = sp.ControllingClient; |
520 | } | 519 | } |
521 | } | 520 | } |
522 | } | 521 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 630fcab..b2c0f48 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -1076,17 +1076,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1076 | // Try root avatar first | 1076 | // Try root avatar first |
1077 | foreach (Scene scene in m_sceneList) | 1077 | foreach (Scene scene in m_sceneList) |
1078 | { | 1078 | { |
1079 | if (scene.Entities.ContainsKey(agentID) && | 1079 | ScenePresence sp = scene.GetScenePresence(agentID); |
1080 | scene.Entities[agentID] is ScenePresence) | 1080 | if (sp != null) |
1081 | { | 1081 | { |
1082 | ScenePresence user = (ScenePresence)scene.Entities[agentID]; | 1082 | if (!sp.IsChildAgent) |
1083 | if (!user.IsChildAgent) | ||
1084 | { | 1083 | { |
1085 | return user.ControllingClient; | 1084 | return sp.ControllingClient; |
1086 | } | 1085 | } |
1087 | else | 1086 | else |
1088 | { | 1087 | { |
1089 | child = user.ControllingClient; | 1088 | child = sp.ControllingClient; |
1090 | } | 1089 | } |
1091 | } | 1090 | } |
1092 | } | 1091 | } |