Fixed a bug with link-region.
parent
b5163889b9
commit
dcfd08b8dd
|
@ -37,6 +37,7 @@ using OpenSim.Region.Framework.Interfaces;
|
|||
using OpenSim.Server.Base;
|
||||
using OpenSim.Server.Handlers.Base;
|
||||
using OpenSim.Server.Handlers.Grid;
|
||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid
|
||||
{
|
||||
|
@ -106,7 +107,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid
|
|||
//ServerUtils.LoadPlugin<HypergridServiceInConnector>("OpenSim.Server.Handlers.dll:HypergridServiceInConnector", args);
|
||||
}
|
||||
|
||||
SimpleRegionInfo rinfo = new SimpleRegionInfo(scene.RegionInfo);
|
||||
GridRegion rinfo = new GridRegion(scene.RegionInfo);
|
||||
m_HypergridHandler.AddRegion(rinfo);
|
||||
}
|
||||
|
||||
|
@ -115,7 +116,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid
|
|||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
SimpleRegionInfo rinfo = new SimpleRegionInfo(scene.RegionInfo);
|
||||
GridRegion rinfo = new GridRegion(scene.RegionInfo);
|
||||
m_HypergridHandler.RemoveRegion(rinfo);
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
|
||||
private void RunHGCommand(string command, string[] cmdparams)
|
||||
{
|
||||
if (command.Equals("linkk-mapping"))
|
||||
if (command.Equals("link-mapping"))
|
||||
{
|
||||
if (cmdparams.Length == 2)
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (command.Equals("linkk-region"))
|
||||
else if (command.Equals("link-region"))
|
||||
{
|
||||
if (cmdparams.Length < 3)
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
}
|
||||
return;
|
||||
}
|
||||
else if (command.Equals("unlinkk-region"))
|
||||
else if (command.Equals("unlink-region"))
|
||||
{
|
||||
if (cmdparams.Length < 1)
|
||||
{
|
||||
|
|
|
@ -159,27 +159,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
{
|
||||
m_HypergridServiceConnector = new HypergridServiceConnector(scene.AssetService);
|
||||
HGCommands hgCommands = new HGCommands(this, scene);
|
||||
MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "linkk-region",
|
||||
MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-region",
|
||||
"link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
|
||||
"Link a hypergrid region", hgCommands.RunCommand);
|
||||
MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "unlinkk-region",
|
||||
MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "unlink-region",
|
||||
"unlink-region <local name> or <HostName>:<HttpPort> <cr>",
|
||||
"Unlink a hypergrid region", hgCommands.RunCommand);
|
||||
MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "linkk-mapping", "link-mapping [<x> <y>] <cr>",
|
||||
MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
|
||||
"Set local coordinate to map HG regions to", hgCommands.RunCommand);
|
||||
m_Initialized = true;
|
||||
}
|
||||
|
||||
|
||||
//scene.AddCommand("HGGridServicesConnector", "linkk-region",
|
||||
// "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
|
||||
// "Link a hypergrid region", hgCommands.RunCommand);
|
||||
//scene.AddCommand("HGGridServicesConnector", "unlinkk-region",
|
||||
// "unlink-region <local name> or <HostName>:<HttpPort> <cr>",
|
||||
// "Unlink a hypergrid region", hgCommands.RunCommand);
|
||||
//scene.AddCommand("HGGridServicesConnector", "linkk-mapping", "link-mapping [<x> <y>] <cr>",
|
||||
// "Set local coordinate to map HG regions to", hgCommands.RunCommand);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -450,15 +439,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
}
|
||||
|
||||
// Finally, link it
|
||||
try
|
||||
{
|
||||
RegisterRegion(UUID.Zero, regInfo);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Warn("[HGrid]: Unable to link region: " + e.Message);
|
||||
return false;
|
||||
}
|
||||
if (!RegisterRegion(UUID.Zero, regInfo))
|
||||
{
|
||||
m_log.Warn("[HGrid]: Unable to link region");
|
||||
return false;
|
||||
}
|
||||
|
||||
int x, y;
|
||||
if (!Check4096(m_scene, regInfo, out x, out y))
|
||||
|
|
|
@ -36,6 +36,7 @@ using OpenSim.Server.Base;
|
|||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Server.Handlers.Base;
|
||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
using log4net;
|
||||
using Nwc.XmlRpc;
|
||||
|
@ -48,12 +49,12 @@ namespace OpenSim.Server.Handlers.Grid
|
|||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private List<SimpleRegionInfo> m_RegionsOnSim = new List<SimpleRegionInfo>();
|
||||
private List<GridRegion> m_RegionsOnSim = new List<GridRegion>();
|
||||
|
||||
public HypergridServiceInConnector(IConfigSource config, IHttpServer server) :
|
||||
base(config, server)
|
||||
{
|
||||
server.AddXmlRPCHandler("linkk_region", LinkRegionRequest, false);
|
||||
server.AddXmlRPCHandler("link_region", LinkRegionRequest, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -70,8 +71,8 @@ namespace OpenSim.Server.Handlers.Grid
|
|||
|
||||
m_log.DebugFormat("[HGrid]: Hyperlink request");
|
||||
|
||||
SimpleRegionInfo regInfo = null;
|
||||
foreach (SimpleRegionInfo r in m_RegionsOnSim)
|
||||
GridRegion regInfo = null;
|
||||
foreach (GridRegion r in m_RegionsOnSim)
|
||||
{
|
||||
if ((r.RegionName != null) && (name != null) && (r.RegionName.ToLower() == name.ToLower()))
|
||||
{
|
||||
|
@ -85,9 +86,9 @@ namespace OpenSim.Server.Handlers.Grid
|
|||
|
||||
Hashtable hash = new Hashtable();
|
||||
hash["uuid"] = regInfo.RegionID.ToString();
|
||||
m_log.Debug(">> Here " + regInfo.RegionID);
|
||||
hash["handle"] = regInfo.RegionHandle.ToString();
|
||||
//m_log.Debug(">> Here " + regInfo.RegionHandle);
|
||||
//hash["region_image"] = regInfo.RegionSettings.TerrainImageID.ToString();
|
||||
hash["region_image"] = regInfo.TerrainImage.ToString();
|
||||
hash["region_name"] = regInfo.RegionName;
|
||||
hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString();
|
||||
//m_log.Debug(">> Here: " + regInfo.InternalEndPoint.Port);
|
||||
|
@ -98,12 +99,12 @@ namespace OpenSim.Server.Handlers.Grid
|
|||
return response;
|
||||
}
|
||||
|
||||
public void AddRegion(SimpleRegionInfo rinfo)
|
||||
public void AddRegion(GridRegion rinfo)
|
||||
{
|
||||
m_RegionsOnSim.Add(rinfo);
|
||||
}
|
||||
|
||||
public void RemoveRegion(SimpleRegionInfo rinfo)
|
||||
public void RemoveRegion(GridRegion rinfo)
|
||||
{
|
||||
if (m_RegionsOnSim.Contains(rinfo))
|
||||
m_RegionsOnSim.Remove(rinfo);
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace OpenSim.Services.Connectors.Grid
|
|||
IList paramList = new ArrayList();
|
||||
paramList.Add(hash);
|
||||
|
||||
XmlRpcRequest request = new XmlRpcRequest("linkk_region", paramList);
|
||||
XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
|
||||
string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
|
||||
m_log.Debug("[HGrid]: Linking to " + uri);
|
||||
XmlRpcResponse response = request.Send(uri, 10000);
|
||||
|
@ -82,6 +82,7 @@ namespace OpenSim.Services.Connectors.Grid
|
|||
try
|
||||
{
|
||||
UUID.TryParse((string)hash["uuid"], out uuid);
|
||||
m_log.Debug(">> HERE, uuid: " + uuid);
|
||||
info.RegionID = uuid;
|
||||
if ((string)hash["handle"] != null)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue