Merge branch 'master' into careminster

Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
This commit is contained in:
Melanie
2012-03-27 23:14:43 +01:00
18 changed files with 347 additions and 53 deletions

View File

@@ -60,6 +60,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
set { m_MaxTransferDistance = value; }
}
private int m_levelHGTeleport = 0;
protected bool m_Enabled = false;
protected Scene m_aScene;
protected List<Scene> m_Scenes = new List<Scene>();
@@ -101,7 +103,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
IConfig transferConfig = source.Configs["EntityTransfer"];
if (transferConfig != null)
{
MaxTransferDistance = transferConfig.GetInt("max_distance", 4095);
m_levelHGTeleport = transferConfig.GetInt("LevelHGTeleport", 0);
}
m_agentsInTransit = new List<UUID>();
m_Enabled = true;
@@ -228,6 +233,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return;
}
// check if HyperGrid teleport is allowed, based on user level
int flags = m_aScene.GridService.GetRegionFlags(sp.Scene.RegionInfo.ScopeID, reg.RegionID);
if (((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) && (sp.UserLevel < m_levelHGTeleport))
{
m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination link is non permitted hypergrid region. Unable to teleport agent.");
sp.ControllingClient.SendTeleportFailed("HyperGrid teleport not permitted");
return;
}
uint curX = 0, curY = 0;
Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY);
int curCellX = (int)(curX / Constants.RegionSize);