parent
							
								
									cddcb53b17
								
							
						
					
					
						commit
						a490b34b6e
					
				| 
						 | 
				
			
			@ -41,7 +41,7 @@ namespace OpenSim.Framework.Capabilities
 | 
			
		|||
        /// <returns></returns>
 | 
			
		||||
        public static string GetCapsSeedPath(string capsObjectPath)
 | 
			
		||||
        {
 | 
			
		||||
            return "CAPS/" + capsObjectPath + "0000/";
 | 
			
		||||
            return "/CAPS/" + capsObjectPath + "0000/";
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,13 +115,7 @@ namespace OpenSim.Framework
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        public string ServerURI
 | 
			
		||||
        {
 | 
			
		||||
            get { 
 | 
			
		||||
                if ( m_serverURI != string.Empty ) {
 | 
			
		||||
                    return m_serverURI;
 | 
			
		||||
                } else {
 | 
			
		||||
                    return "http://" + m_externalHostName + ":" + m_httpPort + "/";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            get { return m_serverURI; }
 | 
			
		||||
            set { 
 | 
			
		||||
                if ( value.EndsWith("/") ) {
 | 
			
		||||
                    m_serverURI = value;
 | 
			
		||||
| 
						 | 
				
			
			@ -153,7 +147,6 @@ namespace OpenSim.Framework
 | 
			
		|||
 | 
			
		||||
        public SimpleRegionInfo()
 | 
			
		||||
        {
 | 
			
		||||
            m_serverURI = string.Empty;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
 | 
			
		||||
| 
						 | 
				
			
			@ -163,7 +156,6 @@ namespace OpenSim.Framework
 | 
			
		|||
 | 
			
		||||
            m_internalEndPoint = internalEndPoint;
 | 
			
		||||
            m_externalHostName = externalUri;
 | 
			
		||||
            m_serverURI = string.Empty;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
 | 
			
		||||
| 
						 | 
				
			
			@ -174,7 +166,6 @@ namespace OpenSim.Framework
 | 
			
		|||
            m_externalHostName = externalUri;
 | 
			
		||||
 | 
			
		||||
            m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
 | 
			
		||||
            m_serverURI = string.Empty;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public SimpleRegionInfo(RegionInfo ConvertFrom)
 | 
			
		||||
| 
						 | 
				
			
			@ -464,7 +455,6 @@ namespace OpenSim.Framework
 | 
			
		|||
            configMember =
 | 
			
		||||
                new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
 | 
			
		||||
            configMember.performConfigurationRetrieve();
 | 
			
		||||
            m_serverURI = string.Empty;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
 | 
			
		||||
| 
						 | 
				
			
			@ -474,12 +464,10 @@ namespace OpenSim.Framework
 | 
			
		|||
 | 
			
		||||
            m_internalEndPoint = internalEndPoint;
 | 
			
		||||
            m_externalHostName = externalUri;
 | 
			
		||||
            m_serverURI = string.Empty;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public RegionInfo()
 | 
			
		||||
        {
 | 
			
		||||
            m_serverURI = string.Empty;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public EstateSettings EstateSettings
 | 
			
		||||
| 
						 | 
				
			
			@ -569,23 +557,10 @@ namespace OpenSim.Framework
 | 
			
		|||
        /// <summary>
 | 
			
		||||
        /// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        
 | 
			
		||||
        public string ServerURI
 | 
			
		||||
        {
 | 
			
		||||
            get { 
 | 
			
		||||
                if ( m_serverURI != string.Empty ) {
 | 
			
		||||
                    return m_serverURI;
 | 
			
		||||
                } else {
 | 
			
		||||
                    return "http://" + m_externalHostName + ":" + m_httpPort + "/";
 | 
			
		||||
                }
 | 
			
		||||
            }            
 | 
			
		||||
            set { 
 | 
			
		||||
                if ( value.EndsWith("/") ) {
 | 
			
		||||
                    m_serverURI = value;
 | 
			
		||||
                } else {
 | 
			
		||||
                    m_serverURI = value + '/';
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            get { return m_serverURI; }
 | 
			
		||||
            set { m_serverURI = value; }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public string RegionName
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -327,21 +327,34 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
 | 
			
		|||
 | 
			
		||||
                // OK, it got this agent. Let's close some child agents
 | 
			
		||||
                sp.CloseChildAgents(newRegionX, newRegionY);
 | 
			
		||||
                IClientIPEndpoint ipepClient;  
 | 
			
		||||
 | 
			
		||||
                if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY))
 | 
			
		||||
                {
 | 
			
		||||
                    //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
 | 
			
		||||
 | 
			
		||||
                    #region IP Translation for NAT
 | 
			
		||||
                    // Uses ipepClient above
 | 
			
		||||
                    IClientIPEndpoint ipepClient;
 | 
			
		||||
                    if (sp.ClientView.TryGet(out ipepClient))
 | 
			
		||||
                    {
 | 
			
		||||
                        endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
 | 
			
		||||
                        capsPath
 | 
			
		||||
                            = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
 | 
			
		||||
                    }
 | 
			
		||||
                    #endregion
 | 
			
		||||
                    capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
 | 
			
		||||
 | 
			
		||||
                    if (eq != null)
 | 
			
		||||
                    {
 | 
			
		||||
                        #region IP Translation for NAT
 | 
			
		||||
                        // Uses ipepClient above
 | 
			
		||||
                        if (sp.ClientView.TryGet(out ipepClient))
 | 
			
		||||
                        {
 | 
			
		||||
                            endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
 | 
			
		||||
                        }
 | 
			
		||||
                        #endregion
 | 
			
		||||
 | 
			
		||||
                        eq.EnableSimulator(destinationHandle, endPoint, sp.UUID);
 | 
			
		||||
 | 
			
		||||
                        // ES makes the client send a UseCircuitCode message to the destination, 
 | 
			
		||||
| 
						 | 
				
			
			@ -360,7 +373,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
 | 
			
		|||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
 | 
			
		||||
                    capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
 | 
			
		||||
                    capsPath = finalDestination.ServerURI + "/CAPS/" + agentCircuit.CapsPath + "0000/";
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                // Expect avatar crossing is a heavy-duty function at the destination.
 | 
			
		||||
| 
						 | 
				
			
			@ -493,8 +506,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
 | 
			
		|||
 | 
			
		||||
        protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
 | 
			
		||||
        {
 | 
			
		||||
            agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
 | 
			
		||||
            m_log.Debug("Set callback URL to " + agent.CallbackURI);
 | 
			
		||||
            agent.CallbackURI = region.ServerURI + "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -820,7 +832,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
 | 
			
		|||
                if (isFlying)
 | 
			
		||||
                    cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
 | 
			
		||||
                cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
 | 
			
		||||
                    "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
 | 
			
		||||
                    "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
 | 
			
		||||
 | 
			
		||||
                if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
 | 
			
		||||
                {
 | 
			
		||||
| 
						 | 
				
			
			@ -845,7 +857,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
 | 
			
		|||
                                     neighbourRegion.RegionHandle);
 | 
			
		||||
                    return agent;
 | 
			
		||||
                }
 | 
			
		||||
                string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
 | 
			
		||||
                // TODO Should construct this behind a method
 | 
			
		||||
                string capsPath =
 | 
			
		||||
                    neighbourRegion.ServerURI + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
 | 
			
		||||
 | 
			
		||||
                m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1164,7 +1178,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
 | 
			
		|||
            y = y / Constants.RegionSize;
 | 
			
		||||
            m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")");
 | 
			
		||||
 | 
			
		||||
            string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath);
 | 
			
		||||
            string capsPath = reg.ServerURI + "/CAPS/" + a.CapsPath + "0000/";
 | 
			
		||||
 | 
			
		||||
            string reason = String.Empty;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -595,12 +595,12 @@ namespace OpenSim.Region.CoreModules.InterGrid
 | 
			
		|||
            // DEPRECATED
 | 
			
		||||
            responseMap["seed_capability"] 
 | 
			
		||||
                = OSD.FromString(
 | 
			
		||||
                    regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
 | 
			
		||||
                    regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
 | 
			
		||||
            
 | 
			
		||||
            // REPLACEMENT
 | 
			
		||||
            responseMap["region_seed_capability"] 
 | 
			
		||||
                = OSD.FromString(
 | 
			
		||||
                    regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
 | 
			
		||||
                    regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
 | 
			
		||||
 | 
			
		||||
            responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath);
 | 
			
		||||
            responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -124,7 +124,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
 | 
			
		|||
            UUID uuid = UUID.Zero;
 | 
			
		||||
            string regionname = string.Empty;
 | 
			
		||||
            string gatekeeper_host = string.Empty;
 | 
			
		||||
            string server_uri = string.Empty;
 | 
			
		||||
            int gatekeeper_port = 0;
 | 
			
		||||
            IPEndPoint client_ipaddress = null;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -174,7 +173,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
 | 
			
		|||
            destination.RegionLocX = x;
 | 
			
		||||
            destination.RegionLocY = y;
 | 
			
		||||
            destination.RegionName = regionname;
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            AgentCircuitData aCircuit = new AgentCircuitData();
 | 
			
		||||
            try
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -198,7 +198,20 @@ namespace OpenSim.Services.GridService
 | 
			
		|||
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, string serverURI, out GridRegion regInfo, out string reason)
 | 
			
		||||
        {
 | 
			
		||||
            return TryCreateLink(scopeID, xloc, yloc, externalRegionName, 0, null, serverURI, out regInfo, out reason);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason)
 | 
			
		||||
        {
 | 
			
		||||
            return TryCreateLink(scopeID, xloc, yloc, externalRegionName, externalPort, externalHostName, null, out regInfo, out reason);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // From the command line and the 2 above
 | 
			
		||||
        public bool TryCreateLink(UUID scopeID, int xloc, int yloc,
 | 
			
		||||
            string externalRegionName, uint externalPort, string externalHostName, string serverURI, out GridRegion regInfo, out string reason)
 | 
			
		||||
        {
 | 
			
		||||
            m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -213,11 +226,8 @@ namespace OpenSim.Services.GridService
 | 
			
		|||
 | 
			
		||||
            // Big HACK for Simian Grid !!!
 | 
			
		||||
            // We need to clean up all URLs used in OpenSim !!!
 | 
			
		||||
            if (externalHostName.Contains("/")) {
 | 
			
		||||
            if (externalHostName.Contains("/"))
 | 
			
		||||
                regInfo.ServerURI = externalHostName;
 | 
			
		||||
            } else {
 | 
			
		||||
                regInfo.ServerURI = "http://" + externalHostName + ":" + externalPort.ToString();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -136,7 +136,6 @@ namespace OpenSim.Services.HypergridService
 | 
			
		|||
            m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", 
 | 
			
		||||
                agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), 
 | 
			
		||||
                gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort);
 | 
			
		||||
            m_log.Debug("gatekeeper serveruri -> " + gatekeeper.ServerURI );
 | 
			
		||||
 | 
			
		||||
            // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
 | 
			
		||||
            GridRegion region = new GridRegion(gatekeeper);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,13 +115,7 @@ namespace OpenSim.Services.Interfaces
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        public string ServerURI
 | 
			
		||||
        {
 | 
			
		||||
            get { 
 | 
			
		||||
                if ( m_serverURI != string.Empty ) {
 | 
			
		||||
                    return m_serverURI;
 | 
			
		||||
                } else {
 | 
			
		||||
                    return "http://" + m_externalHostName + ":" + m_httpPort + "/";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            get { return m_serverURI; }
 | 
			
		||||
            set { 
 | 
			
		||||
                if ( value.EndsWith("/") ) {
 | 
			
		||||
                    m_serverURI = value;
 | 
			
		||||
| 
						 | 
				
			
			@ -176,7 +170,6 @@ namespace OpenSim.Services.Interfaces
 | 
			
		|||
 | 
			
		||||
        public GridRegion()
 | 
			
		||||
        {
 | 
			
		||||
            m_serverURI = string.Empty;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue