diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
3 files changed, 35 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 1c83f8e..097ff1a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -185,15 +185,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
185 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 185 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
186 | { | 186 | { |
187 | InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID); | 187 | InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID); |
188 | Util.FireAndForget(delegate | 188 | |
189 | if (UserManager != null) | ||
189 | { | 190 | { |
190 | if (UserManager != null) | 191 | // Protect ourselves against the caller subsequently modifying the items list |
192 | List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items); | ||
193 | |||
194 | Util.FireAndForget(delegate | ||
191 | { | 195 | { |
192 | // Protect ourselves against the caller subsequently modifying the items list | 196 | foreach (InventoryItemBase item in items) |
193 | foreach (InventoryItemBase item in new List<InventoryItemBase>(invCol.Items)) | ||
194 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 197 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
195 | } | 198 | }); |
196 | }); | 199 | } |
197 | 200 | ||
198 | return invCol; | 201 | return invCol; |
199 | } | 202 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index c9c716c..73ab4e3 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -193,15 +193,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
193 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 193 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
194 | { | 194 | { |
195 | InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID); | 195 | InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID); |
196 | Util.FireAndForget(delegate | 196 | |
197 | if (UserManager != null) | ||
197 | { | 198 | { |
198 | if (UserManager != null) | 199 | // Protect ourselves against the caller subsequently modifying the items list |
200 | List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items); | ||
201 | |||
202 | Util.FireAndForget(delegate | ||
199 | { | 203 | { |
200 | // Protect ourselves against the caller subsequently modifying the items list | 204 | foreach (InventoryItemBase item in items) |
201 | foreach (InventoryItemBase item in new List<InventoryItemBase>(invCol.Items)) | ||
202 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 205 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
203 | } | 206 | }); |
204 | }); | 207 | } |
205 | 208 | ||
206 | return invCol; | 209 | return invCol; |
207 | } | 210 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs index 30ebb21..0a0ce3c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | |||
@@ -45,7 +45,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
45 | LogManager.GetLogger( | 45 | LogManager.GetLogger( |
46 | MethodBase.GetCurrentMethod().DeclaringType); | 46 | MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | private IUserAccountService m_UserService; | 48 | /// <summary> |
49 | /// This is not on the IUserAccountService. It's only being used so that standalone scenes can punch through | ||
50 | /// to a local UserAccountService when setting up an estate manager. | ||
51 | /// </summary> | ||
52 | public IUserAccountService UserAccountService { get; private set; } | ||
53 | |||
49 | private UserAccountCache m_Cache; | 54 | private UserAccountCache m_Cache; |
50 | 55 | ||
51 | private bool m_Enabled = false; | 56 | private bool m_Enabled = false; |
@@ -86,9 +91,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
86 | } | 91 | } |
87 | 92 | ||
88 | Object[] args = new Object[] { source }; | 93 | Object[] args = new Object[] { source }; |
89 | m_UserService = ServerUtils.LoadPlugin<IUserAccountService>(serviceDll, args); | 94 | UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(serviceDll, args); |
90 | 95 | ||
91 | if (m_UserService == null) | 96 | if (UserAccountService == null) |
92 | { | 97 | { |
93 | m_log.ErrorFormat( | 98 | m_log.ErrorFormat( |
94 | "[LOCAL USER ACCOUNT SERVICE CONNECTOR]: Cannot load user account service specified as {0}", serviceDll); | 99 | "[LOCAL USER ACCOUNT SERVICE CONNECTOR]: Cannot load user account service specified as {0}", serviceDll); |
@@ -119,7 +124,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
119 | if (!m_Enabled) | 124 | if (!m_Enabled) |
120 | return; | 125 | return; |
121 | 126 | ||
122 | scene.RegisterModuleInterface<IUserAccountService>(m_UserService); | 127 | // FIXME: Why do we bother setting this module and caching up if we just end up registering the inner |
128 | // user account service?! | ||
129 | scene.RegisterModuleInterface<IUserAccountService>(UserAccountService); | ||
123 | } | 130 | } |
124 | 131 | ||
125 | public void RemoveRegion(Scene scene) | 132 | public void RemoveRegion(Scene scene) |
@@ -147,7 +154,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
147 | if (inCache) | 154 | if (inCache) |
148 | return account; | 155 | return account; |
149 | 156 | ||
150 | account = m_UserService.GetUserAccount(scopeID, userID); | 157 | account = UserAccountService.GetUserAccount(scopeID, userID); |
151 | m_Cache.Cache(userID, account); | 158 | m_Cache.Cache(userID, account); |
152 | 159 | ||
153 | return account; | 160 | return account; |
@@ -160,7 +167,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
160 | if (inCache) | 167 | if (inCache) |
161 | return account; | 168 | return account; |
162 | 169 | ||
163 | account = m_UserService.GetUserAccount(scopeID, firstName, lastName); | 170 | account = UserAccountService.GetUserAccount(scopeID, firstName, lastName); |
164 | if (account != null) | 171 | if (account != null) |
165 | m_Cache.Cache(account.PrincipalID, account); | 172 | m_Cache.Cache(account.PrincipalID, account); |
166 | 173 | ||
@@ -169,22 +176,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
169 | 176 | ||
170 | public UserAccount GetUserAccount(UUID scopeID, string Email) | 177 | public UserAccount GetUserAccount(UUID scopeID, string Email) |
171 | { | 178 | { |
172 | return m_UserService.GetUserAccount(scopeID, Email); | 179 | return UserAccountService.GetUserAccount(scopeID, Email); |
173 | } | 180 | } |
174 | 181 | ||
175 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) | 182 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) |
176 | { | 183 | { |
177 | return m_UserService.GetUserAccounts(scopeID, query); | 184 | return UserAccountService.GetUserAccounts(scopeID, query); |
178 | } | 185 | } |
179 | 186 | ||
180 | // Update all updatable fields | 187 | // Update all updatable fields |
181 | // | 188 | // |
182 | public bool StoreUserAccount(UserAccount data) | 189 | public bool StoreUserAccount(UserAccount data) |
183 | { | 190 | { |
184 | return m_UserService.StoreUserAccount(data); | 191 | return UserAccountService.StoreUserAccount(data); |
185 | } | 192 | } |
186 | 193 | ||
187 | #endregion | 194 | #endregion |
188 | |||
189 | } | 195 | } |
190 | } | 196 | } \ No newline at end of file |