aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs36
1 files changed, 22 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs
index 2a862d4..36915ef 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs
@@ -37,6 +37,7 @@ using OpenSim.Framework.Console;
37using OpenSim.Region.Framework; 37using OpenSim.Region.Framework;
38using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Region.Framework.Scenes.Hypergrid; 39using OpenSim.Region.Framework.Scenes.Hypergrid;
40using GridRegion = OpenSim.Services.Interfaces.GridRegion;
40 41
41namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid 42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
42{ 43{
@@ -121,12 +122,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
121 if (cmdparams[2].Contains(":")) 122 if (cmdparams[2].Contains(":"))
122 { 123 {
123 // New format 124 // New format
124 uint xloc, yloc; 125 int xloc, yloc;
125 string mapName; 126 string mapName;
126 try 127 try
127 { 128 {
128 xloc = Convert.ToUInt32(cmdparams[0]); 129 xloc = Convert.ToInt32(cmdparams[0]);
129 yloc = Convert.ToUInt32(cmdparams[1]); 130 yloc = Convert.ToInt32(cmdparams[1]);
130 mapName = cmdparams[2]; 131 mapName = cmdparams[2];
131 if (cmdparams.Length > 3) 132 if (cmdparams.Length > 3)
132 for (int i = 3; i < cmdparams.Length; i++) 133 for (int i = 3; i < cmdparams.Length; i++)
@@ -143,19 +144,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
143 return; 144 return;
144 } 145 }
145 146
147 // Convert cell coordinates given by the user to meters
148 xloc = xloc * (int)Constants.RegionSize;
149 yloc = yloc * (int)Constants.RegionSize;
146 m_HGGridConnector.TryLinkRegionToCoords(m_scene, null, mapName, xloc, yloc); 150 m_HGGridConnector.TryLinkRegionToCoords(m_scene, null, mapName, xloc, yloc);
147 } 151 }
148 else 152 else
149 { 153 {
150 // old format 154 // old format
151 SimpleRegionInfo regInfo; 155 GridRegion regInfo;
152 uint xloc, yloc; 156 int xloc, yloc;
153 uint externalPort; 157 uint externalPort;
154 string externalHostName; 158 string externalHostName;
155 try 159 try
156 { 160 {
157 xloc = Convert.ToUInt32(cmdparams[0]); 161 xloc = Convert.ToInt32(cmdparams[0]);
158 yloc = Convert.ToUInt32(cmdparams[1]); 162 yloc = Convert.ToInt32(cmdparams[1]);
159 externalPort = Convert.ToUInt32(cmdparams[3]); 163 externalPort = Convert.ToUInt32(cmdparams[3]);
160 externalHostName = cmdparams[2]; 164 externalHostName = cmdparams[2];
161 //internalPort = Convert.ToUInt32(cmdparams[4]); 165 //internalPort = Convert.ToUInt32(cmdparams[4]);
@@ -168,7 +172,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
168 return; 172 return;
169 } 173 }
170 174
171 //if (TryCreateLink(xloc, yloc, externalPort, externalHostName, out regInfo)) 175 // Convert cell coordinates given by the user to meters
176 xloc = xloc * (int)Constants.RegionSize;
177 yloc = yloc * (int)Constants.RegionSize;
172 if (m_HGGridConnector.TryCreateLink(m_scene, null, xloc, yloc, "", externalPort, externalHostName, out regInfo)) 178 if (m_HGGridConnector.TryCreateLink(m_scene, null, xloc, yloc, "", externalPort, externalHostName, out regInfo))
173 { 179 {
174 if (cmdparams.Length >= 5) 180 if (cmdparams.Length >= 5)
@@ -245,14 +251,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
245 251
246 private void ReadLinkFromConfig(IConfig config) 252 private void ReadLinkFromConfig(IConfig config)
247 { 253 {
248 SimpleRegionInfo regInfo; 254 GridRegion regInfo;
249 uint xloc, yloc; 255 int xloc, yloc;
250 uint externalPort; 256 uint externalPort;
251 string externalHostName; 257 string externalHostName;
252 uint realXLoc, realYLoc; 258 uint realXLoc, realYLoc;
253 259
254 xloc = Convert.ToUInt32(config.GetString("xloc", "0")); 260 xloc = Convert.ToInt32(config.GetString("xloc", "0"));
255 yloc = Convert.ToUInt32(config.GetString("yloc", "0")); 261 yloc = Convert.ToInt32(config.GetString("yloc", "0"));
256 externalPort = Convert.ToUInt32(config.GetString("externalPort", "0")); 262 externalPort = Convert.ToUInt32(config.GetString("externalPort", "0"));
257 externalHostName = config.GetString("externalHostName", ""); 263 externalHostName = config.GetString("externalHostName", "");
258 realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0")); 264 realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0"));
@@ -260,14 +266,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
260 266
261 if (m_enableAutoMapping) 267 if (m_enableAutoMapping)
262 { 268 {
263 xloc = (uint)((xloc % 100) + m_autoMappingX); 269 xloc = (int)((xloc % 100) + m_autoMappingX);
264 yloc = (uint)((yloc % 100) + m_autoMappingY); 270 yloc = (int)((yloc % 100) + m_autoMappingY);
265 } 271 }
266 272
267 if (((realXLoc == 0) && (realYLoc == 0)) || 273 if (((realXLoc == 0) && (realYLoc == 0)) ||
268 (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) && 274 (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) &&
269 ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896)))) 275 ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896))))
270 { 276 {
277 xloc = xloc * (int)Constants.RegionSize;
278 yloc = yloc * (int)Constants.RegionSize;
271 if ( 279 if (
272 m_HGGridConnector.TryCreateLink(m_scene, null, xloc, yloc, "", externalPort, 280 m_HGGridConnector.TryCreateLink(m_scene, null, xloc, yloc, "", externalPort,
273 externalHostName, out regInfo)) 281 externalHostName, out regInfo))