diff options
author | Melanie | 2010-01-06 22:00:19 +0000 |
---|---|---|
committer | Melanie | 2010-01-06 22:00:19 +0000 |
commit | 6d061d9f398adfa193f25c43604b517ad0d756a2 (patch) | |
tree | c1d14d93b53e483e9b2092112f475b563fb708d1 /OpenSim/Services/Connectors | |
parent | Adding a skeleton for the XInventoryInConnector, counterpart to the already (diff) | |
download | opensim-SC-6d061d9f398adfa193f25c43604b517ad0d756a2.zip opensim-SC-6d061d9f398adfa193f25c43604b517ad0d756a2.tar.gz opensim-SC-6d061d9f398adfa193f25c43604b517ad0d756a2.tar.bz2 opensim-SC-6d061d9f398adfa193f25c43604b517ad0d756a2.tar.xz |
Complete the XInventoryConnector. Flesh out the skeleton for the
XInventoryInConnector
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs index aac1a83..40acd6d 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | |||
@@ -149,12 +149,58 @@ namespace OpenSim.Services.Connectors | |||
149 | 149 | ||
150 | public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) | 150 | public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) |
151 | { | 151 | { |
152 | return null; | 152 | Dictionary<string,object> ret = MakeRequest("GETFOLDERCONTENT", |
153 | new Dictionary<string,object> { | ||
154 | { "PRINCIPAL", principalID.ToString() }, | ||
155 | { "FOLDER", folderID.ToString() } | ||
156 | }); | ||
157 | |||
158 | if (ret == null) | ||
159 | return null; | ||
160 | |||
161 | if (ret.Count == 0) | ||
162 | return null; | ||
163 | |||
164 | |||
165 | InventoryCollection inventory = new InventoryCollection(); | ||
166 | inventory.Folders = new List<InventoryFolderBase>(); | ||
167 | inventory.Items = new List<InventoryItemBase>(); | ||
168 | inventory.UserID = principalID; | ||
169 | |||
170 | Dictionary<string,object> folders = | ||
171 | (Dictionary<string,object>)ret["FOLDERS"]; | ||
172 | Dictionary<string,object> items = | ||
173 | (Dictionary<string,object>)ret["ITEMS"]; | ||
174 | |||
175 | foreach (Object o in folders.Values) | ||
176 | inventory.Folders.Add(BuildFolder((Dictionary<string,object>)o)); | ||
177 | foreach (Object o in items.Values) | ||
178 | inventory.Items.Add(BuildItem((Dictionary<string,object>)o)); | ||
179 | |||
180 | return inventory; | ||
153 | } | 181 | } |
154 | 182 | ||
155 | public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) | 183 | public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) |
156 | { | 184 | { |
157 | return null; | 185 | Dictionary<string,object> ret = MakeRequest("GETFOLDERCONTENT", |
186 | new Dictionary<string,object> { | ||
187 | { "PRINCIPAL", principalID.ToString() }, | ||
188 | { "FOLDER", folderID.ToString() } | ||
189 | }); | ||
190 | |||
191 | if (ret == null) | ||
192 | return null; | ||
193 | |||
194 | if (ret.Count == 0) | ||
195 | return null; | ||
196 | |||
197 | |||
198 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | ||
199 | |||
200 | foreach (Object o in ret.Values) | ||
201 | items.Add(BuildItem((Dictionary<string,object>)o)); | ||
202 | |||
203 | return items; | ||
158 | } | 204 | } |
159 | 205 | ||
160 | public bool AddFolder(InventoryFolderBase folder) | 206 | public bool AddFolder(InventoryFolderBase folder) |