mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
User level based restrictions for HyperGrid teleports, asset uploads, group creations and getting contacted from other grids. Incoming HyperGrid teleports can also be restricted to local users.
This commit is contained in:
@@ -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;
|
||||
@@ -227,6 +232,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);
|
||||
|
||||
Reference in New Issue
Block a user