diff options
author | Diva Canto | 2009-09-26 11:01:18 -0700 |
---|---|---|
committer | Diva Canto | 2009-09-26 11:01:18 -0700 |
commit | dcfd08b8dd57e667db8e0b5900da4648a020160e (patch) | |
tree | 48bc721a24e861549417b228c526382d36ad98a3 /OpenSim | |
parent | Fixed the order of params to GetRegionRange. (diff) | |
download | opensim-SC-dcfd08b8dd57e667db8e0b5900da4648a020160e.zip opensim-SC-dcfd08b8dd57e667db8e0b5900da4648a020160e.tar.gz opensim-SC-dcfd08b8dd57e667db8e0b5900da4648a020160e.tar.bz2 opensim-SC-dcfd08b8dd57e667db8e0b5900da4648a020160e.tar.xz |
Fixed a bug with link-region.
Diffstat (limited to 'OpenSim')
5 files changed, 25 insertions, 37 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs index 4fbee7f..41f96b3 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs | |||
@@ -37,6 +37,7 @@ using OpenSim.Region.Framework.Interfaces; | |||
37 | using OpenSim.Server.Base; | 37 | using OpenSim.Server.Base; |
38 | using OpenSim.Server.Handlers.Base; | 38 | using OpenSim.Server.Handlers.Base; |
39 | using OpenSim.Server.Handlers.Grid; | 39 | using OpenSim.Server.Handlers.Grid; |
40 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid |
42 | { | 43 | { |
@@ -106,7 +107,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid | |||
106 | //ServerUtils.LoadPlugin<HypergridServiceInConnector>("OpenSim.Server.Handlers.dll:HypergridServiceInConnector", args); | 107 | //ServerUtils.LoadPlugin<HypergridServiceInConnector>("OpenSim.Server.Handlers.dll:HypergridServiceInConnector", args); |
107 | } | 108 | } |
108 | 109 | ||
109 | SimpleRegionInfo rinfo = new SimpleRegionInfo(scene.RegionInfo); | 110 | GridRegion rinfo = new GridRegion(scene.RegionInfo); |
110 | m_HypergridHandler.AddRegion(rinfo); | 111 | m_HypergridHandler.AddRegion(rinfo); |
111 | } | 112 | } |
112 | 113 | ||
@@ -115,7 +116,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid | |||
115 | if (!m_Enabled) | 116 | if (!m_Enabled) |
116 | return; | 117 | return; |
117 | 118 | ||
118 | SimpleRegionInfo rinfo = new SimpleRegionInfo(scene.RegionInfo); | 119 | GridRegion rinfo = new GridRegion(scene.RegionInfo); |
119 | m_HypergridHandler.RemoveRegion(rinfo); | 120 | m_HypergridHandler.RemoveRegion(rinfo); |
120 | } | 121 | } |
121 | 122 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs index 36915ef..0974372 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs | |||
@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
86 | 86 | ||
87 | private void RunHGCommand(string command, string[] cmdparams) | 87 | private void RunHGCommand(string command, string[] cmdparams) |
88 | { | 88 | { |
89 | if (command.Equals("linkk-mapping")) | 89 | if (command.Equals("link-mapping")) |
90 | { | 90 | { |
91 | if (cmdparams.Length == 2) | 91 | if (cmdparams.Length == 2) |
92 | { | 92 | { |
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
104 | } | 104 | } |
105 | } | 105 | } |
106 | } | 106 | } |
107 | else if (command.Equals("linkk-region")) | 107 | else if (command.Equals("link-region")) |
108 | { | 108 | { |
109 | if (cmdparams.Length < 3) | 109 | if (cmdparams.Length < 3) |
110 | { | 110 | { |
@@ -187,7 +187,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
187 | } | 187 | } |
188 | return; | 188 | return; |
189 | } | 189 | } |
190 | else if (command.Equals("unlinkk-region")) | 190 | else if (command.Equals("unlink-region")) |
191 | { | 191 | { |
192 | if (cmdparams.Length < 1) | 192 | if (cmdparams.Length < 1) |
193 | { | 193 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs index 66cde91..0bb4206 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | |||
@@ -159,27 +159,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
159 | { | 159 | { |
160 | m_HypergridServiceConnector = new HypergridServiceConnector(scene.AssetService); | 160 | m_HypergridServiceConnector = new HypergridServiceConnector(scene.AssetService); |
161 | HGCommands hgCommands = new HGCommands(this, scene); | 161 | HGCommands hgCommands = new HGCommands(this, scene); |
162 | MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "linkk-region", | 162 | MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-region", |
163 | "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", | 163 | "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", |
164 | "Link a hypergrid region", hgCommands.RunCommand); | 164 | "Link a hypergrid region", hgCommands.RunCommand); |
165 | MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "unlinkk-region", | 165 | MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "unlink-region", |
166 | "unlink-region <local name> or <HostName>:<HttpPort> <cr>", | 166 | "unlink-region <local name> or <HostName>:<HttpPort> <cr>", |
167 | "Unlink a hypergrid region", hgCommands.RunCommand); | 167 | "Unlink a hypergrid region", hgCommands.RunCommand); |
168 | MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "linkk-mapping", "link-mapping [<x> <y>] <cr>", | 168 | MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-mapping", "link-mapping [<x> <y>] <cr>", |
169 | "Set local coordinate to map HG regions to", hgCommands.RunCommand); | 169 | "Set local coordinate to map HG regions to", hgCommands.RunCommand); |
170 | m_Initialized = true; | 170 | m_Initialized = true; |
171 | } | 171 | } |
172 | |||
173 | |||
174 | //scene.AddCommand("HGGridServicesConnector", "linkk-region", | ||
175 | // "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", | ||
176 | // "Link a hypergrid region", hgCommands.RunCommand); | ||
177 | //scene.AddCommand("HGGridServicesConnector", "unlinkk-region", | ||
178 | // "unlink-region <local name> or <HostName>:<HttpPort> <cr>", | ||
179 | // "Unlink a hypergrid region", hgCommands.RunCommand); | ||
180 | //scene.AddCommand("HGGridServicesConnector", "linkk-mapping", "link-mapping [<x> <y>] <cr>", | ||
181 | // "Set local coordinate to map HG regions to", hgCommands.RunCommand); | ||
182 | |||
183 | } | 172 | } |
184 | 173 | ||
185 | #endregion | 174 | #endregion |
@@ -450,15 +439,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
450 | } | 439 | } |
451 | 440 | ||
452 | // Finally, link it | 441 | // Finally, link it |
453 | try | 442 | if (!RegisterRegion(UUID.Zero, regInfo)) |
454 | { | 443 | { |
455 | RegisterRegion(UUID.Zero, regInfo); | 444 | m_log.Warn("[HGrid]: Unable to link region"); |
456 | } | 445 | return false; |
457 | catch (Exception e) | 446 | } |
458 | { | ||
459 | m_log.Warn("[HGrid]: Unable to link region: " + e.Message); | ||
460 | return false; | ||
461 | } | ||
462 | 447 | ||
463 | int x, y; | 448 | int x, y; |
464 | if (!Check4096(m_scene, regInfo, out x, out y)) | 449 | if (!Check4096(m_scene, regInfo, out x, out y)) |
diff --git a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs index ad63485..d2e791b 100644 --- a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs +++ b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs | |||
@@ -36,6 +36,7 @@ using OpenSim.Server.Base; | |||
36 | using OpenSim.Services.Interfaces; | 36 | using OpenSim.Services.Interfaces; |
37 | using OpenSim.Framework.Servers.HttpServer; | 37 | using OpenSim.Framework.Servers.HttpServer; |
38 | using OpenSim.Server.Handlers.Base; | 38 | using OpenSim.Server.Handlers.Base; |
39 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
39 | 40 | ||
40 | using log4net; | 41 | using log4net; |
41 | using Nwc.XmlRpc; | 42 | using Nwc.XmlRpc; |
@@ -48,12 +49,12 @@ namespace OpenSim.Server.Handlers.Grid | |||
48 | LogManager.GetLogger( | 49 | LogManager.GetLogger( |
49 | MethodBase.GetCurrentMethod().DeclaringType); | 50 | MethodBase.GetCurrentMethod().DeclaringType); |
50 | 51 | ||
51 | private List<SimpleRegionInfo> m_RegionsOnSim = new List<SimpleRegionInfo>(); | 52 | private List<GridRegion> m_RegionsOnSim = new List<GridRegion>(); |
52 | 53 | ||
53 | public HypergridServiceInConnector(IConfigSource config, IHttpServer server) : | 54 | public HypergridServiceInConnector(IConfigSource config, IHttpServer server) : |
54 | base(config, server) | 55 | base(config, server) |
55 | { | 56 | { |
56 | server.AddXmlRPCHandler("linkk_region", LinkRegionRequest, false); | 57 | server.AddXmlRPCHandler("link_region", LinkRegionRequest, false); |
57 | } | 58 | } |
58 | 59 | ||
59 | /// <summary> | 60 | /// <summary> |
@@ -70,8 +71,8 @@ namespace OpenSim.Server.Handlers.Grid | |||
70 | 71 | ||
71 | m_log.DebugFormat("[HGrid]: Hyperlink request"); | 72 | m_log.DebugFormat("[HGrid]: Hyperlink request"); |
72 | 73 | ||
73 | SimpleRegionInfo regInfo = null; | 74 | GridRegion regInfo = null; |
74 | foreach (SimpleRegionInfo r in m_RegionsOnSim) | 75 | foreach (GridRegion r in m_RegionsOnSim) |
75 | { | 76 | { |
76 | if ((r.RegionName != null) && (name != null) && (r.RegionName.ToLower() == name.ToLower())) | 77 | if ((r.RegionName != null) && (name != null) && (r.RegionName.ToLower() == name.ToLower())) |
77 | { | 78 | { |
@@ -85,9 +86,9 @@ namespace OpenSim.Server.Handlers.Grid | |||
85 | 86 | ||
86 | Hashtable hash = new Hashtable(); | 87 | Hashtable hash = new Hashtable(); |
87 | hash["uuid"] = regInfo.RegionID.ToString(); | 88 | hash["uuid"] = regInfo.RegionID.ToString(); |
89 | m_log.Debug(">> Here " + regInfo.RegionID); | ||
88 | hash["handle"] = regInfo.RegionHandle.ToString(); | 90 | hash["handle"] = regInfo.RegionHandle.ToString(); |
89 | //m_log.Debug(">> Here " + regInfo.RegionHandle); | 91 | hash["region_image"] = regInfo.TerrainImage.ToString(); |
90 | //hash["region_image"] = regInfo.RegionSettings.TerrainImageID.ToString(); | ||
91 | hash["region_name"] = regInfo.RegionName; | 92 | hash["region_name"] = regInfo.RegionName; |
92 | hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString(); | 93 | hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString(); |
93 | //m_log.Debug(">> Here: " + regInfo.InternalEndPoint.Port); | 94 | //m_log.Debug(">> Here: " + regInfo.InternalEndPoint.Port); |
@@ -98,12 +99,12 @@ namespace OpenSim.Server.Handlers.Grid | |||
98 | return response; | 99 | return response; |
99 | } | 100 | } |
100 | 101 | ||
101 | public void AddRegion(SimpleRegionInfo rinfo) | 102 | public void AddRegion(GridRegion rinfo) |
102 | { | 103 | { |
103 | m_RegionsOnSim.Add(rinfo); | 104 | m_RegionsOnSim.Add(rinfo); |
104 | } | 105 | } |
105 | 106 | ||
106 | public void RemoveRegion(SimpleRegionInfo rinfo) | 107 | public void RemoveRegion(GridRegion rinfo) |
107 | { | 108 | { |
108 | if (m_RegionsOnSim.Contains(rinfo)) | 109 | if (m_RegionsOnSim.Contains(rinfo)) |
109 | m_RegionsOnSim.Remove(rinfo); | 110 | m_RegionsOnSim.Remove(rinfo); |
diff --git a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs index b5e8743..cf17557 100644 --- a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Services.Connectors.Grid | |||
66 | IList paramList = new ArrayList(); | 66 | IList paramList = new ArrayList(); |
67 | paramList.Add(hash); | 67 | paramList.Add(hash); |
68 | 68 | ||
69 | XmlRpcRequest request = new XmlRpcRequest("linkk_region", paramList); | 69 | XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); |
70 | string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; | 70 | string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; |
71 | m_log.Debug("[HGrid]: Linking to " + uri); | 71 | m_log.Debug("[HGrid]: Linking to " + uri); |
72 | XmlRpcResponse response = request.Send(uri, 10000); | 72 | XmlRpcResponse response = request.Send(uri, 10000); |
@@ -82,6 +82,7 @@ namespace OpenSim.Services.Connectors.Grid | |||
82 | try | 82 | try |
83 | { | 83 | { |
84 | UUID.TryParse((string)hash["uuid"], out uuid); | 84 | UUID.TryParse((string)hash["uuid"], out uuid); |
85 | m_log.Debug(">> HERE, uuid: " + uuid); | ||
85 | info.RegionID = uuid; | 86 | info.RegionID = uuid; |
86 | if ((string)hash["handle"] != null) | 87 | if ((string)hash["handle"] != null) |
87 | { | 88 | { |