aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Framework/UserProfileManager.cs
diff options
context:
space:
mode:
authorlbsa712007-03-31 06:34:41 +0000
committerlbsa712007-03-31 06:34:41 +0000
commit020fe9a21429e62ca7810e2f9fac9f468f3b28b0 (patch)
treee1d523719d831f2777260165af78ee38c0021e57 /OpenSim.Framework/UserProfileManager.cs
parent* updated build files (diff)
downloadopensim-SC-020fe9a21429e62ca7810e2f9fac9f468f3b28b0.zip
opensim-SC-020fe9a21429e62ca7810e2f9fac9f468f3b28b0.tar.gz
opensim-SC-020fe9a21429e62ca7810e2f9fac9f468f3b28b0.tar.bz2
opensim-SC-020fe9a21429e62ca7810e2f9fac9f468f3b28b0.tar.xz
* cleared some unused code away
Diffstat (limited to 'OpenSim.Framework/UserProfileManager.cs')
-rw-r--r--OpenSim.Framework/UserProfileManager.cs182
1 files changed, 0 insertions, 182 deletions
diff --git a/OpenSim.Framework/UserProfileManager.cs b/OpenSim.Framework/UserProfileManager.cs
index 2f99494..6118aa7 100644
--- a/OpenSim.Framework/UserProfileManager.cs
+++ b/OpenSim.Framework/UserProfileManager.cs
@@ -32,188 +32,6 @@ namespace OpenSim.Framework.User
32 DefaultStartupMsg = message; 32 DefaultStartupMsg = message;
33 } 33 }
34 34
35 /* public virtual string ParseXMLRPC(string requestBody)
36 {
37 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
38
39 Hashtable requestData = (Hashtable)request.Params[0];
40 switch (request.MethodName)
41 {
42 case "login_to_simulator":*/
43
44 public virtual string ParseXMLRPC(string requestBody)
45 {
46
47 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
48
49 switch (request.MethodName)
50 {
51 case "login_to_simulator":
52 XmlRpcResponse response = XmlRpcLoginMethod(request);
53
54 return (Regex.Replace(XmlRpcResponseSerializer.Singleton.Serialize(response), "utf-16", "utf-8"));
55 }
56
57 return "";
58 }
59
60 /* public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
61 {
62 XmlRpcResponse response = new XmlRpcResponse();
63 Hashtable requestData = (Hashtable)request.Params[0];
64
65 bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
66 bool GoodLogin = false;
67 string firstname = "";
68 string lastname = "";
69 string passwd = "";
70
71 if (GoodXML)
72 {
73 firstname = (string)requestData["first"];
74 lastname = (string)requestData["last"];
75 passwd = (string)requestData["passwd"];
76 GoodLogin = AuthenticateUser(firstname, lastname, passwd);
77 }
78
79
80 if (!(GoodXML && GoodLogin))
81 {
82 XmlRpcResponse LoginErrorResp = new XmlRpcResponse();
83 Hashtable ErrorRespData = new Hashtable();
84 ErrorRespData["reason"] = "key";
85 ErrorRespData["message"] = "Error connecting to grid. Please double check your login details and check with the grid owner if you are sure these are correct";
86 ErrorRespData["login"] = "false";
87 LoginErrorResp.Value = ErrorRespData;
88 return (Regex.Replace(XmlRpcResponseSerializer.Singleton.Serialize(LoginErrorResp), " encoding=\"utf-16\"", ""));
89 }
90
91 UserProfile TheUser = GetProfileByName(firstname, lastname);
92
93
94 if (!((TheUser.CurrentSessionID == null) && (TheUser.CurrentSecureSessionID == null)))
95 {
96 XmlRpcResponse PresenceErrorResp = new XmlRpcResponse();
97 Hashtable PresenceErrorRespData = new Hashtable();
98 PresenceErrorRespData["reason"] = "presence";
99 PresenceErrorRespData["message"] = "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner";
100 PresenceErrorRespData["login"] = "false";
101 PresenceErrorResp.Value = PresenceErrorRespData;
102 return (Regex.Replace(XmlRpcResponseSerializer.Singleton.Serialize(PresenceErrorResp), " encoding=\"utf-16\"", ""));
103
104 }
105
106 try
107 {
108 LLUUID AgentID = TheUser.UUID;
109 TheUser.InitSessionData();
110 // SimProfile SimInfo = new SimProfile();
111 // SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey);
112
113 XmlRpcResponse LoginGoodResp = new XmlRpcResponse();
114 Hashtable LoginGoodData = new Hashtable();
115
116 Hashtable GlobalT = new Hashtable();
117 GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271";
118 GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
119 GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
120 ArrayList GlobalTextures = new ArrayList();
121 GlobalTextures.Add(GlobalT);
122
123 Hashtable LoginFlagsHash = new Hashtable();
124 LoginFlagsHash["daylight_savings"] = "N";
125 LoginFlagsHash["stipend_since_login"] = "N";
126 LoginFlagsHash["gendered"] = "Y";
127 LoginFlagsHash["ever_logged_in"] = "Y";
128 ArrayList LoginFlags = new ArrayList();
129 LoginFlags.Add(LoginFlagsHash);
130
131 Hashtable uiconfig = new Hashtable();
132 uiconfig["allow_first_life"] = "Y";
133 ArrayList ui_config = new ArrayList();
134 ui_config.Add(uiconfig);
135
136 Hashtable ClassifiedCategoriesHash = new Hashtable();
137 ClassifiedCategoriesHash["category_name"] = "bla bla";
138 ClassifiedCategoriesHash["category_id"] = (Int32)1;
139 ArrayList ClassifiedCategories = new ArrayList();
140 ClassifiedCategories.Add(ClassifiedCategoriesHash);
141
142 Console.WriteLine("copying inventory data to response");
143 ArrayList AgentInventory = new ArrayList();
144 foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values)
145 {
146 Hashtable TempHash = new Hashtable();
147 TempHash["name"] = InvFolder.FolderName;
148 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
149 TempHash["version"] = (Int32)InvFolder.Version;
150 TempHash["type_default"] = (Int32)InvFolder.DefaultType;
151 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
152 AgentInventory.Add(TempHash);
153 }
154
155 Hashtable InventoryRootHash = new Hashtable();
156 InventoryRootHash["folder_id"] = TheUser.Inventory.InventoryRoot.FolderID.ToStringHyphenated();
157 ArrayList InventoryRoot = new ArrayList();
158 InventoryRoot.Add(InventoryRootHash);
159
160 Hashtable InitialOutfitHash = new Hashtable();
161 InitialOutfitHash["folder_name"] = "Nightclub Female";
162 InitialOutfitHash["gender"] = "female";
163 ArrayList InitialOutfit = new ArrayList();
164 InitialOutfit.Add(InitialOutfitHash);
165
166 uint circode = (uint)(Util.RandomClass.Next());
167 //TheUser.AddSimCircuit(circode, SimInfo.UUID);
168
169 LoginGoodData["last_name"] = TheUser.lastname ;
170 LoginGoodData["ui-config"] = ui_config;
171 LoginGoodData["sim_ip"] = "127.0.0.1"; //SimInfo.sim_ip.ToString();
172 LoginGoodData["login-flags"] = LoginFlags;
173 LoginGoodData["global-textures"] = GlobalTextures;
174 LoginGoodData["classified_categories"] = ClassifiedCategories;
175 LoginGoodData["event_categories"] = new ArrayList();
176 LoginGoodData["inventory-skeleton"] = AgentInventory;
177 LoginGoodData["inventory-skel-lib"] = new ArrayList();
178 LoginGoodData["inventory-root"] = InventoryRoot;
179 LoginGoodData["event_notifications"] = new ArrayList();
180 LoginGoodData["gestures"] = new ArrayList();
181 LoginGoodData["inventory-lib-owner"] = new ArrayList();
182 LoginGoodData["initial-outfit"] = InitialOutfit;
183 LoginGoodData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
184 LoginGoodData["start_location"] = "last";
185 LoginGoodData["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() + "]}";
186 LoginGoodData["message"] = DefaultStartupMsg;
187 LoginGoodData["first_name"] = TheUser.firstname ;
188 LoginGoodData["circuit_code"] = (Int32)circode;
189 LoginGoodData["sim_port"] = 9000; //(Int32)SimInfo.sim_port;
190 LoginGoodData["secure_session_id"] = TheUser.CurrentSecureSessionID.ToStringHyphenated();
191 LoginGoodData["look_at"] = "\n[r" + TheUser.homelookat.X.ToString() + ",r" + TheUser.homelookat.Y.ToString() + ",r" + TheUser.homelookat.Z.ToString() + "]\n";
192 LoginGoodData["agent_id"] = AgentID.ToStringHyphenated();
193 LoginGoodData["region_y"] = (Int32) 996 * 256; // (Int32)SimInfo.RegionLocY * 256;
194 LoginGoodData["region_x"] = (Int32) 997 * 256; //SimInfo.RegionLocX * 256;
195 LoginGoodData["seed_capability"] = null;
196 LoginGoodData["agent_access"] = "M";
197 LoginGoodData["session_id"] = TheUser.CurrentSessionID.ToStringHyphenated();
198 LoginGoodData["login"] = "true";
199
200 this.CustomiseResponse(ref LoginGoodData, TheUser);
201 LoginGoodResp.Value = LoginGoodData;
202 //TheUser.SendDataToSim(SimInfo);
203 return (Regex.Replace(XmlRpcResponseSerializer.Singleton.Serialize(LoginGoodResp), "utf-16", "utf-8"));
204
205 }
206 catch (Exception E)
207 {
208 Console.WriteLine(E.ToString());
209 }
210
211 break;
212 }
213
214 return "";
215 }*/
216
217 public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) 35 public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
218 { 36 {
219 XmlRpcResponse response = new XmlRpcResponse(); 37 XmlRpcResponse response = new XmlRpcResponse();