diff options
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.cs | 49 |
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 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections; | ||
3 | using System.Collections.Generic; | ||
2 | using libsecondlife; | 4 | using libsecondlife; |
3 | using OpenSim.Framework.Communications; | 5 | using OpenSim.Framework.Communications; |
4 | using OpenSim.Framework.Data; | 6 | using OpenSim.Framework.Data; |
5 | using OpenSim.Framework.Types; | 7 | using OpenSim.Framework.Types; |
6 | using OpenSim.Framework.UserManagement; | 8 | using OpenSim.Framework.UserManagement; |
7 | using OpenSim.Framework.Utilities; | 9 | using OpenSim.Framework.Utilities; |
10 | using OpenSim.Framework.Inventory; | ||
8 | 11 | ||
9 | namespace OpenSim.Region.Communications.Local | 12 | namespace 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 | } |