aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/UserManager
diff options
context:
space:
mode:
authorMW2007-08-14 13:54:46 +0000
committerMW2007-08-14 13:54:46 +0000
commita228b5984e6523456871f2f8e51aa086050acbf2 (patch)
treeb79888d4aa588c08fbb78bfcc78df3f47d7b5bea /OpenSim/Framework/UserManager
parentDisabled ScriptEngine until I add error handling tomorrow (diff)
downloadopensim-SC_OLD-a228b5984e6523456871f2f8e51aa086050acbf2.zip
opensim-SC_OLD-a228b5984e6523456871f2f8e51aa086050acbf2.tar.gz
opensim-SC_OLD-a228b5984e6523456871f2f8e51aa086050acbf2.tar.bz2
opensim-SC_OLD-a228b5984e6523456871f2f8e51aa086050acbf2.tar.xz
Start of Inventory service, currently only (partially) functional in standalone mode and using sqlite).
In standalone mode, if you have account authenticate turned on (setting in opensim.ini) then when you create a new account, a set of inventory is created for that account and stored in database (currently only a set of empty folders). Then during login the database is search for that set and sent to the client in the login response. More functions will be added soon, like creating new folders (and a bit later items) from the client inventory window.
Diffstat (limited to 'OpenSim/Framework/UserManager')
-rw-r--r--OpenSim/Framework/UserManager/LoginService.cs32
1 files changed, 20 insertions, 12 deletions
diff --git a/OpenSim/Framework/UserManager/LoginService.cs b/OpenSim/Framework/UserManager/LoginService.cs
index a26a0c4..b75c4fb 100644
--- a/OpenSim/Framework/UserManager/LoginService.cs
+++ b/OpenSim/Framework/UserManager/LoginService.cs
@@ -89,14 +89,14 @@ namespace OpenSim.Framework.UserManagement
89 LLUUID agentID = userProfile.UUID; 89 LLUUID agentID = userProfile.UUID;
90 90
91 // Inventory Library Section 91 // Inventory Library Section
92 AgentInventory userInventory = this.GetUsersInventory(agentID); 92 InventoryData inventData = this.CreateInventoryData(agentID);
93 ArrayList AgentInventoryArray = this.CreateInventoryArray(userInventory); 93 ArrayList AgentInventoryArray = inventData.InventoryArray;
94 94
95 Hashtable InventoryRootHash = new Hashtable(); 95 Hashtable InventoryRootHash = new Hashtable();
96 InventoryRootHash["folder_id"] = userInventory.InventoryRoot.FolderID.ToStringHyphenated(); 96 InventoryRootHash["folder_id"] = inventData.RootFolderID.ToStringHyphenated();
97 ArrayList InventoryRoot = new ArrayList(); 97 ArrayList InventoryRoot = new ArrayList();
98 InventoryRoot.Add(InventoryRootHash); 98 InventoryRoot.Add(InventoryRootHash);
99 userProfile.rootInventoryFolderID = userInventory.InventoryRoot.FolderID; 99 userProfile.rootInventoryFolderID = inventData.RootFolderID;
100 100
101 // Circuit Code 101 // Circuit Code
102 uint circode = (uint)(Util.RandomClass.Next()); 102 uint circode = (uint)(Util.RandomClass.Next());
@@ -253,16 +253,11 @@ namespace OpenSim.Framework.UserManagement
253 return inventoryLibOwner; 253 return inventoryLibOwner;
254 } 254 }
255 255
256 protected virtual AgentInventory GetUsersInventory(LLUUID agentID) 256 protected virtual InventoryData CreateInventoryData(LLUUID userID)
257 { 257 {
258 AgentInventory userInventory = new AgentInventory(); 258 AgentInventory userInventory = new AgentInventory();
259 userInventory.CreateRootFolder(agentID, false); 259 userInventory.CreateRootFolder(userID, false);
260 260
261 return userInventory;
262 }
263
264 protected virtual ArrayList CreateInventoryArray(AgentInventory userInventory)
265 {
266 ArrayList AgentInventoryArray = new ArrayList(); 261 ArrayList AgentInventoryArray = new ArrayList();
267 Hashtable TempHash; 262 Hashtable TempHash;
268 foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values) 263 foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
@@ -275,7 +270,20 @@ namespace OpenSim.Framework.UserManagement
275 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); 270 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
276 AgentInventoryArray.Add(TempHash); 271 AgentInventoryArray.Add(TempHash);
277 } 272 }
278 return AgentInventoryArray; 273
274 return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
275 }
276
277 public class InventoryData
278 {
279 public ArrayList InventoryArray = null;
280 public LLUUID RootFolderID = LLUUID.Zero;
281
282 public InventoryData(ArrayList invList, LLUUID rootID)
283 {
284 InventoryArray = invList;
285 RootFolderID = rootID;
286 }
279 } 287 }
280 } 288 }
281} 289}