aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs29
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs18
2 files changed, 19 insertions, 28 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index fc6325d..24ec435 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -449,29 +449,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
449 /// </summary> 449 /// </summary>
450 public IClientAPI LocateClientObject(UUID agentID) 450 public IClientAPI LocateClientObject(UUID agentID)
451 { 451 {
452 Scene scene = GetClientScene(agentID);
453 if (scene != null)
454 {
455 ScenePresence presence = scene.GetScenePresence(agentID);
456 if (presence != null)
457 return presence.ControllingClient;
458 }
459
460 return null;
461 }
462
463 /// <summary>
464 /// Find the scene for an agent
465 /// </summary>
466 private Scene GetClientScene(UUID agentId)
467 {
468 lock (m_Scenes) 452 lock (m_Scenes)
469 { 453 {
470 foreach (Scene scene in m_Scenes) 454 foreach (Scene scene in m_Scenes)
471 { 455 {
472 ScenePresence presence = scene.GetScenePresence(agentId); 456 ScenePresence presence = scene.GetScenePresence(agentID);
473 if (presence != null && !presence.IsChildAgent) 457 if (presence != null && !presence.IsChildAgent)
474 return scene; 458 return presence.ControllingClient;
475 } 459 }
476 } 460 }
477 461
@@ -498,7 +482,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
498 Util.FireAndForget( 482 Util.FireAndForget(
499 delegate 483 delegate
500 { 484 {
501 m_log.DebugFormat("[FRIENDS MODULE]: Notifying {0} friends", friendList.Count); 485 m_log.DebugFormat(
486 "[FRIENDS MODULE]: Notifying {0} friends of {1} of online status {2}",
487 friendList.Count, agentID, online);
488
502 // Notify about this user status 489 // Notify about this user status
503 StatusNotify(friendList, agentID, online); 490 StatusNotify(friendList, agentID, online);
504 } 491 }
@@ -515,7 +502,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
515 { 502 {
516 // Try local 503 // Try local
517 if (LocalStatusNotification(userID, friendID, online)) 504 if (LocalStatusNotification(userID, friendID, online))
518 return; 505 continue;
519 506
520 // The friend is not here [as root]. Let's forward. 507 // The friend is not here [as root]. Let's forward.
521 PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); 508 PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
@@ -523,11 +510,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
523 { 510 {
524 PresenceInfo friendSession = null; 511 PresenceInfo friendSession = null;
525 foreach (PresenceInfo pinfo in friendSessions) 512 foreach (PresenceInfo pinfo in friendSessions)
513 {
526 if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad 514 if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad
527 { 515 {
528 friendSession = pinfo; 516 friendSession = pinfo;
529 break; 517 break;
530 } 518 }
519 }
531 520
532 if (friendSession != null) 521 if (friendSession != null)
533 { 522 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 0688916..321d0d2 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -128,6 +128,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
128 { 128 {
129// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 129// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
130 130
131 public const string GridInfoServiceConfigSectionName = "GridInfoService";
132
131 internal IScriptEngine m_ScriptEngine; 133 internal IScriptEngine m_ScriptEngine;
132 internal ILSL_Api m_LSL_Api = null; // get a reference to the LSL API so we can call methods housed there 134 internal ILSL_Api m_LSL_Api = null; // get a reference to the LSL API so we can call methods housed there
133 internal SceneObjectPart m_host; 135 internal SceneObjectPart m_host;
@@ -2041,8 +2043,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2041 string nick = String.Empty; 2043 string nick = String.Empty;
2042 IConfigSource config = m_ScriptEngine.ConfigSource; 2044 IConfigSource config = m_ScriptEngine.ConfigSource;
2043 2045
2044 if (config.Configs["GridInfo"] != null) 2046 if (config.Configs[GridInfoServiceConfigSectionName] != null)
2045 nick = config.Configs["GridInfo"].GetString("gridnick", nick); 2047 nick = config.Configs[GridInfoServiceConfigSectionName].GetString("gridnick", nick);
2046 2048
2047 if (String.IsNullOrEmpty(nick)) 2049 if (String.IsNullOrEmpty(nick))
2048 nick = GridUserInfo(InfoType.Nick); 2050 nick = GridUserInfo(InfoType.Nick);
@@ -2058,8 +2060,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2058 string name = String.Empty; 2060 string name = String.Empty;
2059 IConfigSource config = m_ScriptEngine.ConfigSource; 2061 IConfigSource config = m_ScriptEngine.ConfigSource;
2060 2062
2061 if (config.Configs["GridInfo"] != null) 2063 if (config.Configs[GridInfoServiceConfigSectionName] != null)
2062 name = config.Configs["GridInfo"].GetString("gridname", name); 2064 name = config.Configs[GridInfoServiceConfigSectionName].GetString("gridname", name);
2063 2065
2064 if (String.IsNullOrEmpty(name)) 2066 if (String.IsNullOrEmpty(name))
2065 name = GridUserInfo(InfoType.Name); 2067 name = GridUserInfo(InfoType.Name);
@@ -2075,8 +2077,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2075 string loginURI = String.Empty; 2077 string loginURI = String.Empty;
2076 IConfigSource config = m_ScriptEngine.ConfigSource; 2078 IConfigSource config = m_ScriptEngine.ConfigSource;
2077 2079
2078 if (config.Configs["GridInfo"] != null) 2080 if (config.Configs[GridInfoServiceConfigSectionName] != null)
2079 loginURI = config.Configs["GridInfo"].GetString("login", loginURI); 2081 loginURI = config.Configs[GridInfoServiceConfigSectionName].GetString("login", loginURI);
2080 2082
2081 if (String.IsNullOrEmpty(loginURI)) 2083 if (String.IsNullOrEmpty(loginURI))
2082 loginURI = GridUserInfo(InfoType.Login); 2084 loginURI = GridUserInfo(InfoType.Login);
@@ -2123,8 +2125,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2123 string retval = String.Empty; 2125 string retval = String.Empty;
2124 IConfigSource config = m_ScriptEngine.ConfigSource; 2126 IConfigSource config = m_ScriptEngine.ConfigSource;
2125 2127
2126 if (config.Configs["GridInfo"] != null) 2128 if (config.Configs[GridInfoServiceConfigSectionName] != null)
2127 retval = config.Configs["GridInfo"].GetString(key, retval); 2129 retval = config.Configs[GridInfoServiceConfigSectionName].GetString(key, retval);
2128 2130
2129 if (String.IsNullOrEmpty(retval)) 2131 if (String.IsNullOrEmpty(retval))
2130 retval = GridUserInfo(InfoType.Custom, key); 2132 retval = GridUserInfo(InfoType.Custom, key);