mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
From: Alan M Webb <alan_webb@us.ibm.com>
Added support for access control lists.
Scene: Added test to AddNewClient for an entry in the access
list when connecting to a region with limited access.
EstateSettings: Added an HasAccess(UUID) property to test for
an entry in the estate's access list.
RemoteAdmin: Add RPC calls for admin_acl_list, clear, add,
and remove.
This commit is contained in:
@@ -1846,11 +1846,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public override void AddNewClient(IClientAPI client)
|
||||
{
|
||||
if (m_regInfo.EstateSettings.IsBanned(client.AgentId))
|
||||
bool welcome = true;
|
||||
|
||||
if(m_regInfo.EstateSettings.IsBanned(client.AgentId))
|
||||
{
|
||||
m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist",
|
||||
client.AgentId, client.FirstName, client.LastName, RegionInfo.RegionName);
|
||||
client.SendAlertMessage("Denied access to region " + RegionInfo.RegionName + ". You have been banned from that region.");
|
||||
welcome = false;
|
||||
}
|
||||
else if (!m_regInfo.EstateSettings.PublicAccess && !m_regInfo.EstateSettings.HasAccess(client.AgentId))
|
||||
{
|
||||
m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access",
|
||||
client.AgentId, client.FirstName, client.LastName, RegionInfo.RegionName);
|
||||
client.SendAlertMessage("Denied access to private region " + RegionInfo.RegionName + ". You do not have access to this region.");
|
||||
welcome = false;
|
||||
}
|
||||
|
||||
if(!welcome)
|
||||
{
|
||||
try
|
||||
{
|
||||
IEventQueue eq = RequestModuleInterface<IEventQueue>();
|
||||
@@ -1867,50 +1881,52 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[SCENE]: Exception while closing banned client {0} {1}: {2}", client.FirstName, client.LastName, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
SubscribeToClientEvents(client);
|
||||
ScenePresence presence;
|
||||
|
||||
if (m_restorePresences.ContainsKey(client.AgentId))
|
||||
{
|
||||
m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName);
|
||||
|
||||
presence = m_restorePresences[client.AgentId];
|
||||
m_restorePresences.Remove(client.AgentId);
|
||||
|
||||
// This is one of two paths to create avatars that are
|
||||
// used. This tends to get called more in standalone
|
||||
// than grid, not really sure why, but as such needs
|
||||
// an explicity appearance lookup here.
|
||||
AvatarAppearance appearance = null;
|
||||
GetAvatarAppearance(client, out appearance);
|
||||
presence.Appearance = appearance;
|
||||
|
||||
presence.initializeScenePresence(client, RegionInfo, this);
|
||||
|
||||
m_sceneGraph.AddScenePresence(presence);
|
||||
|
||||
lock (m_restorePresences)
|
||||
{
|
||||
Monitor.PulseAll(m_restorePresences);
|
||||
m_log.DebugFormat("[SCENE]: Exception while closing unwelcome client {0} {1}: {2}", client.FirstName, client.LastName, e.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SCENE]: Adding new child agent for {0} in {1}",
|
||||
client.Name, RegionInfo.RegionName);
|
||||
SubscribeToClientEvents(client);
|
||||
ScenePresence presence;
|
||||
|
||||
CommsManager.UserProfileCacheService.AddNewUser(client.AgentId);
|
||||
if (m_restorePresences.ContainsKey(client.AgentId))
|
||||
{
|
||||
m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName);
|
||||
|
||||
CreateAndAddScenePresence(client);
|
||||
presence = m_restorePresences[client.AgentId];
|
||||
m_restorePresences.Remove(client.AgentId);
|
||||
|
||||
// This is one of two paths to create avatars that are
|
||||
// used. This tends to get called more in standalone
|
||||
// than grid, not really sure why, but as such needs
|
||||
// an explicity appearance lookup here.
|
||||
AvatarAppearance appearance = null;
|
||||
GetAvatarAppearance(client, out appearance);
|
||||
presence.Appearance = appearance;
|
||||
|
||||
presence.initializeScenePresence(client, RegionInfo, this);
|
||||
|
||||
m_sceneGraph.AddScenePresence(presence);
|
||||
|
||||
lock (m_restorePresences)
|
||||
{
|
||||
Monitor.PulseAll(m_restorePresences);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SCENE]: Adding new child agent for {0} in {1}",
|
||||
client.Name, RegionInfo.RegionName);
|
||||
|
||||
CommsManager.UserProfileCacheService.AddNewUser(client.AgentId);
|
||||
|
||||
CreateAndAddScenePresence(client);
|
||||
}
|
||||
|
||||
m_LastLogin = Environment.TickCount;
|
||||
EventManager.TriggerOnNewClient(client);
|
||||
}
|
||||
|
||||
m_LastLogin = Environment.TickCount;
|
||||
EventManager.TriggerOnNewClient(client);
|
||||
}
|
||||
|
||||
protected virtual void SubscribeToClientEvents(IClientAPI client)
|
||||
|
||||
Reference in New Issue
Block a user