diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs index 7d61b20..13acdf2 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs | |||
@@ -34,6 +34,8 @@ using OpenSim.Region.Framework.Scenes; | |||
34 | using OpenSim.Services.Interfaces; | 34 | using OpenSim.Services.Interfaces; |
35 | using OpenSim.Services.Connectors; | 35 | using OpenSim.Services.Connectors; |
36 | 36 | ||
37 | using OpenMetaverse; | ||
38 | |||
37 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | 39 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts |
38 | { | 40 | { |
39 | public class RemoteUserAccountServicesConnector : UserAccountServicesConnector, | 41 | public class RemoteUserAccountServicesConnector : UserAccountServicesConnector, |
@@ -44,6 +46,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
44 | MethodBase.GetCurrentMethod().DeclaringType); | 46 | MethodBase.GetCurrentMethod().DeclaringType); |
45 | 47 | ||
46 | private bool m_Enabled = false; | 48 | private bool m_Enabled = false; |
49 | private UserAccountCache m_Cache; | ||
47 | 50 | ||
48 | public Type ReplaceableInterface | 51 | public Type ReplaceableInterface |
49 | { | 52 | { |
@@ -73,6 +76,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
73 | m_Enabled = true; | 76 | m_Enabled = true; |
74 | 77 | ||
75 | base.Initialise(source); | 78 | base.Initialise(source); |
79 | m_Cache = new UserAccountCache(); | ||
76 | 80 | ||
77 | m_log.Info("[USER CONNECTOR]: Remote users enabled"); | 81 | m_log.Info("[USER CONNECTOR]: Remote users enabled"); |
78 | } | 82 | } |
@@ -110,5 +114,35 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
110 | if (!m_Enabled) | 114 | if (!m_Enabled) |
111 | return; | 115 | return; |
112 | } | 116 | } |
117 | |||
118 | #region Overwritten methods from IUserAccountService | ||
119 | |||
120 | public override UserAccount GetUserAccount(UUID scopeID, UUID userID) | ||
121 | { | ||
122 | UserAccount account = m_Cache.Get(userID); | ||
123 | if (account != null) | ||
124 | return account; | ||
125 | |||
126 | account = base.GetUserAccount(scopeID, userID); | ||
127 | if (account != null) | ||
128 | m_Cache.Cache(account); | ||
129 | |||
130 | return account; | ||
131 | } | ||
132 | |||
133 | public override UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) | ||
134 | { | ||
135 | UserAccount account = m_Cache.Get(firstName + " " + lastName); | ||
136 | if (account != null) | ||
137 | return account; | ||
138 | |||
139 | account = base.GetUserAccount(scopeID, firstName, lastName); | ||
140 | if (account != null) | ||
141 | m_Cache.Cache(account); | ||
142 | |||
143 | return account; | ||
144 | } | ||
145 | |||
146 | #endregion | ||
113 | } | 147 | } |
114 | } | 148 | } |