Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor

avinationmerge
Kitto Flora 2010-11-11 04:51:05 +00:00
commit b2aeea66e3
13 changed files with 120 additions and 105 deletions

View File

@ -351,7 +351,6 @@ namespace OpenSim.Framework
m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID); m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID);
} }
// DEBUG ON // DEBUG ON
public override String ToString() public override String ToString()
{ {

View File

@ -139,7 +139,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
return cached; return cached;
} }
/// <summary> /// <summary>
/// Set appearance data (textureentry and slider settings) received from the client /// Set appearance data (textureentry and slider settings) received from the client
/// </summary> /// </summary>

View File

@ -1115,12 +1115,14 @@ namespace OpenSim.Region.CoreModules.World.Estate
if (m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide) if (m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide)
flags |= RegionFlags.AllowParcelChanges; flags |= RegionFlags.AllowParcelChanges;
if (m_scene.RegionInfo.RegionSettings.BlockShowInSearch) if (m_scene.RegionInfo.RegionSettings.BlockShowInSearch)
flags |= (RegionFlags)(1 << 29); flags |= RegionFlags.BlockParcelSearch;
if (m_scene.RegionInfo.RegionSettings.FixedSun) if (m_scene.RegionInfo.RegionSettings.FixedSun)
flags |= RegionFlags.SunFixed; flags |= RegionFlags.SunFixed;
if (m_scene.RegionInfo.RegionSettings.Sandbox) if (m_scene.RegionInfo.RegionSettings.Sandbox)
flags |= RegionFlags.Sandbox; flags |= RegionFlags.Sandbox;
if (m_scene.RegionInfo.EstateSettings.AllowVoice)
flags |= RegionFlags.AllowVoice;
// Fudge these to always on, so the menu options activate // Fudge these to always on, so the menu options activate
// //

View File

@ -90,7 +90,8 @@ namespace OpenSim.Region.CoreModules.World.Land
// caches ExtendedLandData // caches ExtendedLandData
private Cache parcelInfoCache; private Cache parcelInfoCache;
private Vector3? forcedPosition = null; private Dictionary<UUID, Vector3> forcedPosition =
new Dictionary<UUID, Vector3>();
#region INonSharedRegionModule Members #region INonSharedRegionModule Members
@ -185,7 +186,7 @@ namespace OpenSim.Region.CoreModules.World.Land
void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
{ {
//If we are forcing a position for them to go //If we are forcing a position for them to go
if (forcedPosition != null) if (forcedPosition.ContainsKey(remoteClient.AgentId))
{ {
ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId); ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId);
@ -195,23 +196,23 @@ namespace OpenSim.Region.CoreModules.World.Land
//Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines
if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) < .2) if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2)
{ {
Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition));
forcedPosition = null; forcedPosition.Remove(remoteClient.AgentId);
} }
//if we are far away, teleport //if we are far away, teleport
else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3) else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3)
{ {
Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition));
clientAvatar.Teleport(forcedPosition.Value); clientAvatar.Teleport(forcedPosition[remoteClient.AgentId]);
forcedPosition = null; forcedPosition.Remove(remoteClient.AgentId);
} }
else else
{ {
//Forces them toward the forced position we want if they aren't there yet //Forces them toward the forced position we want if they aren't there yet
agentData.UseClientAgentPosition = true; agentData.UseClientAgentPosition = true;
agentData.ClientAgentPosition = forcedPosition.Value; agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId];
} }
} }
} }
@ -334,7 +335,7 @@ namespace OpenSim.Region.CoreModules.World.Land
if (m_scene.Permissions.IsGod(avatar.UUID)) return; if (m_scene.Permissions.IsGod(avatar.UUID)) return;
if (position.HasValue) if (position.HasValue)
{ {
forcedPosition = position; forcedPosition[avatar.ControllingClient.AgentId] = (Vector3)position;
} }
} }
@ -465,7 +466,7 @@ namespace OpenSim.Region.CoreModules.World.Land
parcel.IsBannedFromLand(clientAvatar.UUID)) parcel.IsBannedFromLand(clientAvatar.UUID))
{ {
//once we've sent the message once, keep going toward the target until we are done //once we've sent the message once, keep going toward the target until we are done
if (forcedPosition == null) if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId))
{ {
SendYouAreBannedNotice(clientAvatar); SendYouAreBannedNotice(clientAvatar);
ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar));
@ -474,7 +475,7 @@ namespace OpenSim.Region.CoreModules.World.Land
else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) else if (parcel.IsRestrictedFromLand(clientAvatar.UUID))
{ {
//once we've sent the message once, keep going toward the target until we are done //once we've sent the message once, keep going toward the target until we are done
if (forcedPosition == null) if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId))
{ {
SendYouAreRestrictedNotice(clientAvatar); SendYouAreRestrictedNotice(clientAvatar);
ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar));
@ -483,7 +484,7 @@ namespace OpenSim.Region.CoreModules.World.Land
else else
{ {
//when we are finally in a safe place, lets release the forced position lock //when we are finally in a safe place, lets release the forced position lock
forcedPosition = null; forcedPosition.Remove(clientAvatar.ControllingClient.AgentId);
} }
} }
} }

View File

@ -84,6 +84,7 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: need to figure out how allow client agents but deny // TODO: need to figure out how allow client agents but deny
// root agents when ACL denies access to root agent // root agents when ACL denies access to root agent
public bool m_strictAccessControl = true; public bool m_strictAccessControl = true;
public bool m_seeIntoBannedRegion = false;
public int MaxUndoCount = 5; public int MaxUndoCount = 5;
public bool LoginsDisabled = true; public bool LoginsDisabled = true;
public bool LoadingPrims; public bool LoadingPrims;
@ -683,6 +684,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
m_seeIntoBannedRegion = startupConfig.GetBoolean("SeeIntoBannedRegion", m_seeIntoBannedRegion);
CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false); CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true);
@ -3688,7 +3690,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_regInfo.EstateSettings != null) if (m_regInfo.EstateSettings != null)
{ {
if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) if ((!m_seeIntoBannedRegion) && m_regInfo.EstateSettings.IsBanned(agent.AgentID))
{ {
m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist",
agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
@ -3878,6 +3880,19 @@ namespace OpenSim.Region.Framework.Scenes
// We have to wait until the viewer contacts this region after receiving EAC. // We have to wait until the viewer contacts this region after receiving EAC.
// That calls AddNewClient, which finally creates the ScenePresence // That calls AddNewClient, which finally creates the ScenePresence
if (m_regInfo.EstateSettings.IsBanned(cAgentData.AgentID))
{
m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: banned", cAgentData.AgentID);
return false;
}
ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2);
if (nearestParcel == null)
{
m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: no allowed parcel", cAgentData.AgentID);
return false;
}
int num = m_sceneGraph.GetNumberOfScenePresences(); int num = m_sceneGraph.GetNumberOfScenePresences();
if (num >= RegionInfo.RegionSettings.AgentLimit) if (num >= RegionInfo.RegionSettings.AgentLimit)
@ -4878,7 +4893,6 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar); Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar);
//Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString()); //Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString());
return nearestRegionEdgePoint; return nearestRegionEdgePoint;
return null;
} }
private Vector3 GetParcelCenterAtGround(ILandObject parcel) private Vector3 GetParcelCenterAtGround(ILandObject parcel)