aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenSim.Servers/LocalUserProfileManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Common/OpenSim.Servers/LocalUserProfileManager.cs')
-rw-r--r--Common/OpenSim.Servers/LocalUserProfileManager.cs124
1 files changed, 0 insertions, 124 deletions
diff --git a/Common/OpenSim.Servers/LocalUserProfileManager.cs b/Common/OpenSim.Servers/LocalUserProfileManager.cs
deleted file mode 100644
index 6f65176..0000000
--- a/Common/OpenSim.Servers/LocalUserProfileManager.cs
+++ /dev/null
@@ -1,124 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28
29using System;
30using System.Collections.Generic;
31using System.Collections;
32using System.Text;
33using OpenSim.Framework.User;
34using OpenSim.Framework.Grid;
35using OpenSim.Framework.Inventory;
36using OpenSim.Framework.Interfaces;
37using OpenSim.Framework.Types;
38using libsecondlife;
39
40namespace OpenSim.UserServer
41{
42 public class LocalUserProfileManager : UserProfileManager
43 {
44 private IGridServer m_gridServer;
45 private int m_port;
46 private string m_ipAddr;
47 private uint regionX;
48 private uint regionY;
49 private AddNewSessionHandler AddSession;
50
51 public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY)
52 {
53 m_gridServer = gridServer;
54 m_port = simPort;
55 m_ipAddr = ipAddr;
56 regionX = regX;
57 regionY = regY;
58 }
59
60 public void SetSessionHandler(AddNewSessionHandler sessionHandler)
61 {
62 this.AddSession = sessionHandler;
63 }
64
65 public override void InitUserProfiles()
66 {
67 base.InitUserProfiles();
68 }
69
70 public override void CustomiseResponse(ref System.Collections.Hashtable response, UserProfile theUser)
71 {
72 Int32 circode = (Int32)response["circuit_code"];
73 theUser.AddSimCircuit((uint)circode, LLUUID.Random());
74 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() + "]}";
75 response["sim_port"] = m_port;
76 response["sim_ip"] = m_ipAddr;
77 response["region_y"] = (Int32)regionY* 256;
78 response["region_x"] = (Int32)regionX* 256;
79
80 string first;
81 string last;
82 if (response.Contains("first_name"))
83 {
84 first = (string)response["first_name"];
85 }
86 else
87 {
88 first = "test";
89 }
90
91 if (response.Contains("last_name"))
92 {
93 last = (string)response["last_name"];
94 }
95 else
96 {
97 last = "User";
98 }
99
100 ArrayList InventoryList = (ArrayList)response["inventory-skeleton"];
101 Hashtable Inventory1 = (Hashtable)InventoryList[0];
102
103 Login _login = new Login();
104 //copy data to login object
105 _login.First = first;
106 _login.Last = last;
107 _login.Agent = new LLUUID((string)response["agent_id"]) ;
108 _login.Session = new LLUUID((string)response["session_id"]);
109 _login.SecureSession = new LLUUID((string)response["secure_session_id"]);
110 _login.CircuitCode =(uint) circode;
111 _login.BaseFolder = null;
112 _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]);
113
114 //working on local computer if so lets add to the gridserver's list of sessions?
115 /*if (m_gridServer.GetName() == "Local")
116 {
117 Console.WriteLine("adding login data to gridserver");
118 ((LocalGridBase)this.m_gridServer).AddNewSession(_login);
119 }*/
120
121 this.AddSession(_login);
122 }
123 }
124}