From 41412e4375188e53df7cb08ee68167fc83545d4f Mon Sep 17 00:00:00 2001 From: gareth Date: Mon, 12 Mar 2007 17:52:13 +0000 Subject: [PATCH] w00t! login works (on the grid side) --- userserver/src/Main.cs | 2 ++ userserver/src/UserHttp.cs | 49 +++++++++++++++++++++++----------- userserver/src/UserProfiles.cs | 11 +++++++- 3 files changed, 45 insertions(+), 17 deletions(-) diff --git a/userserver/src/Main.cs b/userserver/src/Main.cs index 584e397c6e..40ef916a76 100644 --- a/userserver/src/Main.cs +++ b/userserver/src/Main.cs @@ -104,6 +104,8 @@ namespace OpenGridServices GridGod=_profilemanager.CreateNewProfile(tempfirstname,templastname,tempMD5Passwd); _profilemanager.SetGod(GridGod.UUID); + GridGod.homelookat = new LLVector3(-0.57343f, -0.819255f, 0f); + GridGod.homepos = new LLVector3(128f,128f,23f); ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Starting HTTP process"); _httpd = new UserHTTPServer(); diff --git a/userserver/src/UserHttp.cs b/userserver/src/UserHttp.cs index 366854013d..3667d5c0ff 100644 --- a/userserver/src/UserHttp.cs +++ b/userserver/src/UserHttp.cs @@ -108,6 +108,7 @@ namespace OpenGridServices } + try { LLUUID AgentID = TheUser.UUID; TheUser.InitSessionData(); SimProfile SimInfo = new SimProfile(); @@ -116,33 +117,49 @@ namespace OpenGridServices XmlRpcResponse LoginGoodResp = new XmlRpcResponse(); Hashtable LoginGoodData = new Hashtable(); - Hashtable GlobalTextures = new Hashtable(); - GlobalTextures["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271"; - GlobalTextures["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; - GlobalTextures["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; + Hashtable GlobalT = new Hashtable(); + GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271"; + GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; + GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; + ArrayList GlobalTextures = new ArrayList(); + GlobalTextures.Add(GlobalT); - Hashtable LoginFlags = new Hashtable(); - LoginFlags["daylight_savings"]="N"; - LoginFlags["stipend_since_login"]="N"; - LoginFlags["gendered"]="Y"; - LoginFlags["ever_logged_in"]="Y"; + Hashtable LoginFlagsHash = new Hashtable(); + LoginFlagsHash["daylight_savings"]="N"; + LoginFlagsHash["stipend_since_login"]="N"; + LoginFlagsHash["gendered"]="Y"; + LoginFlagsHash["ever_logged_in"]="Y"; + ArrayList LoginFlags=new ArrayList(); + LoginFlags.Add(LoginFlagsHash); + + Hashtable uiconfig = new Hashtable(); + uiconfig["allow_first_life"]="Y"; + ArrayList ui_config=new ArrayList(); + ui_config.Add(uiconfig); LoginGoodData["message"]=OpenUser_Main.userserver.DefaultStartupMsg; LoginGoodData["session_id"]=TheUser.CurrentSessionID.ToString(); LoginGoodData["secure_sessionid"]=TheUser.CurrentSecureSessionID.ToString(); LoginGoodData["agent_access"]="M"; LoginGoodData["start_location"]=requestData["start"]; + LoginGoodData["look_at"]="[r" + TheUser.homelookat.X.ToString() + ", r" + TheUser.homelookat.Y.ToString() + ", r" + TheUser.homelookat.Z.ToString() + "]"; LoginGoodData["global_textures"]=GlobalTextures; - LoginGoodData["seconds_since_epoch"]=DateTime.Now; + LoginGoodData["seconds_since_epoch"]=(Int32)(DateTime.UtcNow - new DateTime(1970,1,1)).TotalSeconds; LoginGoodData["firstname"]=firstname; - LoginGoodData["circuit_code"]=(new Random()).Next(); + LoginGoodData["circuit_code"]=(new Random()).Next().ToString(); LoginGoodData["login_flags"]=LoginFlags; - LoginGoodData["seed_capability"]="http://" + SimInfo.sim_ip + ":12043" + "/cap/" + TheUser.CurrentSecureSessionID.Combine(TheUser.CurrentSessionID).Combine(AgentID); - - - try { + LoginGoodData["seed_capability"]=SimInfo.caps_url; + LoginGoodData["home"]="{'region_handle':'r" + (SimInfo.RegionLocX*256).ToString() + "," + (SimInfo.RegionLocY*256).ToString() + "', 'position':'r" + TheUser.homepos.X.ToString() + "," + TheUser.homepos.Y.ToString() + "," + TheUser.homepos.Z.ToString() + "', 'look_at':'r" + TheUser.homelookat.X.ToString() + "," + TheUser.homelookat.Y.ToString() + "," + TheUser.homelookat.Z.ToString() + "'}"; + LoginGoodData["sim_ip"]=SimInfo.sim_ip.ToString(); + LoginGoodData["sim_port"]=SimInfo.sim_port; + LoginGoodData["region_x"]=SimInfo.RegionLocX; + LoginGoodData["region_y"]=SimInfo.RegionLocY; + LoginGoodData["ui_config"] = ui_config; + LoginGoodData["login"]="true"; + LoginGoodResp.Value=LoginGoodData; - return(XmlRpcResponseSerializer.Singleton.Serialize(LoginGoodResp)); + return(Regex.Replace(XmlRpcResponseSerializer.Singleton.Serialize(LoginGoodResp),"utf-16","utf-8" )); + } catch (Exception E) { Console.WriteLine(E.ToString()); } diff --git a/userserver/src/UserProfiles.cs b/userserver/src/UserProfiles.cs index 16ab11e9bd..4a25ca76f8 100644 --- a/userserver/src/UserProfiles.cs +++ b/userserver/src/UserProfiles.cs @@ -172,7 +172,16 @@ namespace OpenGridServices XmlRpcResponse GridResp = GridReq.Send(GridURL,3000); Hashtable RespData=(Hashtable)GridResp.Value; - Console.WriteLine(RespData.ToString()); + this.UUID = new LLUUID(RespData["UUID"].ToString()); + this.regionhandle = Convert.ToUInt64(RespData["regionhandle"]); + this.regionname=(string)RespData["regionname"]; + this.sim_ip=(string)RespData["sim_ip"]; + this.sim_port=Convert.ToUInt16(RespData["sim_port"]); + this.caps_url=(string)RespData["caps_url"]; + this.RegionLocX=Convert.ToUInt32(RespData["RegionLocX"]); + this.RegionLocY=Convert.ToUInt32(RespData["RegionLocY"]); + this.sendkey=(string)RespData["sendkey"]; + this.recvkey=(string)RespData["recvkey"]; } catch(Exception e) { Console.WriteLine(e.ToString()); }