Added support so that during the loading of a xml link list, it checks if a linked hypergrid region's real location is within 4096,4096 map spaces of its "local" location. If it is outside of that range ( so it wouldn't be possible to teleport to it) then it ignores it and doesn't create a link.

See the hypergrid wiki page for more details.
0.6.2-post-fixes
MW 2009-01-16 17:56:44 +00:00
parent eb5a022981
commit e21b3bf390
1 changed files with 8 additions and 2 deletions

View File

@ -267,11 +267,14 @@ namespace OpenSim
uint xloc, yloc;
uint externalPort;
string externalHostName;
uint realXLoc, realYLoc;
xloc = Convert.ToUInt32(config.GetString("xloc", "0"));
yloc = Convert.ToUInt32(config.GetString("yloc", "0"));
externalPort = Convert.ToUInt32(config.GetString("externalPort", "0"));
externalHostName = config.GetString("externalHostName", "");
realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0"));
realYLoc = Convert.ToUInt32(config.GetString("real-yloc", "0"));
if (m_enableAutoMapping)
{
@ -279,9 +282,12 @@ namespace OpenSim
yloc = (uint)((yloc % 100) + m_autoMappingY);
}
if (TryCreateLink(xloc, yloc, externalPort, externalHostName, out regInfo))
if (((realXLoc == 0) && (realYLoc == 0)) || (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) && ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896))))
{
regInfo.RegionName = config.GetString("localName", "");
if (TryCreateLink(xloc, yloc, externalPort, externalHostName, out regInfo))
{
regInfo.RegionName = config.GetString("localName", "");
}
}
}