aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs76
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 @@
1using System;
2using System.Collections.Generic;
3using System.Collections;
4using System.Text;
5using OpenSim.Framework.User;
6using OpenSim.Framework.Grid;
7using OpenSim.Framework.Inventory;
8using OpenSim.Framework.Interfaces;
9using libsecondlife;
10
11namespace 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}