aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/UserLoginService.cs
diff options
context:
space:
mode:
authorMW2007-12-01 18:49:17 +0000
committerMW2007-12-01 18:49:17 +0000
commit5df851761aa796cba70a3b6d8b36d119502c1de2 (patch)
tree4cab0f2d6ea32a6cfb280d74583d8ffce7331c26 /OpenSim/Grid/UserServer/UserLoginService.cs
parentAttempt to fix mantis issue # 65, seems like it is a race condition between t... (diff)
downloadopensim-SC-5df851761aa796cba70a3b6d8b36d119502c1de2.zip
opensim-SC-5df851761aa796cba70a3b6d8b36d119502c1de2.tar.gz
opensim-SC-5df851761aa796cba70a3b6d8b36d119502c1de2.tar.bz2
opensim-SC-5df851761aa796cba70a3b6d8b36d119502c1de2.tar.xz
Initial working Grid Inventory server. Only been tested on a very small grid, so likely to have problems on a larger grid with more people?
To use , both the user server and Inventory server need to be running this latest revision. (older regions should be able to still be used, just the user won't have inventory on them). Also and HERE IS THE BIG BREAK ISSUE, currently, so that the initial inventory details for a user are added to the inventory db , you need to recreate the accounts using the user server "create user" feature. It should be quite easy to manual populate the inventory database instead but I someone else will need to look into that) Also I've only tested using SQLite as the database provider, there is a Mysql inventory provider but I don't know if it works (SQLite is set as default, so you will need to change it in the inventory server config.xml)
Diffstat (limited to 'OpenSim/Grid/UserServer/UserLoginService.cs')
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 0af5790..d3164ad 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -28,12 +28,16 @@
28 28
29using System; 29using System;
30using System.Collections; 30using System.Collections;
31using System.Collections.Generic;
31using System.Net; 32using System.Net;
32using Nwc.XmlRpc; 33using Nwc.XmlRpc;
34using libsecondlife;
33using OpenSim.Framework; 35using OpenSim.Framework;
34using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
37using OpenSim.Framework.Servers;
35using OpenSim.Framework.Data; 38using OpenSim.Framework.Data;
36using OpenSim.Framework.UserManagement; 39using OpenSim.Framework.UserManagement;
40using InventoryFolder = OpenSim.Framework.InventoryFolder;
37 41
38namespace OpenSim.Grid.UserServer 42namespace OpenSim.Grid.UserServer
39{ 43{
@@ -189,5 +193,51 @@ namespace OpenSim.Grid.UserServer
189 193
190 } 194 }
191 } 195 }
196
197 protected override InventoryData CreateInventoryData(LLUUID userID)
198 {
199 List<InventoryFolderBase> folders = SyncRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>(m_config.InventoryUrl + "RootFolders/", userID);
200 if (folders.Count > 0)
201 {
202 LLUUID rootID = LLUUID.Zero;
203 ArrayList AgentInventoryArray = new ArrayList();
204 Hashtable TempHash;
205 foreach (InventoryFolderBase InvFolder in folders)
206 {
207 if (InvFolder.parentID == LLUUID.Zero)
208 {
209 rootID = InvFolder.folderID;
210 }
211 TempHash = new Hashtable();
212 TempHash["name"] = InvFolder.name;
213 TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated();
214 TempHash["version"] = (Int32)InvFolder.version;
215 TempHash["type_default"] = (Int32)InvFolder.type;
216 TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated();
217 AgentInventoryArray.Add(TempHash);
218 }
219 return new InventoryData(AgentInventoryArray, rootID);
220 }
221 else
222 {
223 AgentInventory userInventory = new AgentInventory();
224 userInventory.CreateRootFolder(userID, false);
225
226 ArrayList AgentInventoryArray = new ArrayList();
227 Hashtable TempHash;
228 foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
229 {
230 TempHash = new Hashtable();
231 TempHash["name"] = InvFolder.FolderName;
232 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
233 TempHash["version"] = (Int32)InvFolder.Version;
234 TempHash["type_default"] = (Int32)InvFolder.DefaultType;
235 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
236 AgentInventoryArray.Add(TempHash);
237 }
238
239 return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
240 }
241 }
192 } 242 }
193} \ No newline at end of file 243} \ No newline at end of file