mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
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.
This commit is contained in:
@@ -39,6 +39,7 @@ using Nwc.XmlRpc;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
|
||||
namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
|
||||
{
|
||||
@@ -589,10 +590,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
|
||||
{
|
||||
// try avatar username surname
|
||||
Scene scene = GetRandomScene();
|
||||
UserProfileData profile = scene.CommsManager.UserService.GetUserProfile(agentID);
|
||||
if (profile != null)
|
||||
CachedUserInfo profile = scene.CommsManager.UserProfileCacheService.GetUserDetails(agentID);
|
||||
if (profile != null && profile.UserProfile != null)
|
||||
{
|
||||
string avatarname = profile.FirstName + " " + profile.SurName;
|
||||
string avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName;
|
||||
return avatarname;
|
||||
}
|
||||
return String.Empty;
|
||||
|
||||
@@ -29,6 +29,7 @@ using OpenSim.Framework;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.Region.Environment.Modules.World.Serialiser;
|
||||
using OpenSim.Region.Environment.Modules.World.Terrain;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using System;
|
||||
using Axiom.Math;
|
||||
using System.Collections.Generic;
|
||||
@@ -187,7 +188,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
|
||||
{
|
||||
if (!m_validUserUuids.ContainsKey(uuid))
|
||||
{
|
||||
if (m_scene.CommsManager.UserService.GetUserProfile(uuid) != null)
|
||||
CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(uuid);
|
||||
if (profile != null && profile.UserProfile != null)
|
||||
m_validUserUuids.Add(uuid, true);
|
||||
else
|
||||
m_validUserUuids.Add(uuid, false);
|
||||
|
||||
Reference in New Issue
Block a user