diff options
author | Justin Clarke Casey | 2008-07-24 17:10:07 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-07-24 17:10:07 +0000 |
commit | 918c0a482663cbda9f75901e894d463b7f7c2b0b (patch) | |
tree | efebc66be58f9fd5683bf7ade1ba8dd2aace2658 /OpenSim/Grid/UserServer/UserLoginService.cs | |
parent | * minor: eliminate warnings from LindenUDP (diff) | |
download | opensim-SC_OLD-918c0a482663cbda9f75901e894d463b7f7c2b0b.zip opensim-SC_OLD-918c0a482663cbda9f75901e894d463b7f7c2b0b.tar.gz opensim-SC_OLD-918c0a482663cbda9f75901e894d463b7f7c2b0b.tar.bz2 opensim-SC_OLD-918c0a482663cbda9f75901e894d463b7f7c2b0b.tar.xz |
* refactor: move remaining user service -> inventory service OGS1 calls into the specific inter service class
Diffstat (limited to 'OpenSim/Grid/UserServer/UserLoginService.cs')
-rw-r--r-- | OpenSim/Grid/UserServer/UserLoginService.cs | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 78f6e7c..6575b13 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -46,6 +46,8 @@ namespace OpenSim.Grid.UserServer | |||
46 | public class UserLoginService : LoginService | 46 | public class UserLoginService : LoginService |
47 | { | 47 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | |||
50 | protected IInterServiceInventoryServices m_inventoryService; | ||
49 | 51 | ||
50 | public event UserLoggedInAtLocation OnUserLoggedInAtLocation; | 52 | public event UserLoggedInAtLocation OnUserLoggedInAtLocation; |
51 | 53 | ||
@@ -54,12 +56,14 @@ namespace OpenSim.Grid.UserServer | |||
54 | public UserConfig m_config; | 56 | public UserConfig m_config; |
55 | 57 | ||
56 | public UserLoginService( | 58 | public UserLoginService( |
57 | UserManagerBase userManager, LibraryRootFolder libraryRootFolder, | 59 | UserManagerBase userManager, IInterServiceInventoryServices inventoryService, LibraryRootFolder libraryRootFolder, |
58 | UserConfig config, string welcomeMess) | 60 | UserConfig config, string welcomeMess) |
59 | : base(userManager, libraryRootFolder, welcomeMess) | 61 | : base(userManager, libraryRootFolder, welcomeMess) |
60 | { | 62 | { |
61 | m_config = config; | 63 | m_config = config; |
64 | m_inventoryService = inventoryService; | ||
62 | } | 65 | } |
66 | |||
63 | public override void LogOffUser(UserProfileData theUser, string message) | 67 | public override void LogOffUser(UserProfileData theUser, string message) |
64 | { | 68 | { |
65 | RegionProfileData SimInfo = null; | 69 | RegionProfileData SimInfo = null; |
@@ -96,6 +100,7 @@ namespace OpenSim.Grid.UserServer | |||
96 | m_log.InfoFormat( | 100 | m_log.InfoFormat( |
97 | "[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}", | 101 | "[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}", |
98 | SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI, theUser.FirstName + " " + theUser.SurName); | 102 | SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI, theUser.FirstName + " " + theUser.SurName); |
103 | |||
99 | try | 104 | try |
100 | { | 105 | { |
101 | XmlRpcRequest GridReq = new XmlRpcRequest("logoff_user", SendParams); | 106 | XmlRpcRequest GridReq = new XmlRpcRequest("logoff_user", SendParams); |
@@ -420,20 +425,12 @@ namespace OpenSim.Grid.UserServer | |||
420 | 425 | ||
421 | // See LoginService | 426 | // See LoginService |
422 | protected override InventoryData GetInventorySkeleton(LLUUID userID, string serverUrl) | 427 | protected override InventoryData GetInventorySkeleton(LLUUID userID, string serverUrl) |
423 | { | 428 | { |
424 | string invUrl = m_config.InventoryUrl; | ||
425 | //if (!String.IsNullOrEmpty(serverUrl)) | ||
426 | //{ | ||
427 | // invUrl = serverUrl+"/"; | ||
428 | //} | ||
429 | |||
430 | m_log.DebugFormat( | 429 | m_log.DebugFormat( |
431 | "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", | 430 | "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", |
432 | m_config.InventoryUrl, userID); | 431 | m_config.InventoryUrl, userID); |
433 | 432 | ||
434 | List<InventoryFolderBase> folders | 433 | List<InventoryFolderBase> folders = m_inventoryService.GetInventorySkeleton(userID); |
435 | = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( | ||
436 | "POST", invUrl + "RootFolders/", userID.UUID); | ||
437 | 434 | ||
438 | if (null == folders || folders.Count == 0) | 435 | if (null == folders || folders.Count == 0) |
439 | { | 436 | { |
@@ -444,11 +441,7 @@ namespace OpenSim.Grid.UserServer | |||
444 | // tools are creating the user profile directly in the database without creating the inventory. At | 441 | // tools are creating the user profile directly in the database without creating the inventory. At |
445 | // this time we'll accomodate them by lazily creating the user inventory now if it doesn't already | 442 | // this time we'll accomodate them by lazily creating the user inventory now if it doesn't already |
446 | // exist. | 443 | // exist. |
447 | bool created = | 444 | if (!m_inventoryService.CreateNewUserInventory(userID)) |
448 | SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( | ||
449 | "POST", invUrl + "CreateInventory/", userID.UUID); | ||
450 | |||
451 | if (!created) | ||
452 | { | 445 | { |
453 | throw new Exception( | 446 | throw new Exception( |
454 | String.Format( | 447 | String.Format( |
@@ -461,8 +454,7 @@ namespace OpenSim.Grid.UserServer | |||
461 | m_log.InfoFormat("[LOGIN]: A new inventory skeleton was successfully created for user {0}", userID); | 454 | m_log.InfoFormat("[LOGIN]: A new inventory skeleton was successfully created for user {0}", userID); |
462 | } | 455 | } |
463 | 456 | ||
464 | folders = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( | 457 | folders = m_inventoryService.GetInventorySkeleton(userID); |
465 | "POST", invUrl + "RootFolders/", userID.UUID); | ||
466 | } | 458 | } |
467 | 459 | ||
468 | if (folders != null && folders.Count > 0) | 460 | if (folders != null && folders.Count > 0) |