If a Grid God teleports then include the Godlike teleport flag. This can affect the starting position in the destination region.

0.7.4.1
Oren Hurvitz 2012-04-23 19:20:46 +03:00 committed by Justin Clark-Casey (justincc)
parent 37d770f814
commit 9622e8ac72
3 changed files with 45 additions and 9 deletions

View File

@ -161,6 +161,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
public void Teleport(ScenePresence sp, ulong regionHandle, Vector3 position, Vector3 lookAt, uint teleportFlags)
{
if (sp.Scene.Permissions.IsGridGod(sp.UUID))
{
// This user will be a God in the destination scene, too
teleportFlags |= (uint)TeleportFlags.Godlike;
}
if (!sp.Scene.Permissions.CanTeleport(sp.UUID))
return;

View File

@ -166,6 +166,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_scene.Permissions.OnDeedParcel += CanDeedParcel;
m_scene.Permissions.OnDeedObject += CanDeedObject;
m_scene.Permissions.OnIsGod += IsGod;
m_scene.Permissions.OnIsGridGod += IsGridGod;
m_scene.Permissions.OnIsAdministrator += IsAdministrator;
m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
@ -466,22 +467,34 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (IsEstateManager(user) && m_RegionManagerIsGod)
return true;
if (IsGridGod(user, null))
return true;
return false;
}
/// <summary>
/// Is the given user a God throughout the grid (not just in the current scene)?
/// </summary>
/// <param name="user">The user</param>
/// <param name="scene">Unused, can be null</param>
/// <returns></returns>
protected bool IsGridGod(UUID user, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (user == UUID.Zero) return false;
if (m_allowGridGods)
{
ScenePresence sp = m_scene.GetScenePresence(user);
if (sp != null)
{
if (sp.UserLevel >= 200)
return true;
return false;
}
return (sp.UserLevel >= 200);
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user);
if (account != null)
{
if (account.UserLevel >= 200)
return true;
}
return (account.UserLevel >= 200);
}
return false;

View File

@ -67,6 +67,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene);
public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand);
public delegate bool IsGodHandler(UUID user, Scene requestFromScene);
public delegate bool IsGridGodHandler(UUID user, Scene requestFromScene);
public delegate bool IsAdministratorHandler(UUID user);
public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene);
@ -134,6 +135,7 @@ namespace OpenSim.Region.Framework.Scenes
public event RunConsoleCommandHandler OnRunConsoleCommand;
public event IssueEstateCommandHandler OnIssueEstateCommand;
public event IsGodHandler OnIsGod;
public event IsGridGodHandler OnIsGridGod;
public event IsAdministratorHandler OnIsAdministrator;
// public event EditParcelHandler OnEditParcel;
public event EditParcelPropertiesHandler OnEditParcelProperties;
@ -728,6 +730,21 @@ namespace OpenSim.Region.Framework.Scenes
return true;
}
public bool IsGridGod(UUID user)
{
IsGridGodHandler handler = OnIsGridGod;
if (handler != null)
{
Delegate[] list = handler.GetInvocationList();
foreach (IsGridGodHandler h in list)
{
if (h(user, m_scene) == false)
return false;
}
}
return true;
}
public bool IsAdministrator(UUID user)
{
IsAdministratorHandler handler = OnIsAdministrator;