From 328ab79b783d4beaa5f954918e3b306950153c1a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 16 Aug 2008 02:00:36 +0000 Subject: Refactor a lot of direct calls to OGS1 to use the cached version instead. Scripts can now no longer DOS the user server and there are a lot fewer gratuitious lookups of user profile data. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 +++--- .../ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 15793e4..5ab6c4d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -633,10 +633,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string resolveName(LLUUID objecUUID) { // try avatar username surname - UserProfileData profile = World.CommsManager.UserService.GetUserProfile(objecUUID); - if (profile != null) + CachedUserInfo profile = World.CommsManager.UserProfileCacheService.GetUserDetails(objecUUID); + if (profile != null && profile.UserProfile != null) { - string avatarname = profile.FirstName + " " + profile.SurName; + string avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName; return avatarname; } // try an scene object diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 5833512..eaf4bd0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using libsecondlife; using OpenSim.Framework; +using OpenSim.Framework.Communications.Cache; using OpenSim.Region.Environment.Scenes; using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.ScriptEngine.Shared.Api; @@ -263,10 +264,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins string entname =ent.Name; // try avatar username surname - UserProfileData profile = m_CmdManager.m_ScriptEngine.World.CommsManager.UserService.GetUserProfile(ent.UUID); - if (profile != null) + CachedUserInfo profile = m_CmdManager.m_ScriptEngine.World.CommsManager.UserProfileCacheService.GetUserDetails(ent.UUID); + if (profile != null && profile.UserProfile != null) { - avatarname = profile.FirstName + " " + profile.SurName; + avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName; } // try an scene object SceneObjectPart SOP = m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(ent.UUID); -- cgit v1.1