aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/Local/LocalLoginService.cs
diff options
context:
space:
mode:
authorMW2007-08-14 13:54:46 +0000
committerMW2007-08-14 13:54:46 +0000
commita228b5984e6523456871f2f8e51aa086050acbf2 (patch)
treeb79888d4aa588c08fbb78bfcc78df3f47d7b5bea /OpenSim/Region/Communications/Local/LocalLoginService.cs
parentDisabled ScriptEngine until I add error handling tomorrow (diff)
downloadopensim-SC-a228b5984e6523456871f2f8e51aa086050acbf2.zip
opensim-SC-a228b5984e6523456871f2f8e51aa086050acbf2.tar.gz
opensim-SC-a228b5984e6523456871f2f8e51aa086050acbf2.tar.bz2
opensim-SC-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/Region/Communications/Local/LocalLoginService.cs')
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs49
1 files changed, 49 insertions, 0 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 19a1e8c..661fbbe 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -1,10 +1,13 @@
1using System; 1using System;
2using System.Collections;
3using System.Collections.Generic;
2using libsecondlife; 4using libsecondlife;
3using OpenSim.Framework.Communications; 5using OpenSim.Framework.Communications;
4using OpenSim.Framework.Data; 6using OpenSim.Framework.Data;
5using OpenSim.Framework.Types; 7using OpenSim.Framework.Types;
6using OpenSim.Framework.UserManagement; 8using OpenSim.Framework.UserManagement;
7using OpenSim.Framework.Utilities; 9using OpenSim.Framework.Utilities;
10using OpenSim.Framework.Inventory;
8 11
9namespace OpenSim.Region.Communications.Local 12namespace OpenSim.Region.Communications.Local
10{ 13{
@@ -109,5 +112,51 @@ namespace OpenSim.Region.Communications.Local
109 } 112 }
110 113
111 } 114 }
115
116 protected override InventoryData CreateInventoryData(LLUUID userID)
117 {
118 List<InventoryFolderBase> folders = this.m_Parent.InvenServices.RequestFirstLevelFolders(userID);
119 if (folders.Count > 0)
120 {
121 LLUUID rootID = LLUUID.Zero;
122 ArrayList AgentInventoryArray = new ArrayList();
123 Hashtable TempHash;
124 foreach (InventoryFolderBase InvFolder in folders)
125 {
126 if (InvFolder.parentID == LLUUID.Zero)
127 {
128 rootID = InvFolder.folderID;
129 }
130 TempHash = new Hashtable();
131 TempHash["name"] = InvFolder.name;
132 TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated();
133 TempHash["version"] = (Int32)InvFolder.version;
134 TempHash["type_default"] = (Int32)InvFolder.type;
135 TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated();
136 AgentInventoryArray.Add(TempHash);
137 }
138 return new InventoryData(AgentInventoryArray, rootID);
139 }
140 else
141 {
142 AgentInventory userInventory = new AgentInventory();
143 userInventory.CreateRootFolder(userID, false);
144
145 ArrayList AgentInventoryArray = new ArrayList();
146 Hashtable TempHash;
147 foreach (OpenSim.Framework.Inventory.InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
148 {
149 TempHash = new Hashtable();
150 TempHash["name"] = InvFolder.FolderName;
151 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
152 TempHash["version"] = (Int32)InvFolder.Version;
153 TempHash["type_default"] = (Int32)InvFolder.DefaultType;
154 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
155 AgentInventoryArray.Add(TempHash);
156 }
157
158 return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
159 }
160 }
112 } 161 }
113} 162}