Add a "useCached" parameter to GetUserAccount. Add a function to Scene to get the user flags. It has to be here due to access restrictions :/

This commit is contained in:
Tom
2011-01-26 16:25:08 -08:00
parent 3ecf712e4d
commit 6b27587bc7
8 changed files with 55 additions and 32 deletions

View File

@@ -88,12 +88,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
public void AddCapsHandler(UUID agentId)
{
int flags = 0;
ScenePresence sp;
if (m_scene.TryGetScenePresence(agentId, out sp))
{
flags = sp.UserFlags;
}
int flags = m_scene.GetUserFlags(agentId);
if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId, flags))
return;

View File

@@ -142,10 +142,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
public UserAccount GetUserAccount(UUID scopeID, UUID userID)
{
bool inCache = false;
UserAccount account = m_Cache.Get(userID, out inCache);
if (inCache)
return account;
return GetUserAccount(scopeID, userID, true);
}
public UserAccount GetUserAccount(UUID scopeID, UUID userID, bool useCache)
{
UserAccount account;
if (useCache)
{
bool inCache = false;
account = m_Cache.Get(userID, out inCache);
if (inCache)
return account;
}
account = m_UserService.GetUserAccount(scopeID, userID);
m_Cache.Cache(userID, account);