From d5406fe77309770234524f6afa38ae1502f01eab Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 17 Apr 2007 12:03:52 +0000 Subject: A few fixes and stopped sim crossing being attempted in sandbox mode --- OpenSim.RegionServer/OpenSimMain.cs | 59 +++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 26 deletions(-) (limited to 'OpenSim.RegionServer/OpenSimMain.cs') diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs index 7f2032d..ea6088b 100644 --- a/OpenSim.RegionServer/OpenSimMain.cs +++ b/OpenSim.RegionServer/OpenSimMain.cs @@ -67,7 +67,7 @@ namespace OpenSim //private Dictionary ClientThreads = new Dictionary(); private Dictionary clientCircuits = new Dictionary(); private DateTime startuptime; - public RegionInfo regionData; + private RegionInfo regionData; public Socket Server; private IPEndPoint ServerIncoming; @@ -206,23 +206,29 @@ namespace OpenSim agent_data.firstname = (string)requestData["firstname"]; agent_data.lastname = (string)requestData["lastname"]; agent_data.AgentID = new LLUUID((string)requestData["agent_id"]); - agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); - if(requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) { - agent_data.child=true; - } else { - agent_data.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]),Convert.ToUInt32(requestData["startpos_y"]),Convert.ToUInt32(requestData["startpos_z"])); - agent_data.child=false; - } - - if(((RemoteGridBase)gridServer).agentcircuits.ContainsKey((uint)agent_data.circuitcode)) { - ((RemoteGridBase)gridServer).agentcircuits[(uint)agent_data.circuitcode]=agent_data; - } else { - ((RemoteGridBase)gridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data); - } + agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); + if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) + { + agent_data.child = true; + } + else + { + agent_data.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"])); + agent_data.child = false; + } + + if (((RemoteGridBase)gridServer).agentcircuits.ContainsKey((uint)agent_data.circuitcode)) + { + ((RemoteGridBase)gridServer).agentcircuits[(uint)agent_data.circuitcode] = agent_data; + } + else + { + ((RemoteGridBase)gridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data); + } return new XmlRpcResponse(); }); - + httpServer.AddXmlRPCHandler("agent_crossing", delegate(XmlRpcRequest request) { @@ -230,18 +236,19 @@ namespace OpenSim AgentCircuitData agent_data = new AgentCircuitData(); agent_data.firstname = (string)requestData["firstname"]; agent_data.lastname = (string)requestData["lastname"]; - agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); - agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]),Single.Parse((string)requestData["pos_y"]),Single.Parse((string)requestData["pos_z"])); - - if(((RemoteGridBase)gridServer).agentcircuits.ContainsKey((uint)agent_data.circuitcode)) { - ((RemoteGridBase)gridServer).agentcircuits[(uint)agent_data.circuitcode].firstname = agent_data.firstname; - ((RemoteGridBase)gridServer).agentcircuits[(uint)agent_data.circuitcode].lastname = agent_data.lastname; - ((RemoteGridBase)gridServer).agentcircuits[(uint)agent_data.circuitcode].startpos = agent_data.startpos; - } + agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); + agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]), Single.Parse((string)requestData["pos_y"]), Single.Parse((string)requestData["pos_z"])); + + if (((RemoteGridBase)gridServer).agentcircuits.ContainsKey((uint)agent_data.circuitcode)) + { + ((RemoteGridBase)gridServer).agentcircuits[(uint)agent_data.circuitcode].firstname = agent_data.firstname; + ((RemoteGridBase)gridServer).agentcircuits[(uint)agent_data.circuitcode].lastname = agent_data.lastname; + ((RemoteGridBase)gridServer).agentcircuits[(uint)agent_data.circuitcode].startpos = agent_data.startpos; + } return new XmlRpcResponse(); }); - + httpServer.AddRestHandler("GET", "/simstatus/", delegate(string request, string path, string param) { @@ -313,7 +320,7 @@ namespace OpenSim pluginAssembly = null; return config; } - + private void OnReceivedData(IAsyncResult result) { ipeSender = new IPEndPoint(IPAddress.Any, 0); @@ -342,7 +349,7 @@ namespace OpenSim { isChildAgent = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].child; } - SimClient newuser = new SimClient(epSender, useCircuit, LocalWorld, _packetServer.ClientThreads, AssetCache, GridServers.GridServer, this, InventoryCache, m_sandbox, isChildAgent); + SimClient newuser = new SimClient(epSender, useCircuit, LocalWorld, _packetServer.ClientThreads, AssetCache, GridServers.GridServer, this, InventoryCache, m_sandbox, isChildAgent, this.regionData); if ((this.GridServers.UserServer != null) && (user_accounts)) { newuser.UserServer = this.GridServers.UserServer; -- cgit v1.1