aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authordiva2009-06-11 03:00:25 +0000
committerdiva2009-06-11 03:00:25 +0000
commit156604e28e51d0a7e0c8018ce10eb517a9123ce4 (patch)
tree5274ef45eb20c76d80c4b1157ee659e3497e5b67 /OpenSim
parentRemoved a change in StandaloneHypergrid.ini introduced in r9838, which was in... (diff)
downloadopensim-SC-156604e28e51d0a7e0c8018ce10eb517a9123ce4.zip
opensim-SC-156604e28e51d0a7e0c8018ce10eb517a9123ce4.tar.gz
opensim-SC-156604e28e51d0a7e0c8018ce10eb517a9123ce4.tar.bz2
opensim-SC-156604e28e51d0a7e0c8018ce10eb517a9123ce4.tar.xz
InterServiceInventoryService references *almost* completely removed from the simulator. Only a couple left, not important. Also updated the login tests -- Justin, this time I was able to fix this by myself :)
Diffstat (limited to '')
-rw-r--r--OpenSim/Client/Linden/LLStandaloneLoginModule.cs2
-rw-r--r--OpenSim/Client/Linden/LLStandaloneLoginService.cs5
-rw-r--r--OpenSim/Framework/Communications/Services/HGLoginAuthService.cs2
-rw-r--r--OpenSim/Framework/Communications/Services/LoginService.cs27
-rw-r--r--OpenSim/Framework/Communications/Tests/LoginServiceTests.cs125
-rw-r--r--OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs2
-rw-r--r--OpenSim/Grid/UserServer.Modules/UserLoginService.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectors/Inventory/HGInventoryBroker.cs2
8 files changed, 153 insertions, 14 deletions
diff --git a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs
index 6474feb..bfafdc3 100644
--- a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs
+++ b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs
@@ -111,7 +111,7 @@ namespace OpenSim.Client.Linden
111 IHttpServer httpServer = m_firstScene.CommsManager.HttpServer; 111 IHttpServer httpServer = m_firstScene.CommsManager.HttpServer;
112 112
113 //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference 113 //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference
114 m_loginService = new LLStandaloneLoginService((UserManagerBase)m_firstScene.CommsManager.UserAdminService, welcomeMessage, m_firstScene.CommsManager.InterServiceInventoryService, m_firstScene.CommsManager.NetworkServersInfo, authenticate, rootFolder, this); 114 m_loginService = new LLStandaloneLoginService((UserManagerBase)m_firstScene.CommsManager.UserAdminService, welcomeMessage, m_firstScene.InventoryService, m_firstScene.CommsManager.NetworkServersInfo, authenticate, rootFolder, this);
115 115
116 httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); 116 httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);
117 117
diff --git a/OpenSim/Client/Linden/LLStandaloneLoginService.cs b/OpenSim/Client/Linden/LLStandaloneLoginService.cs
index 6b217e6..c2de348 100644
--- a/OpenSim/Client/Linden/LLStandaloneLoginService.cs
+++ b/OpenSim/Client/Linden/LLStandaloneLoginService.cs
@@ -42,6 +42,7 @@ using OpenSim.Framework.Communications.Capabilities;
42using OpenSim.Framework.Servers; 42using OpenSim.Framework.Servers;
43using OpenSim.Region.Framework.Scenes; 43using OpenSim.Region.Framework.Scenes;
44using OpenSim.Region.Framework.Interfaces; 44using OpenSim.Region.Framework.Interfaces;
45using OpenSim.Services.Interfaces;
45 46
46namespace OpenSim.Client.Linden 47namespace OpenSim.Client.Linden
47{ 48{
@@ -59,7 +60,7 @@ namespace OpenSim.Client.Linden
59 60
60 public LLStandaloneLoginService( 61 public LLStandaloneLoginService(
61 UserManagerBase userManager, string welcomeMess, 62 UserManagerBase userManager, string welcomeMess,
62 IInterServiceInventoryServices interServiceInventoryService, 63 IInventoryService interServiceInventoryService,
63 NetworkServersInfo serversInfo, 64 NetworkServersInfo serversInfo,
64 bool authenticate, LibraryRootFolder libraryRootFolder, ILoginServiceToRegionsConnector regionsConnector) 65 bool authenticate, LibraryRootFolder libraryRootFolder, ILoginServiceToRegionsConnector regionsConnector)
65 : base(userManager, libraryRootFolder, welcomeMess) 66 : base(userManager, libraryRootFolder, welcomeMess)
@@ -69,7 +70,7 @@ namespace OpenSim.Client.Linden
69 m_defaultHomeY = this.m_serversInfo.DefaultHomeLocY; 70 m_defaultHomeY = this.m_serversInfo.DefaultHomeLocY;
70 m_authUsers = authenticate; 71 m_authUsers = authenticate;
71 72
72 m_inventoryService = interServiceInventoryService; 73 m_InventoryService = interServiceInventoryService;
73 m_regionsConnector = regionsConnector; 74 m_regionsConnector = regionsConnector;
74 // Standard behavior: In StandAlone, silent logout of last hung session 75 // Standard behavior: In StandAlone, silent logout of last hung session
75 m_warn_already_logged = false; 76 m_warn_already_logged = false;
diff --git a/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs b/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs
index 0637a1e..8e0205c 100644
--- a/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs
+++ b/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs
@@ -78,7 +78,7 @@ namespace OpenSim.Framework.Communications.Services
78 78
79 m_interServiceInventoryService = interServiceInventoryService; 79 m_interServiceInventoryService = interServiceInventoryService;
80 m_regionsConnector = regionsConnector; 80 m_regionsConnector = regionsConnector;
81 m_inventoryService = interServiceInventoryService; 81 m_interInventoryService = interServiceInventoryService;
82 } 82 }
83 83
84 public void SetServersInfo(NetworkServersInfo sinfo) 84 public void SetServersInfo(NetworkServersInfo sinfo)
diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs
index 900a3d9..7eb98d7 100644
--- a/OpenSim/Framework/Communications/Services/LoginService.cs
+++ b/OpenSim/Framework/Communications/Services/LoginService.cs
@@ -41,6 +41,7 @@ using OpenMetaverse.StructuredData;
41using OpenSim.Framework; 41using OpenSim.Framework;
42using OpenSim.Framework.Communications.Cache; 42using OpenSim.Framework.Communications.Cache;
43using OpenSim.Framework.Statistics; 43using OpenSim.Framework.Statistics;
44using OpenSim.Services.Interfaces;
44 45
45namespace OpenSim.Framework.Communications.Services 46namespace OpenSim.Framework.Communications.Services
46{ 47{
@@ -66,7 +67,9 @@ namespace OpenSim.Framework.Communications.Services
66 /// <summary> 67 /// <summary>
67 /// Used by the login service to make requests to the inventory service. 68 /// Used by the login service to make requests to the inventory service.
68 /// </summary> 69 /// </summary>
69 protected IInterServiceInventoryServices m_inventoryService; 70 protected IInterServiceInventoryServices m_interInventoryService;
71 // Hack
72 protected IInventoryService m_InventoryService;
70 73
71 /// <summary> 74 /// <summary>
72 /// Constructor 75 /// Constructor
@@ -1047,7 +1050,10 @@ namespace OpenSim.Framework.Communications.Services
1047 List<InventoryItemBase> gestures = null; 1050 List<InventoryItemBase> gestures = null;
1048 try 1051 try
1049 { 1052 {
1050 gestures = m_inventoryService.GetActiveGestures(theUser.ID); 1053 if (m_InventoryService != null)
1054 gestures = m_InventoryService.GetActiveGestures(theUser.ID);
1055 else
1056 gestures = m_interInventoryService.GetActiveGestures(theUser.ID);
1051 } 1057 }
1052 catch (Exception e) 1058 catch (Exception e)
1053 { 1059 {
@@ -1076,7 +1082,15 @@ namespace OpenSim.Framework.Communications.Services
1076 /// <exception cref='System.Exception'>This will be thrown if there is a problem with the inventory service</exception> 1082 /// <exception cref='System.Exception'>This will be thrown if there is a problem with the inventory service</exception>
1077 protected InventoryData GetInventorySkeleton(UUID userID) 1083 protected InventoryData GetInventorySkeleton(UUID userID)
1078 { 1084 {
1079 List<InventoryFolderBase> folders = m_inventoryService.GetInventorySkeleton(userID); 1085 List<InventoryFolderBase> folders = null;
1086 if (m_InventoryService != null)
1087 {
1088 folders = m_InventoryService.GetInventorySkeleton(userID);
1089 }
1090 else
1091 {
1092 folders = m_interInventoryService.GetInventorySkeleton(userID);
1093 }
1080 1094
1081 // If we have user auth but no inventory folders for some reason, create a new set of folders. 1095 // If we have user auth but no inventory folders for some reason, create a new set of folders.
1082 if (folders == null || folders.Count == 0) 1096 if (folders == null || folders.Count == 0)
@@ -1088,7 +1102,7 @@ namespace OpenSim.Framework.Communications.Services
1088 // tools are creating the user profile directly in the database without creating the inventory. At 1102 // tools are creating the user profile directly in the database without creating the inventory. At
1089 // this time we'll accomodate them by lazily creating the user inventory now if it doesn't already 1103 // this time we'll accomodate them by lazily creating the user inventory now if it doesn't already
1090 // exist. 1104 // exist.
1091 if (!m_inventoryService.CreateNewUserInventory(userID)) 1105 if ((m_interInventoryService != null) && !m_interInventoryService.CreateNewUserInventory(userID))
1092 { 1106 {
1093 throw new Exception( 1107 throw new Exception(
1094 String.Format( 1108 String.Format(
@@ -1099,7 +1113,10 @@ namespace OpenSim.Framework.Communications.Services
1099 1113
1100 m_log.InfoFormat("[LOGIN]: A new inventory skeleton was successfully created for user {0}", userID); 1114 m_log.InfoFormat("[LOGIN]: A new inventory skeleton was successfully created for user {0}", userID);
1101 1115
1102 folders = m_inventoryService.GetInventorySkeleton(userID); 1116 if (m_InventoryService != null)
1117 folders = m_InventoryService.GetInventorySkeleton(userID);
1118 else
1119 folders = m_interInventoryService.GetInventorySkeleton(userID);
1103 1120
1104 if (folders == null || folders.Count == 0) 1121 if (folders == null || folders.Count == 0)
1105 { 1122 {
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
index 7a622ad..d637ef0 100644
--- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
@@ -39,6 +39,8 @@ using OpenSim.Region.Communications.Local;
39using OpenSim.Tests.Common.Mock; 39using OpenSim.Tests.Common.Mock;
40using OpenSim.Client.Linden; 40using OpenSim.Client.Linden;
41using OpenSim.Tests.Common; 41using OpenSim.Tests.Common;
42using OpenSim.Services.Interfaces;
43using OpenMetaverse;
42 44
43namespace OpenSim.Framework.Communications.Tests 45namespace OpenSim.Framework.Communications.Tests
44{ 46{
@@ -73,7 +75,7 @@ namespace OpenSim.Framework.Communications.Tests
73 m_localUserServices = (LocalUserServices) m_commsManager.UserService; 75 m_localUserServices = (LocalUserServices) m_commsManager.UserService;
74 m_localUserServices.AddUser(m_firstName,m_lastName,"boingboing","abc@ftw.com",42,43); 76 m_localUserServices.AddUser(m_firstName,m_lastName,"boingboing","abc@ftw.com",42,43);
75 77
76 m_loginService = new LLStandaloneLoginService((UserManagerBase) m_localUserServices, "Hello folks", m_commsManager.InterServiceInventoryService, 78 m_loginService = new LLStandaloneLoginService((UserManagerBase) m_localUserServices, "Hello folks", new TestInventoryService(),
77 m_commsManager.NetworkServersInfo, true, new LibraryRootFolder(String.Empty), m_regionConnector); 79 m_commsManager.NetworkServersInfo, true, new LibraryRootFolder(String.Empty), m_regionConnector);
78 80
79 m_userProfileData = m_localUserServices.GetUserProfile(m_firstName, m_lastName); 81 m_userProfileData = m_localUserServices.GetUserProfile(m_firstName, m_lastName);
@@ -88,7 +90,7 @@ namespace OpenSim.Framework.Communications.Tests
88 TestHelper.InMethod(); 90 TestHelper.InMethod();
89 // We want to use our own LoginService for this test, one that 91 // We want to use our own LoginService for this test, one that
90 // doesn't require authentication. 92 // doesn't require authentication.
91 LoginService loginService = new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", m_commsManager.InterServiceInventoryService, 93 LoginService loginService = new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", new TestInventoryService(),
92 m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector); 94 m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector);
93 95
94 Hashtable loginParams = new Hashtable(); 96 Hashtable loginParams = new Hashtable();
@@ -440,4 +442,123 @@ namespace OpenSim.Framework.Communications.Tests
440 #endregion 442 #endregion
441 } 443 }
442 } 444 }
445
446 class TestInventoryService : IInventoryService
447 {
448 public TestInventoryService()
449 {
450 }
451
452 /// <summary>
453 /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
454 /// </summary>
455 /// <param name="userId"></param>
456 /// <returns></returns>
457 public bool CreateUserInventory(UUID userId)
458 {
459 return false;
460 }
461
462 /// <summary>
463 /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
464 /// </summary>
465 /// <param name="userId"></param>
466 /// <returns></returns>
467 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
468 {
469 List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
470 InventoryFolderBase folder = new InventoryFolderBase();
471 folder.ID = UUID.Random();
472 folder.Owner = userId;
473 folders.Add(folder);
474 return folders;
475 }
476
477 /// <summary>
478 /// Returns a list of all the active gestures in a user's inventory.
479 /// </summary>
480 /// <param name="userId">
481 /// The <see cref="UUID"/> of the user
482 /// </param>
483 /// <returns>
484 /// A flat list of the gesture items.
485 /// </returns>
486 public List<InventoryItemBase> GetActiveGestures(UUID userId)
487 {
488 return null;
489 }
490
491 public InventoryCollection GetUserInventory(UUID userID)
492 {
493 return null;
494 }
495
496 public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback)
497 {
498 }
499
500 public List<InventoryItemBase> GetFolderItems(UUID folderID)
501 {
502 return null;
503 }
504
505 public bool AddFolder(InventoryFolderBase folder)
506 {
507 return false;
508 }
509
510 public bool UpdateFolder(InventoryFolderBase folder)
511 {
512 return false;
513 }
514
515 public bool MoveFolder(InventoryFolderBase folder)
516 {
517 return false;
518 }
519
520 public bool PurgeFolder(InventoryFolderBase folder)
521 {
522 return false;
523 }
524
525 public bool AddItem(InventoryItemBase item)
526 {
527 return false;
528 }
529
530 public bool UpdateItem(InventoryItemBase item)
531 {
532 return false;
533 }
534
535 public bool DeleteItem(InventoryItemBase item)
536 {
537 return false;
538 }
539
540 public InventoryItemBase QueryItem(InventoryItemBase item)
541 {
542 return null;
543 }
544
545 public InventoryFolderBase QueryFolder(InventoryFolderBase folder)
546 {
547 return null;
548 }
549
550 public bool HasInventoryForUser(UUID userID)
551 {
552 return false;
553 }
554
555 public InventoryFolderBase RequestRootFolder(UUID userID)
556 {
557 InventoryFolderBase root = new InventoryFolderBase();
558 root.ID = UUID.Random();
559 root.Owner = userID;
560 root.ParentID = UUID.Zero;
561 return root;
562 }
563 }
443} 564}
diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs
index 30aea14..c4c82e5 100644
--- a/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs
+++ b/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Grid.UserServer.Modules
66 m_config = config; 66 m_config = config;
67 m_defaultHomeX = m_config.DefaultX; 67 m_defaultHomeX = m_config.DefaultX;
68 m_defaultHomeY = m_config.DefaultY; 68 m_defaultHomeY = m_config.DefaultY;
69 m_inventoryService = inventoryService; 69 m_interInventoryService = inventoryService;
70 m_regionProfileService = regionProfileService; 70 m_regionProfileService = regionProfileService;
71 71
72 NetworkServersInfo serversinfo = new NetworkServersInfo(1000, 1000); 72 NetworkServersInfo serversinfo = new NetworkServersInfo(1000, 1000);
diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs
index 122ad9d..dff6059 100644
--- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs
@@ -74,7 +74,7 @@ namespace OpenSim.Grid.UserServer.Modules
74 m_config = config; 74 m_config = config;
75 m_defaultHomeX = m_config.DefaultX; 75 m_defaultHomeX = m_config.DefaultX;
76 m_defaultHomeY = m_config.DefaultY; 76 m_defaultHomeY = m_config.DefaultY;
77 m_inventoryService = inventoryService; 77 m_interInventoryService = inventoryService;
78 m_regionProfileService = regionProfileService; 78 m_regionProfileService = regionProfileService;
79 } 79 }
80 80
diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/HGInventoryBroker.cs
index 03b4873..4d741a9 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/HGInventoryBroker.cs
@@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory
173 173
174 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) 174 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
175 { 175 {
176 return new List<InventoryFolderBase>(); 176 return m_GridService.GetInventorySkeleton(userId);
177 } 177 }
178 178
179 public InventoryCollection GetUserInventory(UUID userID) 179 public InventoryCollection GetUserInventory(UUID userID)