From 5061a703eafedaaec01b756ac0fd3ac5ea51d3c5 Mon Sep 17 00:00:00 2001 From: Brian McBee Date: Wed, 8 Aug 2007 07:00:56 +0000 Subject: [PATCH] CAPS should now be working in standalone mode. Texture uploads will work even after you cross a region boundary. --- .../Communications/Capabilities/Caps.cs | 18 ++++++++++++------ OpenSim/Region/ClientStack/ClientView.API.cs | 18 ++++++++++++++---- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index d133617898..82ef08d757 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -74,13 +74,18 @@ namespace OpenSim.Region.Capabilities { Console.WriteLine("registering CAPS handlers"); string capsBase = "/CAPS/" + m_capsObjectPath; + try + { + httpListener.AddStreamHandler(new LLSDStreamhandler("POST", capsBase + m_mapLayerPath, this.GetMapLayer)); + httpListener.AddStreamHandler(new LLSDStreamhandler("POST", capsBase + m_newInventory, this.NewAgentInventoryRequest)); - httpListener.AddStreamHandler(new LLSDStreamhandler("POST", capsBase + m_mapLayerPath, this.GetMapLayer )); - httpListener.AddStreamHandler( new LLSDStreamhandler("POST", capsBase + m_newInventory, this.NewAgentInventoryRequest)); - - AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest); - //AddLegacyCapsHandler(httpListener, m_requestTexture , RequestTexture); - AddLegacyCapsHandler(httpListener, m_notecardUpdatePath, NoteCardAgentInventory); + AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest); + //AddLegacyCapsHandler(httpListener, m_requestTexture , RequestTexture); + AddLegacyCapsHandler(httpListener, m_notecardUpdatePath, NoteCardAgentInventory); + } + catch + { + } } @@ -361,3 +366,4 @@ namespace OpenSim.Region.Capabilities } } + diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index fb0ec290aa..a4b0af1798 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -383,7 +383,7 @@ namespace OpenSim.Region.ClientStack agentData.child = false; agentData.firstname = this.firstName; agentData.lastname = this.lastName; - + agentData.CapsPath=m_authenticateSessionsHandler.AgentCircuits[this.CircuitCode].CapsPath; return agentData; } @@ -406,8 +406,13 @@ namespace OpenSim.Region.ClientStack newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8; newSimPack.RegionData.SimIP += (uint)byteIP[0]; newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port; - newSimPack.RegionData.SeedCapability = new byte[0]; + //newSimPack.RegionData.SeedCapability = new byte[0]; + string capsPath = "http://" + externalIPEndPoint.Address.ToString() + ":9000/CAPS/" + m_authenticateSessionsHandler.AgentCircuits[this.CircuitCode].CapsPath +"0000/"; + System.Text.ASCIIEncoding enc=new System.Text.ASCIIEncoding(); + newSimPack.RegionData.SeedCapability = enc.GetBytes(capsPath); + + this.OutPacket(newSimPack); //this.DowngradeClient(); } @@ -451,7 +456,12 @@ namespace OpenSim.Region.ClientStack teleport.Info.AgentID = this.AgentID; teleport.Info.RegionHandle = regionHandle; teleport.Info.SimAccess = simAccess; - teleport.Info.SeedCapability = new byte[0]; + + string capsPath = "http://" + newRegionEndPoint.Address.ToString() + ":9000/CAPS/" + m_authenticateSessionsHandler.AgentCircuits[this.CircuitCode].CapsPath + "0000/"; + System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); + teleport.Info.SeedCapability = enc.GetBytes(capsPath); + + //teleport.Info.SeedCapability = new byte[0]; IPAddress oIP = newRegionEndPoint.Address; byte[] byteIP = oIP.GetAddressBytes(); @@ -459,7 +469,7 @@ namespace OpenSim.Region.ClientStack ip += (uint)byteIP[2] << 16; ip += (uint)byteIP[1] << 8; ip += (uint)byteIP[0]; - + teleport.Info.SimIP = ip; teleport.Info.SimPort = (ushort)newRegionEndPoint.Port; teleport.Info.LocationID = 4;