diff options
author | gareth | 2007-03-22 10:11:15 +0000 |
---|---|---|
committer | gareth | 2007-03-22 10:11:15 +0000 |
commit | 7daa3955bc3a1918e40962851f9e8d38597a245e (patch) | |
tree | bee3e1372a7eed0c1b220a8a49f7bee7d29a6b91 /OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs | |
parent | Load XML for neighbourinfo from grid (diff) | |
download | opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.zip opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.gz opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.bz2 opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.xz |
brought zircon branch into trunk
Diffstat (limited to '')
-rw-r--r-- | OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs b/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs new file mode 100644 index 0000000..83e340b --- /dev/null +++ b/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs | |||
@@ -0,0 +1,76 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Collections; | ||
4 | using System.Text; | ||
5 | using OpenSim.Framework.User; | ||
6 | using OpenSim.Framework.Grid; | ||
7 | using OpenSim.Framework.Inventory; | ||
8 | using OpenSim.Framework.Interfaces; | ||
9 | using libsecondlife; | ||
10 | |||
11 | namespace OpenSim.UserServer | ||
12 | { | ||
13 | class LocalUserProfileManager : UserProfileManager | ||
14 | { | ||
15 | private IGridServer _gridServer; | ||
16 | |||
17 | public LocalUserProfileManager(IGridServer gridServer) | ||
18 | { | ||
19 | _gridServer = gridServer; | ||
20 | } | ||
21 | |||
22 | public override void InitUserProfiles() | ||
23 | { | ||
24 | // TODO: need to load from database | ||
25 | } | ||
26 | |||
27 | public override void CustomiseResponse(ref System.Collections.Hashtable response, UserProfile theUser) | ||
28 | { | ||
29 | uint circode = (uint)response["circuit_code"]; | ||
30 | theUser.AddSimCircuit(circode, LLUUID.Random()); | ||
31 | response["home"] = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}"; | ||
32 | response["sim_port"] = OpenSimRoot.Instance.Cfg.IPListenPort; | ||
33 | response["sim_ip"] = OpenSimRoot.Instance.Cfg.IPListenAddr; | ||
34 | response["region_y"] = (Int32)996 * 256; | ||
35 | response["region_x"] = (Int32)997* 256; | ||
36 | |||
37 | string first; | ||
38 | string last; | ||
39 | if (response.Contains("first")) | ||
40 | { | ||
41 | first = (string)response["first"]; | ||
42 | } | ||
43 | else | ||
44 | { | ||
45 | first = "test"; | ||
46 | } | ||
47 | |||
48 | if (response.Contains("last")) | ||
49 | { | ||
50 | last = (string)response["last"]; | ||
51 | } | ||
52 | else | ||
53 | { | ||
54 | last = "User"; | ||
55 | } | ||
56 | |||
57 | ArrayList InventoryList = (ArrayList)response["inventory-skeleton"]; | ||
58 | Hashtable Inventory1 = (Hashtable)InventoryList[0]; | ||
59 | |||
60 | Login _login = new Login(); | ||
61 | //copy data to login object | ||
62 | _login.First = first; | ||
63 | _login.Last = last; | ||
64 | _login.Agent = new LLUUID((string)response["agent_id"]) ; | ||
65 | _login.Session = new LLUUID((string)response["session_id"]); | ||
66 | _login.BaseFolder = null; | ||
67 | _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]); | ||
68 | |||
69 | //working on local computer if so lets add to the gridserver's list of sessions? | ||
70 | if (OpenSimRoot.Instance.GridServers.GridServer.GetName() == "Local") | ||
71 | { | ||
72 | ((LocalGridBase)this._gridServer).AddNewSession(_login); | ||
73 | } | ||
74 | } | ||
75 | } | ||
76 | } | ||