mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Merge branch 'presence-refactor' of ssh://diva@opensimulator.org/var/git/opensim into presence-refactor
This commit is contained in:
@@ -48,6 +48,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
private List<Scene> m_SceneList = new List<Scene>();
|
||||
private string m_RestURL = String.Empty;
|
||||
IMessageTransferModule m_TransferModule = null;
|
||||
private bool m_ForwardOfflineGroupMessages = true;
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
@@ -71,6 +72,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages);
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
@@ -192,7 +195,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
private void UndeliveredMessage(GridInstantMessage im)
|
||||
{
|
||||
if (im.offline != 0)
|
||||
if ((im.offline != 0)
|
||||
&& (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages)))
|
||||
{
|
||||
bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>(
|
||||
"POST", m_RestURL+"/SaveMessage/", im);
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
<RegionModule id="LLLoginServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Login.LLLoginServiceInConnectorModule" /> \
|
||||
<RegionModule id="SimulationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation.SimulationServiceInConnectorModule" /> \
|
||||
<RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \
|
||||
<RegionModule id="AccessModule" type="OpenSim.Region.CoreModules.World.AccessModule" /> \
|
||||
|
||||
</Extension>
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
|
||||
#region IGridService
|
||||
|
||||
public bool RegisterRegion(UUID scopeID, GridRegion regionInfo)
|
||||
public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
|
||||
{
|
||||
// Region doesn't exist here. Trying to link remote region
|
||||
if (regionInfo.RegionID.Equals(UUID.Zero))
|
||||
@@ -210,12 +210,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
|
||||
// Try get the map image
|
||||
m_HypergridServiceConnector.GetMapImage(regionInfo);
|
||||
return true;
|
||||
return String.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")");
|
||||
return false;
|
||||
return "No such region";
|
||||
}
|
||||
// Note that these remote regions aren't registered in localBackend, so return null, no local listeners
|
||||
}
|
||||
@@ -465,7 +465,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
}
|
||||
|
||||
// Finally, link it
|
||||
if (!RegisterRegion(UUID.Zero, regInfo))
|
||||
if (RegisterRegion(UUID.Zero, regInfo) != String.Empty)
|
||||
{
|
||||
m_log.Warn("[HGrid]: Unable to link region");
|
||||
return false;
|
||||
@@ -706,8 +706,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
public bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome)
|
||||
{
|
||||
comingHome = false;
|
||||
if (!m_aScene.SceneGridService.RegionLoginsEnabled)
|
||||
return false;
|
||||
|
||||
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID);
|
||||
if (account != null)
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
|
||||
#region IGridService
|
||||
|
||||
public bool RegisterRegion(UUID scopeID, GridRegion regionInfo)
|
||||
public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
|
||||
{
|
||||
return m_GridService.RegisterRegion(scopeID, regionInfo);
|
||||
}
|
||||
|
||||
@@ -135,12 +135,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
|
||||
#region IGridService
|
||||
|
||||
public override bool RegisterRegion(UUID scopeID, GridRegion regionInfo)
|
||||
public override string RegisterRegion(UUID scopeID, GridRegion regionInfo)
|
||||
{
|
||||
if (m_LocalGridService.RegisterRegion(scopeID, regionInfo))
|
||||
string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo);
|
||||
|
||||
if (msg == String.Empty)
|
||||
return base.RegisterRegion(scopeID, regionInfo);
|
||||
|
||||
return false;
|
||||
return msg;
|
||||
}
|
||||
|
||||
public override bool DeregisterRegion(UUID regionID)
|
||||
|
||||
157
OpenSim/Region/CoreModules/World/Access/AccessModule.cs
Normal file
157
OpenSim/Region/CoreModules/World/Access/AccessModule.cs
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.World
|
||||
{
|
||||
public class AccessModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private List<Scene> m_SceneList = new List<Scene>();
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
MainConsole.Instance.Commands.AddCommand("access", true,
|
||||
"login enable",
|
||||
"login enable",
|
||||
"Enable simulator logins",
|
||||
String.Empty,
|
||||
HandleLoginCommand);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("access", true,
|
||||
"login disable",
|
||||
"login disable",
|
||||
"Disable simulator logins",
|
||||
String.Empty,
|
||||
HandleLoginCommand);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("access", true,
|
||||
"login status",
|
||||
"login status",
|
||||
"Show login status",
|
||||
String.Empty,
|
||||
HandleLoginCommand);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "AccessModule"; }
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (!m_SceneList.Contains(scene))
|
||||
m_SceneList.Add(scene);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
m_SceneList.Remove(scene);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void HandleLoginCommand(string module, string[] cmd)
|
||||
{
|
||||
if ((Scene)MainConsole.Instance.ConsoleScene == null)
|
||||
{
|
||||
foreach (Scene s in m_SceneList)
|
||||
{
|
||||
if(!ProcessCommand(s, cmd))
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcessCommand((Scene)MainConsole.Instance.ConsoleScene, cmd);
|
||||
}
|
||||
}
|
||||
|
||||
bool ProcessCommand(Scene scene, string[] cmd)
|
||||
{
|
||||
if (cmd.Length < 2)
|
||||
{
|
||||
MainConsole.Instance.Output("Syntax: login enable|disable|status");
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (cmd[1])
|
||||
{
|
||||
case "enable":
|
||||
if (scene.LoginsDisabled)
|
||||
MainConsole.Instance.Output(String.Format("Enabling logins for region {0}", scene.RegionInfo.RegionName));
|
||||
scene.LoginsDisabled = false;
|
||||
break;
|
||||
case "disable":
|
||||
if (!scene.LoginsDisabled)
|
||||
MainConsole.Instance.Output(String.Format("Disabling logins for region {0}", scene.RegionInfo.RegionName));
|
||||
scene.LoginsDisabled = true;
|
||||
break;
|
||||
case "status":
|
||||
if (scene.LoginsDisabled)
|
||||
MainConsole.Instance.Output(String.Format("Login in {0} are disabled", scene.RegionInfo.RegionName));
|
||||
else
|
||||
MainConsole.Instance.Output(String.Format("Login in {0} are enabled", scene.RegionInfo.RegionName));
|
||||
break;
|
||||
default:
|
||||
MainConsole.Instance.Output("Syntax: login enable|disable|status");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,10 +72,21 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
m_scene.RegionInfo.EstateSettings.AbuseEmail,
|
||||
estateOwner);
|
||||
|
||||
remote_client.SendEstateManagersList(invoice,
|
||||
remote_client.SendEstateList(invoice,
|
||||
(int)Constants.EstateAccessCodex.EstateManagers,
|
||||
m_scene.RegionInfo.EstateSettings.EstateManagers,
|
||||
m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
|
||||
remote_client.SendEstateList(invoice,
|
||||
(int)Constants.EstateAccessCodex.AccessOptions,
|
||||
m_scene.RegionInfo.EstateSettings.EstateAccess,
|
||||
m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
|
||||
remote_client.SendEstateList(invoice,
|
||||
(int)Constants.EstateAccessCodex.AllowedGroups,
|
||||
m_scene.RegionInfo.EstateSettings.EstateGroups,
|
||||
m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
|
||||
remote_client.SendBannedUserList(invoice,
|
||||
m_scene.RegionInfo.EstateSettings.EstateBans,
|
||||
m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
@@ -228,127 +239,176 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
if (user == m_scene.RegionInfo.EstateSettings.EstateOwner)
|
||||
return; // never process EO
|
||||
|
||||
switch (estateAccessType)
|
||||
if ((estateAccessType & 4) != 0) // User add
|
||||
{
|
||||
case 64:
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.AddEstateUser(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
|
||||
}
|
||||
if ((estateAccessType & 8) != 0) // User remove
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
}
|
||||
if ((estateAccessType & 16) != 0) // Group add
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.AddEstateGroup(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
}
|
||||
if ((estateAccessType & 32) != 0) // Group remove
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
}
|
||||
if ((estateAccessType & 64) != 0) // Ban add
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
|
||||
|
||||
bool alreadyInList = false;
|
||||
|
||||
for (int i = 0; i < banlistcheck.Length; i++)
|
||||
{
|
||||
EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
|
||||
|
||||
bool alreadyInList = false;
|
||||
|
||||
for (int i = 0; i < banlistcheck.Length; i++)
|
||||
if (user == banlistcheck[i].BannedUserID)
|
||||
{
|
||||
if (user == banlistcheck[i].BannedUserID)
|
||||
{
|
||||
alreadyInList = true;
|
||||
break;
|
||||
}
|
||||
|
||||
alreadyInList = true;
|
||||
break;
|
||||
}
|
||||
if (!alreadyInList)
|
||||
{
|
||||
|
||||
EstateBan item = new EstateBan();
|
||||
|
||||
item.BannedUserID = user;
|
||||
item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID;
|
||||
item.BannedHostAddress = "0.0.0.0";
|
||||
item.BannedHostIPMask = "0.0.0.0";
|
||||
|
||||
m_scene.RegionInfo.EstateSettings.AddBan(item);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
|
||||
ScenePresence s = m_scene.GetScenePresence(user);
|
||||
if (s != null)
|
||||
{
|
||||
if (!s.IsChildAgent)
|
||||
{
|
||||
s.ControllingClient.SendTeleportLocationStart();
|
||||
m_scene.TeleportClientHome(user, s.ControllingClient);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("User is already on the region ban list");
|
||||
}
|
||||
//m_scene.RegionInfo.regionBanlist.Add(Manager(user);
|
||||
remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
if (!alreadyInList)
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
break;
|
||||
case 128:
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
|
||||
|
||||
bool alreadyInList = false;
|
||||
EstateBan listitem = null;
|
||||
EstateBan item = new EstateBan();
|
||||
|
||||
for (int i = 0; i < banlistcheck.Length; i++)
|
||||
{
|
||||
if (user == banlistcheck[i].BannedUserID)
|
||||
{
|
||||
alreadyInList = true;
|
||||
listitem = banlistcheck[i];
|
||||
break;
|
||||
}
|
||||
item.BannedUserID = user;
|
||||
item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID;
|
||||
item.BannedHostAddress = "0.0.0.0";
|
||||
item.BannedHostIPMask = "0.0.0.0";
|
||||
|
||||
}
|
||||
if (alreadyInList && listitem != null)
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("User is not on the region ban list");
|
||||
}
|
||||
//m_scene.RegionInfo.regionBanlist.Add(Manager(user);
|
||||
remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
break;
|
||||
case 256:
|
||||
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.AddEstateManager(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
|
||||
break;
|
||||
case 512:
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
|
||||
m_scene.RegionInfo.EstateSettings.AddBan(item);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
|
||||
remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
ScenePresence s = m_scene.GetScenePresence(user);
|
||||
if (s != null)
|
||||
{
|
||||
if (!s.IsChildAgent)
|
||||
{
|
||||
s.ControllingClient.SendTeleportLocationStart();
|
||||
m_scene.TeleportClientHome(user, s.ControllingClient);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
remote_client.SendAlertMessage("User is already on the region ban list");
|
||||
}
|
||||
break;
|
||||
//m_scene.RegionInfo.regionBanlist.Add(Manager(user);
|
||||
remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
}
|
||||
if ((estateAccessType & 128) != 0) // Ban remove
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
|
||||
|
||||
default:
|
||||
bool alreadyInList = false;
|
||||
EstateBan listitem = null;
|
||||
|
||||
m_log.ErrorFormat("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta: {0}", estateAccessType.ToString());
|
||||
break;
|
||||
for (int i = 0; i < banlistcheck.Length; i++)
|
||||
{
|
||||
if (user == banlistcheck[i].BannedUserID)
|
||||
{
|
||||
alreadyInList = true;
|
||||
listitem = banlistcheck[i];
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (alreadyInList && listitem != null)
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("User is not on the region ban list");
|
||||
}
|
||||
//m_scene.RegionInfo.regionBanlist.Add(Manager(user);
|
||||
remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
}
|
||||
if ((estateAccessType & 256) != 0) // Manager add
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.AddEstateManager(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
}
|
||||
if ((estateAccessType & 512) != 0) // Manager remove
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
{
|
||||
remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -607,7 +607,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
return objectOwnerMask;
|
||||
|
||||
// Estate users should be able to edit anything in the sim
|
||||
if (IsEstateManager(user) && m_RegionOwnerIsGod && !IsAdministrator(objectOwner))
|
||||
if (IsEstateManager(user) && m_RegionOwnerIsGod && (!IsAdministrator(objectOwner)) || objectOwner == user)
|
||||
return objectOwnerMask;
|
||||
|
||||
// Admin should be able to edit anything in the sim (including admin objects)
|
||||
@@ -899,6 +899,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
||||
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
||||
|
||||
if (IsEstateManager(user) && m_RegionOwnerIsGod)
|
||||
return true;
|
||||
|
||||
return IsAdministrator(user);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user