From 950389a2633034fa8ff93dfa97dc14db46d40efc Mon Sep 17 00:00:00 2001 From: gareth Date: Wed, 11 Apr 2007 08:51:39 +0000 Subject: Added POST handler for /sims/ in the grid server Removed asset/user config in grid mode in the region server Added "create user" command in the user server console Begun buggy code to send sim details to the grid at startup Drank whole pack of red bull in one night and made stupid jokes in SVN logs and C# comments --- OpenSim.Framework/OpenSim.Framework.dll.build | 134 +++++++++++++------------- OpenSim.Framework/SimProfile.cs | 35 ++++++- OpenSim.Framework/UserProfileManager.cs | 8 +- 3 files changed, 105 insertions(+), 72 deletions(-) (limited to 'OpenSim.Framework') diff --git a/OpenSim.Framework/OpenSim.Framework.dll.build b/OpenSim.Framework/OpenSim.Framework.dll.build index 89010d2..b351625 100644 --- a/OpenSim.Framework/OpenSim.Framework.dll.build +++ b/OpenSim.Framework/OpenSim.Framework.dll.build @@ -1,67 +1,67 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Framework/SimProfile.cs b/OpenSim.Framework/SimProfile.cs index ac4cf9e..fd130f0 100644 --- a/OpenSim.Framework/SimProfile.cs +++ b/OpenSim.Framework/SimProfile.cs @@ -16,11 +16,43 @@ namespace OpenSim.Framework.Sims { Hashtable GridReqParams = new Hashtable(); GridReqParams["region_handle"] = region_handle.ToString(); + GridReqParams["authkey"] = SendKey; + ArrayList SendParams = new ArrayList(); + SendParams.Add(GridReqParams); + XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); + + XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); + + Hashtable RespData = (Hashtable)GridResp.Value; + this.UUID = new LLUUID((string)RespData["UUID"]); + this.regionhandle = (ulong)Convert.ToUInt64(RespData["regionhandle"]); + this.regionname = (string)RespData["regionname"]; + this.sim_ip = (string)RespData["sim_ip"]; + this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); + this.caps_url = (string)RespData["caps_url"]; + this.RegionLocX = (uint)Convert.ToUInt32(RespData["RegionLocX"]); + this.RegionLocY = (uint)Convert.ToUInt32(RespData["RegionLocY"]); + this.sendkey = (string)RespData["sendkey"]; + this.recvkey = (string)RespData["recvkey"]; + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + } + return this; + } + + public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey) + { + try + { + Hashtable GridReqParams = new Hashtable(); + GridReqParams["UUID"] = UUID.ToString(); GridReqParams["caller"] = "userserver"; GridReqParams["authkey"] = SendKey; ArrayList SendParams = new ArrayList(); SendParams.Add(GridReqParams); - XmlRpcRequest GridReq = new XmlRpcRequest("get_sim_info", SendParams); + XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); @@ -42,6 +74,7 @@ namespace OpenSim.Framework.Sims } return this; } + public SimProfile() { diff --git a/OpenSim.Framework/UserProfileManager.cs b/OpenSim.Framework/UserProfileManager.cs index d474834..38ca5df 100644 --- a/OpenSim.Framework/UserProfileManager.cs +++ b/OpenSim.Framework/UserProfileManager.cs @@ -90,8 +90,8 @@ namespace OpenSim.Framework.User LLUUID AgentID = TheUser.UUID; TheUser.InitSessionData(); - // SimProfile SimInfo = new SimProfile(); - // SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey); + SimProfile SimInfo = new SimProfile(); + SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey); Hashtable GlobalT = new Hashtable(); @@ -146,7 +146,7 @@ namespace OpenSim.Framework.User InitialOutfit.Add(InitialOutfitHash); uint circode = (uint)(Util.RandomClass.Next()); - //TheUser.AddSimCircuit(circode, SimInfo.UUID); + TheUser.AddSimCircuit(circode, SimInfo.UUID); responseData["last_name"] = TheUser.lastname; responseData["ui-config"] = ui_config; @@ -181,7 +181,7 @@ namespace OpenSim.Framework.User this.CustomiseResponse(ref responseData, TheUser); response.Value = responseData; - //TheUser.SendDataToSim(SimInfo); + // TheUser.SendDataToSim(SimInfo); -- cgit v1.1