aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
diff options
context:
space:
mode:
authorDiva Canto2010-01-10 10:40:07 -0800
committerDiva Canto2010-01-10 10:40:07 -0800
commit1e1b2ab221851efc414678b7ea52ef2ca788ce9f (patch)
tree29b6aa80e54a9c18529ae14e7d185fe67582d151 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
parentAdd a "LockedOut" flag to allow locking a region out via the grid server. (diff)
downloadopensim-SC_OLD-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.zip
opensim-SC_OLD-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.tar.gz
opensim-SC_OLD-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.tar.bz2
opensim-SC_OLD-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.tar.xz
* OMG! All but one references to UserProfileCacheService have been rerouted!
* HG is seriously broken here * Compiles. Untested.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs57
1 files changed, 28 insertions, 29 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index 6da43a8..ea6da8c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
113 /// Trigger the inventory archive saved event. 113 /// Trigger the inventory archive saved event.
114 /// </summary> 114 /// </summary>
115 protected internal void TriggerInventoryArchiveSaved( 115 protected internal void TriggerInventoryArchiveSaved(
116 Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, 116 Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
117 Exception reportedException) 117 Exception reportedException)
118 { 118 {
119 InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved; 119 InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved;
@@ -125,11 +125,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
125 { 125 {
126 if (m_scenes.Count > 0) 126 if (m_scenes.Count > 0)
127 { 127 {
128 CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass); 128 UserAccount userInfo = GetUserInfo(firstName, lastName, pass);
129 129
130 if (userInfo != null) 130 if (userInfo != null)
131 { 131 {
132 if (CheckPresence(userInfo.UserProfile.ID)) 132 if (CheckPresence(userInfo.PrincipalID))
133 { 133 {
134 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(); 134 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute();
135 return true; 135 return true;
@@ -137,8 +137,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
137 else 137 else
138 { 138 {
139 m_log.ErrorFormat( 139 m_log.ErrorFormat(
140 "[INVENTORY ARCHIVER]: User {0} {1} not logged in to this region simulator", 140 "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
141 userInfo.UserProfile.Name, userInfo.UserProfile.ID); 141 userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
142 } 142 }
143 } 143 }
144 } 144 }
@@ -150,11 +150,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
150 { 150 {
151 if (m_scenes.Count > 0) 151 if (m_scenes.Count > 0)
152 { 152 {
153 CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass); 153 UserAccount userInfo = GetUserInfo(firstName, lastName, pass);
154 154
155 if (userInfo != null) 155 if (userInfo != null)
156 { 156 {
157 if (CheckPresence(userInfo.UserProfile.ID)) 157 if (CheckPresence(userInfo.PrincipalID))
158 { 158 {
159 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(); 159 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute();
160 return true; 160 return true;
@@ -162,8 +162,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
162 else 162 else
163 { 163 {
164 m_log.ErrorFormat( 164 m_log.ErrorFormat(
165 "[INVENTORY ARCHIVER]: User {0} {1} not logged in to this region simulator", 165 "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
166 userInfo.UserProfile.Name, userInfo.UserProfile.ID); 166 userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
167 } 167 }
168 } 168 }
169 } 169 }
@@ -175,11 +175,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
175 { 175 {
176 if (m_scenes.Count > 0) 176 if (m_scenes.Count > 0)
177 { 177 {
178 CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass); 178 UserAccount userInfo = GetUserInfo(firstName, lastName, pass);
179 179
180 if (userInfo != null) 180 if (userInfo != null)
181 { 181 {
182 if (CheckPresence(userInfo.UserProfile.ID)) 182 if (CheckPresence(userInfo.PrincipalID))
183 { 183 {
184 InventoryArchiveReadRequest request = 184 InventoryArchiveReadRequest request =
185 new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream); 185 new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream);
@@ -190,8 +190,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
190 else 190 else
191 { 191 {
192 m_log.ErrorFormat( 192 m_log.ErrorFormat(
193 "[INVENTORY ARCHIVER]: User {0} {1} not logged in to this region simulator", 193 "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
194 userInfo.UserProfile.Name, userInfo.UserProfile.ID); 194 userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
195 } 195 }
196 } 196 }
197 } 197 }
@@ -203,11 +203,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
203 { 203 {
204 if (m_scenes.Count > 0) 204 if (m_scenes.Count > 0)
205 { 205 {
206 CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass); 206 UserAccount userInfo = GetUserInfo(firstName, lastName, pass);
207 207
208 if (userInfo != null) 208 if (userInfo != null)
209 { 209 {
210 if (CheckPresence(userInfo.UserProfile.ID)) 210 if (CheckPresence(userInfo.PrincipalID))
211 { 211 {
212 InventoryArchiveReadRequest request = 212 InventoryArchiveReadRequest request =
213 new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath); 213 new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath);
@@ -218,8 +218,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
218 else 218 else
219 { 219 {
220 m_log.ErrorFormat( 220 m_log.ErrorFormat(
221 "[INVENTORY ARCHIVER]: User {0} {1} not logged in to this region simulator", 221 "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
222 userInfo.UserProfile.Name, userInfo.UserProfile.ID); 222 userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
223 } 223 }
224 } 224 }
225 } 225 }
@@ -291,7 +291,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
291 } 291 }
292 292
293 private void SaveInvConsoleCommandCompleted( 293 private void SaveInvConsoleCommandCompleted(
294 Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, 294 Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
295 Exception reportedException) 295 Exception reportedException)
296 { 296 {
297 lock (m_pendingConsoleSaves) 297 lock (m_pendingConsoleSaves)
@@ -304,13 +304,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
304 304
305 if (succeeded) 305 if (succeeded)
306 { 306 {
307 m_log.InfoFormat("[INVENTORY ARCHIVER]: Saved archive for {0}", userInfo.UserProfile.Name); 307 m_log.InfoFormat("[INVENTORY ARCHIVER]: Saved archive for {0} {1}", userInfo.FirstName, userInfo.LastName);
308 } 308 }
309 else 309 else
310 { 310 {
311 m_log.ErrorFormat( 311 m_log.ErrorFormat(
312 "[INVENTORY ARCHIVER]: Archive save for {0} failed - {1}", 312 "[INVENTORY ARCHIVER]: Archive save for {0} {1} failed - {2}",
313 userInfo.UserProfile.Name, reportedException.Message); 313 userInfo.FirstName, userInfo.LastName, reportedException.Message);
314 } 314 }
315 } 315 }
316 316
@@ -321,11 +321,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
321 /// <param name="lastName"></param> 321 /// <param name="lastName"></param>
322 /// <param name="pass">User password</param> 322 /// <param name="pass">User password</param>
323 /// <returns></returns> 323 /// <returns></returns>
324 protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass) 324 protected UserAccount GetUserInfo(string firstName, string lastName, string pass)
325 { 325 {
326 CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName); 326 UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, firstName, lastName);
327 //m_aScene.CommsManager.UserService.GetUserProfile(firstName, lastName); 327 if (null == account)
328 if (null == userInfo)
329 { 328 {
330 m_log.ErrorFormat( 329 m_log.ErrorFormat(
331 "[INVENTORY ARCHIVER]: Failed to find user info for {0} {1}", 330 "[INVENTORY ARCHIVER]: Failed to find user info for {0} {1}",
@@ -335,9 +334,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
335 334
336 try 335 try
337 { 336 {
338 if (m_aScene.AuthenticationService.Authenticate(userInfo.UserProfile.ID, pass, 1) != string.Empty) 337 if (m_aScene.AuthenticationService.Authenticate(account.PrincipalID, pass, 1) != string.Empty)
339 { 338 {
340 return userInfo; 339 return account;
341 } 340 }
342 else 341 else
343 { 342 {
@@ -358,14 +357,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
358 /// Notify the client of loaded nodes if they are logged in 357 /// Notify the client of loaded nodes if they are logged in
359 /// </summary> 358 /// </summary>
360 /// <param name="loadedNodes">Can be empty. In which case, nothing happens</param> 359 /// <param name="loadedNodes">Can be empty. In which case, nothing happens</param>
361 private void UpdateClientWithLoadedNodes(CachedUserInfo userInfo, List<InventoryNodeBase> loadedNodes) 360 private void UpdateClientWithLoadedNodes(UserAccount userInfo, List<InventoryNodeBase> loadedNodes)
362 { 361 {
363 if (loadedNodes.Count == 0) 362 if (loadedNodes.Count == 0)
364 return; 363 return;
365 364
366 foreach (Scene scene in m_scenes.Values) 365 foreach (Scene scene in m_scenes.Values)
367 { 366 {
368 ScenePresence user = scene.GetScenePresence(userInfo.UserProfile.ID); 367 ScenePresence user = scene.GetScenePresence(userInfo.PrincipalID);
369 368
370 if (user != null && !user.IsChildAgent) 369 if (user != null && !user.IsChildAgent)
371 { 370 {