Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork
commit
9efabe5e1e
|
@ -176,6 +176,7 @@ namespace OpenSim.Services.GridService
|
||||||
|
|
||||||
#region Link Region
|
#region Link Region
|
||||||
|
|
||||||
|
// from map search
|
||||||
public GridRegion LinkRegion(UUID scopeID, string regionDescriptor)
|
public GridRegion LinkRegion(UUID scopeID, string regionDescriptor)
|
||||||
{
|
{
|
||||||
string reason = string.Empty;
|
string reason = string.Empty;
|
||||||
|
@ -185,7 +186,7 @@ namespace OpenSim.Services.GridService
|
||||||
|
|
||||||
private static Random random = new Random();
|
private static Random random = new Random();
|
||||||
|
|
||||||
// From the command line link-region
|
// From the command line link-region (obsolete) and the map
|
||||||
public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, out string reason)
|
public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, out string reason)
|
||||||
{
|
{
|
||||||
return TryLinkRegionToCoords(scopeID, mapName, xloc, yloc, UUID.Zero, out reason);
|
return TryLinkRegionToCoords(scopeID, mapName, xloc, yloc, UUID.Zero, out reason);
|
||||||
|
@ -194,20 +195,55 @@ namespace OpenSim.Services.GridService
|
||||||
public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, UUID ownerID, out string reason)
|
public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, UUID ownerID, out string reason)
|
||||||
{
|
{
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
|
GridRegion regInfo = null;
|
||||||
|
|
||||||
|
if (!mapName.StartsWith("http"))
|
||||||
|
{
|
||||||
|
string host = "127.0.0.1";
|
||||||
|
string portstr;
|
||||||
|
string regionName = "";
|
||||||
uint port = 0;
|
uint port = 0;
|
||||||
string[] parts = mapName.Split(new char[] {':'});
|
string[] parts = mapName.Split(new char[] { ':' });
|
||||||
|
if (parts.Length >= 1)
|
||||||
|
{
|
||||||
|
host = parts[0];
|
||||||
|
}
|
||||||
|
if (parts.Length >= 2)
|
||||||
|
{
|
||||||
|
portstr = parts[1];
|
||||||
|
//m_log.Debug("-- port = " + portstr);
|
||||||
|
if (!UInt32.TryParse(portstr, out port))
|
||||||
|
regionName = parts[1];
|
||||||
|
}
|
||||||
|
// always take the last one
|
||||||
|
if (parts.Length >= 3)
|
||||||
|
{
|
||||||
|
regionName = parts[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, ownerID, out regInfo, out reason);
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
regInfo.RegionName = mapName;
|
||||||
|
return regInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] parts = mapName.Split(new char[] {' '});
|
||||||
string regionName = String.Empty;
|
string regionName = String.Empty;
|
||||||
if (parts.Length > 1)
|
if (parts.Length > 1)
|
||||||
{
|
{
|
||||||
regionName = mapName.Substring(parts[0].Length + 1);
|
regionName = mapName.Substring(parts[0].Length + 1);
|
||||||
regionName = regionName.Trim(new char[] {'"'});
|
regionName = regionName.Trim(new char[] {'"'});
|
||||||
}
|
}
|
||||||
GridRegion regInfo;
|
|
||||||
if (TryCreateLink(scopeID, xloc, yloc, regionName, 0, null, parts[0], ownerID, out regInfo, out reason))
|
if (TryCreateLink(scopeID, xloc, yloc, regionName, 0, null, parts[0], ownerID, out regInfo, out reason))
|
||||||
{
|
{
|
||||||
regInfo.RegionName = mapName;
|
regInfo.RegionName = mapName;
|
||||||
return regInfo;
|
return regInfo;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -219,7 +255,7 @@ namespace OpenSim.Services.GridService
|
||||||
|
|
||||||
public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason)
|
public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}, in {2}-{3}",
|
m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0} {1}, in {2}-{3}",
|
||||||
((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI),
|
((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI),
|
||||||
remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize);
|
remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize);
|
||||||
|
|
||||||
|
@ -342,7 +378,7 @@ namespace OpenSim.Services.GridService
|
||||||
regInfo.RegionSecret = handle.ToString();
|
regInfo.RegionSecret = handle.ToString();
|
||||||
|
|
||||||
AddHyperlinkRegion(regInfo, handle);
|
AddHyperlinkRegion(regInfo, handle);
|
||||||
m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID);
|
m_log.InfoFormat("[HYPERGRID LINKER]: Successfully linked to region {0} with image {1}", regInfo.RegionName, regInfo.TerrainImage);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue