aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-16 02:00:36 +0000
committerMelanie Thielker2008-08-16 02:00:36 +0000
commit328ab79b783d4beaa5f954918e3b306950153c1a (patch)
treee2bf03b6cc7c6514a9c83968a716648394602e14 /OpenSim
parentPerils of copypaste. Missing references. (diff)
downloadopensim-SC_OLD-328ab79b783d4beaa5f954918e3b306950153c1a.zip
opensim-SC_OLD-328ab79b783d4beaa5f954918e3b306950153c1a.tar.gz
opensim-SC_OLD-328ab79b783d4beaa5f954918e3b306950153c1a.tar.bz2
opensim-SC_OLD-328ab79b783d4beaa5f954918e3b306950153c1a.tar.xz
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.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs7
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs17
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs7
8 files changed, 25 insertions, 38 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
index 0d22ab9..f038975 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
@@ -39,6 +39,7 @@ using Nwc.XmlRpc;
39using OpenSim.Framework; 39using OpenSim.Framework;
40using OpenSim.Region.Environment.Interfaces; 40using OpenSim.Region.Environment.Interfaces;
41using OpenSim.Region.Environment.Scenes; 41using OpenSim.Region.Environment.Scenes;
42using OpenSim.Framework.Communications.Cache;
42 43
43namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney 44namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
44{ 45{
@@ -589,10 +590,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
589 { 590 {
590 // try avatar username surname 591 // try avatar username surname
591 Scene scene = GetRandomScene(); 592 Scene scene = GetRandomScene();
592 UserProfileData profile = scene.CommsManager.UserService.GetUserProfile(agentID); 593 CachedUserInfo profile = scene.CommsManager.UserProfileCacheService.GetUserDetails(agentID);
593 if (profile != null) 594 if (profile != null && profile.UserProfile != null)
594 { 595 {
595 string avatarname = profile.FirstName + " " + profile.SurName; 596 string avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName;
596 return avatarname; 597 return avatarname;
597 } 598 }
598 return String.Empty; 599 return String.Empty;
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index e6597c3..1340f8b 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -29,6 +29,7 @@ using OpenSim.Framework;
29using OpenSim.Region.Environment.Scenes; 29using OpenSim.Region.Environment.Scenes;
30using OpenSim.Region.Environment.Modules.World.Serialiser; 30using OpenSim.Region.Environment.Modules.World.Serialiser;
31using OpenSim.Region.Environment.Modules.World.Terrain; 31using OpenSim.Region.Environment.Modules.World.Terrain;
32using OpenSim.Framework.Communications.Cache;
32using System; 33using System;
33using Axiom.Math; 34using Axiom.Math;
34using System.Collections.Generic; 35using System.Collections.Generic;
@@ -187,7 +188,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
187 { 188 {
188 if (!m_validUserUuids.ContainsKey(uuid)) 189 if (!m_validUserUuids.ContainsKey(uuid))
189 { 190 {
190 if (m_scene.CommsManager.UserService.GetUserProfile(uuid) != null) 191 CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(uuid);
192 if (profile != null && profile.UserProfile != null)
191 m_validUserUuids.Add(uuid, true); 193 m_validUserUuids.Add(uuid, true);
192 else 194 else
193 m_validUserUuids.Add(uuid, false); 195 m_validUserUuids.Add(uuid, false);
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 00d8298..22251e9 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -3777,22 +3777,5 @@ namespace OpenSim.Region.Environment.Scenes
3777 //Console.WriteLine("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); 3777 //Console.WriteLine("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
3778 client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); 3778 client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
3779 } 3779 }
3780
3781// public bool IsAdministrator(LLUUID user)
3782// {
3783// if(RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
3784// {
3785// if(RegionInfo.MasterAvatarAssignedUUID == user)
3786// return true;
3787// }
3788//
3789// UserProfileData userProfile =
3790// CommsManager.UserService.GetUserProfile(user);
3791//
3792// if(userProfile.GodLevel >= 200)
3793// return true;
3794//
3795// return false;
3796// }
3797 } 3780 }
3798} 3781}
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index b22643f..8dcfc03 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -2026,13 +2026,12 @@ namespace OpenSim.Region.Environment.Scenes
2026 { 2026 {
2027 if (godStatus) 2027 if (godStatus)
2028 { 2028 {
2029 // TODO: remove this cruft once the master avatar is fully 2029 // For now, assign god level 200 to anyone
2030 // deprecated. For now, assign god level 200 to anyone
2031 // who is granted god powers, but has no god level set. 2030 // who is granted god powers, but has no god level set.
2032 // 2031 //
2033 UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(agentID); 2032 CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(agentID);
2034 if(userProfile.GodLevel > 0) 2033 if(profile.UserProfile.GodLevel > 0)
2035 m_godlevel = userProfile.GodLevel; 2034 m_godlevel = profile.UserProfile.GodLevel;
2036 else 2035 else
2037 m_godlevel = 200; 2036 m_godlevel = 200;
2038 } 2037 }
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 32e9085..d7cd027 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -645,10 +645,10 @@ namespace OpenSim.Region.ScriptEngine.Common
645 public string resolveName(LLUUID objecUUID) 645 public string resolveName(LLUUID objecUUID)
646 { 646 {
647 // try avatar username surname 647 // try avatar username surname
648 UserProfileData profile = World.CommsManager.UserService.GetUserProfile(objecUUID); 648 CachedUserInfo profile = World.CommsManager.UserProfileCacheService.GetUserDetails(objecUUID);
649 if (profile != null) 649 if (profile != null && profile.UserProfile != null)
650 { 650 {
651 string avatarname = profile.FirstName + " " + profile.SurName; 651 string avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName;
652 return avatarname; 652 return avatarname;
653 } 653 }
654 // try an scene object 654 // try an scene object
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs
index aaea2ee..9b636fd 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using libsecondlife; 30using libsecondlife;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Region.Environment.Scenes; 32using OpenSim.Region.Environment.Scenes;
33using OpenSim.Framework.Communications.Cache;
33 34
34namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugins 35namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugins
35{ 36{
@@ -272,10 +273,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
272 string entname =ent.Name; 273 string entname =ent.Name;
273 274
274 // try avatar username surname 275 // try avatar username surname
275 UserProfileData profile = m_CmdManager.m_ScriptEngine.World.CommsManager.UserService.GetUserProfile(ent.UUID); 276 CachedUserInfo profile = m_CmdManager.m_ScriptEngine.World.CommsManager.UserProfileCacheService.GetUserDetails(ent.UUID);
276 if (profile != null) 277 if (profile != null && profile.UserProfile != null)
277 { 278 {
278 avatarname = profile.FirstName + " " + profile.SurName; 279 avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName;
279 } 280 }
280 // try an scene object 281 // try an scene object
281 SceneObjectPart SOP = m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(ent.UUID); 282 SceneObjectPart SOP = m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(ent.UUID);
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
633 public string resolveName(LLUUID objecUUID) 633 public string resolveName(LLUUID objecUUID)
634 { 634 {
635 // try avatar username surname 635 // try avatar username surname
636 UserProfileData profile = World.CommsManager.UserService.GetUserProfile(objecUUID); 636 CachedUserInfo profile = World.CommsManager.UserProfileCacheService.GetUserDetails(objecUUID);
637 if (profile != null) 637 if (profile != null && profile.UserProfile != null)
638 { 638 {
639 string avatarname = profile.FirstName + " " + profile.SurName; 639 string avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName;
640 return avatarname; 640 return avatarname;
641 } 641 }
642 // try an scene object 642 // 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;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using libsecondlife; 30using libsecondlife;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Framework.Communications.Cache;
32using OpenSim.Region.Environment.Scenes; 33using OpenSim.Region.Environment.Scenes;
33using OpenSim.Region.ScriptEngine.Shared; 34using OpenSim.Region.ScriptEngine.Shared;
34using OpenSim.Region.ScriptEngine.Shared.Api; 35using OpenSim.Region.ScriptEngine.Shared.Api;
@@ -263,10 +264,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
263 string entname =ent.Name; 264 string entname =ent.Name;
264 265
265 // try avatar username surname 266 // try avatar username surname
266 UserProfileData profile = m_CmdManager.m_ScriptEngine.World.CommsManager.UserService.GetUserProfile(ent.UUID); 267 CachedUserInfo profile = m_CmdManager.m_ScriptEngine.World.CommsManager.UserProfileCacheService.GetUserDetails(ent.UUID);
267 if (profile != null) 268 if (profile != null && profile.UserProfile != null)
268 { 269 {
269 avatarname = profile.FirstName + " " + profile.SurName; 270 avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName;
270 } 271 }
271 // try an scene object 272 // try an scene object
272 SceneObjectPart SOP = m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(ent.UUID); 273 SceneObjectPart SOP = m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(ent.UUID);