aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/LoginService.cs
diff options
context:
space:
mode:
authorlbsa712007-09-27 14:57:43 +0000
committerlbsa712007-09-27 14:57:43 +0000
commit863195612bdef56165f2b4354bab280c371618b9 (patch)
tree63cec15a6c0338a8777640ed13fd7c3ce05eeba7 /OpenSim/Framework/Communications/LoginService.cs
parentrevert change to libsecondlife.dll.config which breaks Linux (diff)
downloadopensim-SC_OLD-863195612bdef56165f2b4354bab280c371618b9.zip
opensim-SC_OLD-863195612bdef56165f2b4354bab280c371618b9.tar.gz
opensim-SC_OLD-863195612bdef56165f2b4354bab280c371618b9.tar.bz2
opensim-SC_OLD-863195612bdef56165f2b4354bab280c371618b9.tar.xz
Reverting back to 2017 since 2018 were causing Linux breakage; reopening Tleiades patch 444 and 445.
Diffstat (limited to 'OpenSim/Framework/Communications/LoginService.cs')
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs134
1 files changed, 79 insertions, 55 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 4e6aa80..8e7cf80 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -8,10 +8,11 @@ using Nwc.XmlRpc;
8using OpenSim.Framework.Console; 8using OpenSim.Framework.Console;
9using OpenSim.Framework.Data; 9using OpenSim.Framework.Data;
10using OpenSim.Framework.Interfaces; 10using OpenSim.Framework.Interfaces;
11using OpenSim.Framework.Inventory;
11using OpenSim.Framework.Utilities; 12using OpenSim.Framework.Utilities;
12using OpenSim.Framework.Communications;
13using OpenSim.Framework.Configuration;
14 13
14using OpenSim.Framework.Configuration;
15using InventoryFolder = OpenSim.Framework.Inventory.InventoryFolder;
15 16
16namespace OpenSim.Framework.UserManagement 17namespace OpenSim.Framework.UserManagement
17{ 18{
@@ -19,12 +20,10 @@ namespace OpenSim.Framework.UserManagement
19 { 20 {
20 protected string m_welcomeMessage = "Welcome to OpenSim"; 21 protected string m_welcomeMessage = "Welcome to OpenSim";
21 protected UserManagerBase m_userManager = null; 22 protected UserManagerBase m_userManager = null;
22 protected IInventoryServices m_inventoryServer = null;
23 23
24 public LoginService(UserManagerBase userManager, IInventoryServices inventoryServer, string welcomeMess) 24 public LoginService(UserManagerBase userManager, string welcomeMess)
25 { 25 {
26 m_userManager = userManager; 26 m_userManager = userManager;
27 m_inventoryServer = inventoryServer;
28 if (welcomeMess != "") 27 if (welcomeMess != "")
29 { 28 {
30 m_welcomeMessage = welcomeMess; 29 m_welcomeMessage = welcomeMess;
@@ -38,6 +37,7 @@ namespace OpenSim.Framework.UserManagement
38 /// <returns>The response to send</returns> 37 /// <returns>The response to send</returns>
39 public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) 38 public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
40 { 39 {
40
41 System.Console.WriteLine("Attempting login now..."); 41 System.Console.WriteLine("Attempting login now...");
42 XmlRpcResponse response = new XmlRpcResponse(); 42 XmlRpcResponse response = new XmlRpcResponse();
43 Hashtable requestData = (Hashtable)request.Params[0]; 43 Hashtable requestData = (Hashtable)request.Params[0];
@@ -85,41 +85,15 @@ namespace OpenSim.Framework.UserManagement
85 { 85 {
86 LLUUID agentID = userProfile.UUID; 86 LLUUID agentID = userProfile.UUID;
87 87
88 LLUUID libraryFolderID; 88 // Inventory Library Section
89 LLUUID personalFolderID; 89 InventoryData inventData = this.CreateInventoryData(agentID);
90 90 ArrayList AgentInventoryArray = inventData.InventoryArray;
91 m_inventoryServer.GetRootFoldersForUser(agentID, out libraryFolderID, out personalFolderID);
92 if (personalFolderID == LLUUID.Zero)
93 {
94 m_inventoryServer.CreateNewUserInventory(libraryFolderID, agentID);
95 m_inventoryServer.GetRootFoldersForUser(agentID, out libraryFolderID, out personalFolderID);
96 }
97
98 // The option "inventory-lib-owner" requires that we return the id of the
99 // owner of the library inventory.
100 Hashtable dynamicStruct = new Hashtable();
101 dynamicStruct["agent_id"] = libraryFolderID.ToStringHyphenated();
102 logResponse.InventoryLibraryOwner.Add(dynamicStruct);
103
104 // The option "inventory-lib-root" requires that we return the id of the
105 // root folder of the library inventory.
106 dynamicStruct = new Hashtable();
107 dynamicStruct["folder_id"] = libraryFolderID.ToStringHyphenated();
108 logResponse.InventoryLibraryRoot.Add(dynamicStruct);
109 91
110 // The option "inventory-root" requires that we return the id of the 92 Hashtable InventoryRootHash = new Hashtable();
111 // root folder of the users inventory. 93 InventoryRootHash["folder_id"] = inventData.RootFolderID.ToStringHyphenated();
112 dynamicStruct = new Hashtable(); 94 ArrayList InventoryRoot = new ArrayList();
113 dynamicStruct["folder_id"] = personalFolderID.ToStringHyphenated(); 95 InventoryRoot.Add(InventoryRootHash);
114 logResponse.InventoryRoot.Add(dynamicStruct); 96 userProfile.rootInventoryFolderID = inventData.RootFolderID;
115
116 // The option "inventory-skeleton" requires that we return the structure of the
117 // users folder hierachy
118 logResponse.InventorySkeleton = GetInventorySkeleton(personalFolderID);
119
120 // The option "inventory-skel-lib" requires that we return the structure of the
121 // library folder hierachy
122 logResponse.InventoryLibrarySkeleton = GetInventorySkeleton(libraryFolderID);
123 97
124 // Circuit Code 98 // Circuit Code
125 uint circode = (uint)(Util.RandomClass.Next()); 99 uint circode = (uint)(Util.RandomClass.Next());
@@ -129,6 +103,10 @@ namespace OpenSim.Framework.UserManagement
129 logResponse.AgentID = agentID.ToStringHyphenated(); 103 logResponse.AgentID = agentID.ToStringHyphenated();
130 logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated(); 104 logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated();
131 logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated(); 105 logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated();
106 logResponse.InventoryRoot = InventoryRoot;
107 logResponse.InventorySkeleton = AgentInventoryArray;
108 logResponse.InventoryLibrary = this.GetInventoryLibrary();
109 logResponse.InventoryLibraryOwner = this.GetLibraryOwner();
132 logResponse.CircuitCode = (Int32)circode; 110 logResponse.CircuitCode = (Int32)circode;
133 //logResponse.RegionX = 0; //overwritten 111 //logResponse.RegionX = 0; //overwritten
134 //logResponse.RegionY = 0; //overwritten 112 //logResponse.RegionY = 0; //overwritten
@@ -234,30 +212,76 @@ namespace OpenSim.Framework.UserManagement
234 } 212 }
235 213
236 /// <summary> 214 /// <summary>
237 /// Create a structure of the generic inventory structure of a specified folder 215 ///
216 /// </summary>
217 /// <returns></returns>
218 protected virtual ArrayList GetInventoryLibrary()
219 {
220 //return new ArrayList();
221 Hashtable TempHash = new Hashtable();
222 TempHash["name"] = "OpenSim Library";
223 TempHash["parent_id"] = LLUUID.Zero.ToStringHyphenated();
224 TempHash["version"] = 1;
225 TempHash["type_default"] = -1;
226 TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
227 ArrayList temp = new ArrayList();
228 temp.Add(TempHash);
229
230 TempHash = new Hashtable();
231 TempHash["name"] = "Texture Library";
232 TempHash["parent_id"] = "00000112-000f-0000-0000-000100bba000";
233 TempHash["version"] = 1;
234 TempHash["type_default"] = -1;
235 TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba001";
236 temp.Add(TempHash);
237 return temp;
238 }
239
240 /// <summary>
241 ///
238 /// </summary> 242 /// </summary>
239 /// <returns></returns> 243 /// <returns></returns>
240 protected virtual ArrayList GetInventorySkeleton(LLUUID folderID) 244 protected virtual ArrayList GetLibraryOwner()
241 { 245 {
246 //for now create random inventory library owner
247 Hashtable TempHash = new Hashtable();
248 TempHash["agent_id"] = "11111111-1111-0000-0000-000100bba000";
249 ArrayList inventoryLibOwner = new ArrayList();
250 inventoryLibOwner.Add(TempHash);
251 return inventoryLibOwner;
252 }
242 253
243 List<InventoryFolderBase> folders = m_inventoryServer.RequestFirstLevelFolders(folderID); 254 protected virtual InventoryData CreateInventoryData(LLUUID userID)
255 {
256 AgentInventory userInventory = new AgentInventory();
257 userInventory.CreateRootFolder(userID, false);
244 258
245 ArrayList temp = new ArrayList(); 259 ArrayList AgentInventoryArray = new ArrayList();
246 foreach (InventoryFolderBase ifb in folders) 260 Hashtable TempHash;
261 foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
247 { 262 {
248 LLUUID tempFolderID = ifb.folderID; 263 TempHash = new Hashtable();
249 LLUUID tempParentID = ifb.parentID; 264 TempHash["name"] = InvFolder.FolderName;
250 265 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
251 Hashtable TempHash = new Hashtable(); 266 TempHash["version"] = (Int32)InvFolder.Version;
252 TempHash["folder_id"] = tempFolderID.ToStringHyphenated(); 267 TempHash["type_default"] = (Int32)InvFolder.DefaultType;
253 TempHash["name"] = ifb.name; 268 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
254 TempHash["parent_id"] = tempParentID.ToStringHyphenated(); 269 AgentInventoryArray.Add(TempHash);
255 TempHash["type_default"] = (Int32)ifb.type;
256 TempHash["version"] = (Int32)ifb.version+1;
257 temp.Add(TempHash);
258 } 270 }
259 271
260 return temp; 272 return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
273 }
274
275 public class InventoryData
276 {
277 public ArrayList InventoryArray = null;
278 public LLUUID RootFolderID = LLUUID.Zero;
279
280 public InventoryData(ArrayList invList, LLUUID rootID)
281 {
282 InventoryArray = invList;
283 RootFolderID = rootID;
284 }
261 } 285 }
262 } 286 }
263} 287}