Merge branch 'master' of /var/git/opensim/

viewer-2-initial-appearance
opensim mirror account 2010-10-22 15:40:08 -07:00
commit cc411bf5f3
10 changed files with 108 additions and 44 deletions

View File

@ -631,7 +631,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
IClientAPI client;
if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView))
{
//m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
return;
}

View File

@ -197,8 +197,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
sp.ControllingClient.SendTeleportFailed("Problem at destination");
return;
}
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} uuid={2}",
finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID);
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} {2}@{3}",
finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID, finalDestination.ServerURI);
// Check that these are not the same coordinates
if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX &&
@ -254,8 +254,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Request Teleport to {0}:{1}:{2}/{3}",
reg.ExternalHostName, reg.HttpPort, finalDestination.RegionName, position);
"[ENTITY TRANSFER MODULE]: Request Teleport to {0} ({1}) {2}/{3}",
reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
uint newRegionX = (uint)(reg.RegionHandle >> 40);
uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);

View File

@ -123,7 +123,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
{
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID);
return m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID);
GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID);
m_log.Debug("GetfinalDestination serveruri -> " + real_destination.ServerURI);
return real_destination;
}
return region;
}
@ -149,6 +151,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
{
m_log.Debug("CreateAgent " + reg.ServerURI + " " + finalDestination.ServerURI);
reason = string.Empty;
logout = false;
int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);

View File

@ -3738,9 +3738,12 @@ namespace OpenSim.Region.Framework.Scenes
// We have to wait until the viewer contacts this region after receiving EAC.
// That calls AddNewClient, which finally creates the ScenePresence
m_log.Debug("ICADU -> pre wait");
ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
m_log.Debug("ICADU -> post wait");
if (childAgentUpdate != null)
{
m_log.Debug("ICADU -> not child agent!");
childAgentUpdate.ChildAgentDataUpdate(cAgentData);
return true;
}
@ -3756,7 +3759,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>true if we handled it.</returns>
public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData)
{
//m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName);
m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName);
ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
if (childAgentUpdate != null)
{

View File

@ -2925,7 +2925,7 @@ namespace OpenSim.Region.Framework.Scenes
public void ChildAgentDataUpdate(AgentData cAgentData)
{
//m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName);
m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName);
if (!IsChildAgent)
return;

View File

@ -124,7 +124,8 @@ namespace OpenSim.Server.Handlers.Hypergrid
UUID uuid = UUID.Zero;
string regionname = string.Empty;
string gatekeeper_host = string.Empty;
string server_uri = string.Empty;
string gatekeeper_serveruri = string.Empty;
string destination_serveruri = string.Empty;
int gatekeeper_port = 0;
IPEndPoint client_ipaddress = null;
@ -132,8 +133,13 @@ namespace OpenSim.Server.Handlers.Hypergrid
gatekeeper_host = args["gatekeeper_host"].AsString();
if (args.ContainsKey("gatekeeper_port") && args["gatekeeper_port"] != null)
Int32.TryParse(args["gatekeeper_port"].AsString(), out gatekeeper_port);
if (args.ContainsKey("gatekeeper_serveruri") && args["gatekeeper_serveruri"] !=null)
gatekeeper_serveruri = args["gatekeeper_serveruri"];
if (args.ContainsKey("destination_serveruri") && args["destination_serveruri"] !=null)
destination_serveruri = args["destination_serveruri"];
GridRegion gatekeeper = new GridRegion();
gatekeeper.ServerURI = gatekeeper_serveruri;
gatekeeper.ExternalHostName = gatekeeper_host;
gatekeeper.HttpPort = (uint)gatekeeper_port;
gatekeeper.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
@ -174,8 +180,8 @@ namespace OpenSim.Server.Handlers.Hypergrid
destination.RegionLocX = x;
destination.RegionLocY = y;
destination.RegionName = regionname;
destination.ServerURI = destination_serveruri;
AgentCircuitData aCircuit = new AgentCircuitData();
try
{

View File

@ -116,19 +116,19 @@ namespace OpenSim.Services.Connectors.Hypergrid
if (success)
{
UUID.TryParse((string)hash["uuid"], out regionID);
//m_log.Debug(">> HERE, uuid: " + regionID);
m_log.Debug(">> HERE, uuid: " + regionID);
if ((string)hash["handle"] != null)
{
realHandle = Convert.ToUInt64((string)hash["handle"]);
//m_log.Debug(">> HERE, realHandle: " + realHandle);
m_log.Debug(">> HERE, realHandle: " + realHandle);
}
if (hash["region_image"] != null) {
imageURL = (string)hash["region_image"];
//m_log.Debug(">> HERE, imageURL: " + imageURL);
m_log.Debug(">> HERE, imageURL: " + imageURL);
}
if (hash["external_name"] != null) {
externalName = (string)hash["external_name"];
//m_log.Debug(">> HERE, externalName: " + externalName);
m_log.Debug(">> HERE, externalName: " + externalName);
}
}
@ -191,7 +191,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
paramList.Add(hash);
XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
//m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + gatekeeper.ServerURI);
m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + gatekeeper.ServerURI);
XmlRpcResponse response = null;
try
{
@ -199,7 +199,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
}
catch (Exception e)
{
//m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Exception " + e.Message);
m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Exception " + e.Message);
return null;
}
@ -221,41 +221,48 @@ namespace OpenSim.Services.Connectors.Hypergrid
GridRegion region = new GridRegion();
UUID.TryParse((string)hash["uuid"], out region.RegionID);
//m_log.Debug(">> HERE, uuid: " + region.RegionID);
m_log.Debug(">> HERE, uuid: " + region.RegionID);
int n = 0;
if (hash["x"] != null)
{
Int32.TryParse((string)hash["x"], out n);
region.RegionLocX = n;
//m_log.Debug(">> HERE, x: " + region.RegionLocX);
m_log.Debug(">> HERE, x: " + region.RegionLocX);
}
if (hash["y"] != null)
{
Int32.TryParse((string)hash["y"], out n);
region.RegionLocY = n;
//m_log.Debug(">> HERE, y: " + region.RegionLocY);
m_log.Debug(">> HERE, y: " + region.RegionLocY);
}
if (hash["region_name"] != null)
{
region.RegionName = (string)hash["region_name"];
//m_log.Debug(">> HERE, region_name: " + region.RegionName);
m_log.Debug(">> HERE, region_name: " + region.RegionName);
}
if (hash["hostname"] != null)
if (hash["hostname"] != null) {
region.ExternalHostName = (string)hash["hostname"];
//m_log.Debug(">> HERE, hostname: " + region.ExternalHostName);
m_log.Debug(">> HERE, hostname: " + region.ExternalHostName);
}
if (hash["http_port"] != null)
{
uint p = 0;
UInt32.TryParse((string)hash["http_port"], out p);
region.HttpPort = p;
//m_log.Debug(">> HERE, http_port: " + region.HttpPort);
m_log.Debug(">> HERE, http_port: " + region.HttpPort);
}
if (hash["internal_port"] != null)
{
int p = 0;
Int32.TryParse((string)hash["internal_port"], out p);
region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p);
//m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint);
m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint);
}
if (hash["server_uri"] != null)
{
region.ServerURI = (string) hash["server_uri"];
m_log.Debug(">> HERE, server_uri: " + region.ServerURI);
}
// Successful return

View File

@ -232,12 +232,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
m_log.Debug("[USER AGENT CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
}
// Add the input arguments
args["gatekeeper_serveruri"] = OSD.FromString(gatekeeper.ServerURI);
args["gatekeeper_host"] = OSD.FromString(gatekeeper.ExternalHostName);
args["gatekeeper_port"] = OSD.FromString(gatekeeper.HttpPort.ToString());
args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
args["destination_name"] = OSD.FromString(destination.RegionName);
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
args["destination_serveruri"] = OSD.FromString(destination.ServerURI);
// 10/3/2010
// I added the client_ip up to the regular AgentCircuitData, so this doesn't need to be here.

View File

@ -126,11 +126,12 @@ namespace OpenSim.Services.GridService
if (MainConsole.Instance != null)
{
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region",
"link-region <Xloc> <Yloc> <RegionIP> <RegionPort> [<RegionServerURI] [<RemoteRegionName>] <cr>",
"Link a hypergrid region", RunCommand);
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", "link-region <Xloc> <Yloc> <ServerURI> [<RemoteRegionName>]", "Link a HyperGrid Region", RunCommand);
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "legacy-link-region",
"legacy-link-region <Xloc> <Yloc> <RegionIP> <RegionPort> [<RemoteRegionName>]",
"Link a hypergrid region (deprecated)", RunCommand);
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region",
"unlink-region <local name> or <HostName>:<HttpPort> <cr>",
"unlink-region <local name>",
"Unlink a hypergrid region", RunCommand);
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
"Set local coordinate to map HG regions to", RunCommand);
@ -198,27 +199,33 @@ namespace OpenSim.Services.GridService
return null;
}
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);
}
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);
reason = string.Empty;
regInfo = new GridRegion();
regInfo.RegionName = externalRegionName;
regInfo.HttpPort = externalPort;
regInfo.ExternalHostName = externalHostName;
if ( externalPort > 0)
regInfo.HttpPort = externalPort;
else
regInfo.HttpPort = 0;
if ( externalHostName != null)
regInfo.ExternalHostName = externalHostName;
else
regInfo.ExternalHostName = "0.0.0.0";
if ( serverURI != null)
regInfo.ServerURI = serverURI;
regInfo.RegionLocX = xloc;
regInfo.RegionLocY = yloc;
regInfo.ScopeID = scopeID;
// Big HACK for Simian Grid !!!
// We need to clean up all URLs used in OpenSim !!!
if (externalHostName.Contains("/")) {
regInfo.ServerURI = externalHostName;
} else {
regInfo.ServerURI = "http://" + externalHostName + ":" + externalPort.ToString();
}
try
{
regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0);
@ -249,9 +256,14 @@ namespace OpenSim.Services.GridService
}
regInfo.RegionID = regionID;
if (regInfo.RegionName == string.Empty)
regInfo.RegionName = regInfo.ExternalHostName;
if ( externalName == string.Empty )
regInfo.RegionName = regInfo.ServerURI;
else
regInfo.RegionName = externalName;
m_log.Debug("naming linked region " + regInfo.RegionName);
// Try get the map image
//regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
// I need a texture that works for this... the one I tried doesn't seem to be working
@ -433,6 +445,21 @@ namespace OpenSim.Services.GridService
RunHGCommand(command, cmdparams);
}
private void RunLinkRegionCommand(string[] cmdparams)
{
int xloc, yloc;
string serverURI;
string remoteName = null;
xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize;
yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize;
serverURI = cmdparams[2];
if (cmdparams.Length == 4)
remoteName = cmdparams[3];
string reason = string.Empty;
GridRegion regInfo;
TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, out regInfo, out reason);
}
private void RunHGCommand(string command, string[] cmdparams)
{
@ -455,6 +482,18 @@ namespace OpenSim.Services.GridService
}
}
else if (command.Equals("link-region"))
{
if (cmdparams.Length > 0 && cmdparams.Length < 5)
{
RunLinkRegionCommand(cmdparams);
}
else
{
LinkRegionCmdUsage();
}
return;
}
else if (command.Equals("legacy-link-region"))
{
if (cmdparams.Length < 3)
{

View File

@ -134,12 +134,14 @@ namespace OpenSim.Services.HypergridService
public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason)
{
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 );
agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI);
m_log.Debug("LATG final server uri -> " + finalDestination.ServerURI );
// Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
GridRegion region = new GridRegion(gatekeeper);
region.ServerURI = gatekeeper.ServerURI;
region.ExternalHostName = finalDestination.ExternalHostName;
region.InternalEndPoint = finalDestination.InternalEndPoint;
region.RegionName = finalDestination.RegionName;
region.RegionID = finalDestination.RegionID;
region.RegionLocX = finalDestination.RegionLocX;
@ -149,6 +151,8 @@ namespace OpenSim.Services.HypergridService
agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random();
TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region);
m_log.Debug("region ServerURI -> " + region.ServerURI);
bool success = false;
string myExternalIP = string.Empty;
string gridName = gatekeeper.ServerURI;