mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user