aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/LLLoginService
diff options
context:
space:
mode:
authorDiva Canto2010-01-01 21:12:46 -0800
committerDiva Canto2010-01-01 21:12:46 -0800
commit8a9677a5319793ff630d0761e204ae8961f375aa (patch)
tree0b92d2c9258383df59866945ebad7ba8479563d0 /OpenSim/Services/LLLoginService
parentForgotten modules in prior commit. (diff)
downloadopensim-SC-8a9677a5319793ff630d0761e204ae8961f375aa.zip
opensim-SC-8a9677a5319793ff630d0761e204ae8961f375aa.tar.gz
opensim-SC-8a9677a5319793ff630d0761e204ae8961f375aa.tar.bz2
opensim-SC-8a9677a5319793ff630d0761e204ae8961f375aa.tar.xz
The Library Service is now working. UserProfileCacheService.LibraryRoot is obsolete. Didn't delete it yet to avoid merge conflicts later -- want to stay out of core as much as possible.
Diffstat (limited to 'OpenSim/Services/LLLoginService')
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs34
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs24
2 files changed, 38 insertions, 20 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index c80ab7f..4db6a05 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -215,12 +215,12 @@ namespace OpenSim.Services.LLLoginService
215 } 215 }
216 216
217 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, PresenceInfo pinfo, 217 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, PresenceInfo pinfo,
218 GridRegion destination, List<InventoryFolderBase> invSkel, 218 GridRegion destination, List<InventoryFolderBase> invSkel, ILibraryService libService,
219 string where, string startlocation, Vector3 position, Vector3 lookAt, string message, 219 string where, string startlocation, Vector3 position, Vector3 lookAt, string message,
220 GridRegion home, IPEndPoint clientIP) 220 GridRegion home, IPEndPoint clientIP)
221 : this() 221 : this()
222 { 222 {
223 FillOutInventoryData(invSkel); 223 FillOutInventoryData(invSkel, libService);
224 224
225 CircuitCode = (int)aCircuit.circuitcode; 225 CircuitCode = (int)aCircuit.circuitcode;
226 Lastname = account.LastName; 226 Lastname = account.LastName;
@@ -243,7 +243,7 @@ namespace OpenSim.Services.LLLoginService
243 243
244 } 244 }
245 245
246 private void FillOutInventoryData(List<InventoryFolderBase> invSkel) 246 private void FillOutInventoryData(List<InventoryFolderBase> invSkel, ILibraryService libService)
247 { 247 {
248 InventoryData inventData = null; 248 InventoryData inventData = null;
249 249
@@ -272,13 +272,16 @@ namespace OpenSim.Services.LLLoginService
272 } 272 }
273 273
274 // Inventory Library Section 274 // Inventory Library Section
275 Hashtable InventoryLibRootHash = new Hashtable(); 275 if (libService != null && libService.LibraryRootFolder != null)
276 InventoryLibRootHash["folder_id"] = "00000112-000f-0000-0000-000100bba000"; 276 {
277 InventoryLibRoot = new ArrayList(); 277 Hashtable InventoryLibRootHash = new Hashtable();
278 InventoryLibRoot.Add(InventoryLibRootHash); 278 InventoryLibRootHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
279 InventoryLibRoot = new ArrayList();
280 InventoryLibRoot.Add(InventoryLibRootHash);
279 281
280 InventoryLibraryOwner = GetLibraryOwner(); 282 InventoryLibraryOwner = GetLibraryOwner(libService.LibraryRootFolder);
281 InventoryLibrary = GetInventoryLibrary(); 283 InventoryLibrary = GetInventoryLibrary(libService);
284 }
282 } 285 }
283 286
284 private void FillOutHomeData(PresenceInfo pinfo, GridRegion home) 287 private void FillOutHomeData(PresenceInfo pinfo, GridRegion home)
@@ -646,12 +649,11 @@ namespace OpenSim.Services.LLLoginService
646 /// Converts the inventory library skeleton into the form required by the rpc request. 649 /// Converts the inventory library skeleton into the form required by the rpc request.
647 /// </summary> 650 /// </summary>
648 /// <returns></returns> 651 /// <returns></returns>
649 protected virtual ArrayList GetInventoryLibrary() 652 protected virtual ArrayList GetInventoryLibrary(ILibraryService library)
650 { 653 {
651 // While we don't have library... 654 Dictionary<UUID, InventoryFolderImpl> rootFolders = library.GetAllFolders();
652 //Dictionary<UUID, InventoryFolderImpl> rootFolders 655 m_log.DebugFormat("[LLOGIN]: Library has {0} folders", rootFolders.Count);
653 // = m_libraryRootFolder.RequestSelfAndDescendentFolders(); 656 //Dictionary<UUID, InventoryFolderImpl> rootFolders = new Dictionary<UUID,InventoryFolderImpl>();
654 Dictionary<UUID, InventoryFolderImpl> rootFolders = new Dictionary<UUID,InventoryFolderImpl>();
655 ArrayList folderHashes = new ArrayList(); 657 ArrayList folderHashes = new ArrayList();
656 658
657 foreach (InventoryFolderBase folder in rootFolders.Values) 659 foreach (InventoryFolderBase folder in rootFolders.Values)
@@ -672,11 +674,11 @@ namespace OpenSim.Services.LLLoginService
672 /// 674 ///
673 /// </summary> 675 /// </summary>
674 /// <returns></returns> 676 /// <returns></returns>
675 protected virtual ArrayList GetLibraryOwner() 677 protected virtual ArrayList GetLibraryOwner(InventoryFolderImpl libFolder)
676 { 678 {
677 //for now create random inventory library owner 679 //for now create random inventory library owner
678 Hashtable TempHash = new Hashtable(); 680 Hashtable TempHash = new Hashtable();
679 TempHash["agent_id"] = "11111111-1111-0000-0000-000100bba000"; 681 TempHash["agent_id"] = "11111111-1111-0000-0000-000100bba000"; // libFolder.Owner
680 ArrayList inventoryLibOwner = new ArrayList(); 682 ArrayList inventoryLibOwner = new ArrayList();
681 inventoryLibOwner.Add(TempHash); 683 inventoryLibOwner.Add(TempHash);
682 return inventoryLibOwner; 684 return inventoryLibOwner;
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 58038cb..2b74539 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -26,13 +26,14 @@ namespace OpenSim.Services.LLLoginService
26 private IGridService m_GridService; 26 private IGridService m_GridService;
27 private IPresenceService m_PresenceService; 27 private IPresenceService m_PresenceService;
28 private ISimulationService m_LocalSimulationService; 28 private ISimulationService m_LocalSimulationService;
29 private ILibraryService m_LibraryService;
29 30
30 private string m_DefaultRegionName; 31 private string m_DefaultRegionName;
31 private string m_RemoteSimulationDll; 32 private string m_RemoteSimulationDll;
32 private string m_WelcomeMessage; 33 private string m_WelcomeMessage;
33 private bool m_RequireInventory; 34 private bool m_RequireInventory;
34 35
35 public LLLoginService(IConfigSource config, ISimulationService simService) 36 public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService)
36 { 37 {
37 IConfig serverConfig = config.Configs["LoginService"]; 38 IConfig serverConfig = config.Configs["LoginService"];
38 if (serverConfig == null) 39 if (serverConfig == null)
@@ -43,13 +44,14 @@ namespace OpenSim.Services.LLLoginService
43 string invService = serverConfig.GetString("InventoryService", String.Empty); 44 string invService = serverConfig.GetString("InventoryService", String.Empty);
44 string gridService = serverConfig.GetString("GridService", String.Empty); 45 string gridService = serverConfig.GetString("GridService", String.Empty);
45 string presenceService = serverConfig.GetString("PresenceService", String.Empty); 46 string presenceService = serverConfig.GetString("PresenceService", String.Empty);
47 string libService = serverConfig.GetString("LibraryService", String.Empty);
46 48
47 m_DefaultRegionName = serverConfig.GetString("DefaultRegion", String.Empty); 49 m_DefaultRegionName = serverConfig.GetString("DefaultRegion", String.Empty);
48 m_RemoteSimulationDll = serverConfig.GetString("RemoteSimulationService", String.Empty); 50 m_RemoteSimulationDll = serverConfig.GetString("RemoteSimulationService", String.Empty);
49 m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); 51 m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
50 m_RequireInventory = serverConfig.GetBoolean("RequireInventory", true); 52 m_RequireInventory = serverConfig.GetBoolean("RequireInventory", true);
51 53
52 // These 3 are required; the other 2 aren't 54 // These 3 are required; the others aren't
53 if (accountService == string.Empty || authService == string.Empty || 55 if (accountService == string.Empty || authService == string.Empty ||
54 invService == string.Empty) 56 invService == string.Empty)
55 throw new Exception("LoginService is missing service specifications"); 57 throw new Exception("LoginService is missing service specifications");
@@ -62,13 +64,27 @@ namespace OpenSim.Services.LLLoginService
62 m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); 64 m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
63 if (presenceService != string.Empty) 65 if (presenceService != string.Empty)
64 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); 66 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
67
68 //
69 // deal with the services given as argument
70 //
65 m_LocalSimulationService = simService; 71 m_LocalSimulationService = simService;
72 if (libraryService != null)
73 {
74 m_log.DebugFormat("[LLOGIN SERVICE]: Using LibraryService given as argument");
75 m_LibraryService = libraryService;
76 }
77 else if (libService != string.Empty)
78 {
79 m_log.DebugFormat("[LLOGIN SERVICE]: Using instantiated LibraryService");
80 m_LibraryService = ServerUtils.LoadPlugin<ILibraryService>(libService, args);
81 }
66 82
67 m_log.DebugFormat("[LLOGIN SERVICE]: Starting..."); 83 m_log.DebugFormat("[LLOGIN SERVICE]: Starting...");
68 84
69 } 85 }
70 86
71 public LLLoginService(IConfigSource config) : this(config, null) 87 public LLLoginService(IConfigSource config) : this(config, null, null)
72 { 88 {
73 } 89 }
74 90
@@ -171,7 +187,7 @@ namespace OpenSim.Services.LLLoginService
171 // TODO: Get Friends list... 187 // TODO: Get Friends list...
172 188
173 // Finally, fill out the response and return it 189 // Finally, fill out the response and return it
174 LLLoginResponse response = new LLLoginResponse(account, aCircuit, presence, destination, inventorySkel, 190 LLLoginResponse response = new LLLoginResponse(account, aCircuit, presence, destination, inventorySkel, m_LibraryService,
175 where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP); 191 where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP);
176 192
177 return response; 193 return response;