diff options
author | Tom | 2011-09-14 18:46:42 -0700 |
---|---|---|
committer | Tom | 2011-09-14 18:46:42 -0700 |
commit | cda4cd6b551156ed503a5f284ad6c5a9a0e1c5a5 (patch) | |
tree | f6b8e5a8dbe7d00c1ac1ba1c830c0f8cea4e1325 /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | First set of merge fixes (diff) | |
download | opensim-SC_OLD-cda4cd6b551156ed503a5f284ad6c5a9a0e1c5a5.zip opensim-SC_OLD-cda4cd6b551156ed503a5f284ad6c5a9a0e1c5a5.tar.gz opensim-SC_OLD-cda4cd6b551156ed503a5f284ad6c5a9a0e1c5a5.tar.bz2 opensim-SC_OLD-cda4cd6b551156ed503a5f284ad6c5a9a0e1c5a5.tar.xz |
Merge fixes, and fix the build
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 87 |
1 files changed, 53 insertions, 34 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 345c2df..a661ab8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2695,9 +2695,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2695 | EventManager.TriggerOnClientLogin(client); | 2695 | EventManager.TriggerOnClientLogin(client); |
2696 | 2696 | ||
2697 | // Send initial parcel data | 2697 | // Send initial parcel data |
2698 | Vector3 pos = presence.AbsolutePosition; | 2698 | Vector3 pos = createdSp.AbsolutePosition; |
2699 | ILandObject land = LandChannel.GetLandObject(pos.X, pos.Y); | 2699 | ILandObject land = LandChannel.GetLandObject(pos.X, pos.Y); |
2700 | land.SendLandUpdateToClient(presence.ControllingClient); | 2700 | land.SendLandUpdateToClient(client); |
2701 | } | 2701 | } |
2702 | } | 2702 | } |
2703 | } | 2703 | } |
@@ -3500,7 +3500,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3500 | // check if banned regions are to be blacked out. | 3500 | // check if banned regions are to be blacked out. |
3501 | if (vialogin || (!m_seeIntoBannedRegion)) | 3501 | if (vialogin || (!m_seeIntoBannedRegion)) |
3502 | { | 3502 | { |
3503 | if (!AuthorizeUser(agent.AgentID, out reason)) | 3503 | if (!AuthorizeUser(agent, out reason)) |
3504 | return false; | 3504 | return false; |
3505 | } | 3505 | } |
3506 | } | 3506 | } |
@@ -3696,47 +3696,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
3696 | /// <param name="reason">outputs the reason to this string</param> | 3696 | /// <param name="reason">outputs the reason to this string</param> |
3697 | /// <returns>True if the region accepts this agent. False if it does not. False will | 3697 | /// <returns>True if the region accepts this agent. False if it does not. False will |
3698 | /// also return a reason.</returns> | 3698 | /// also return a reason.</returns> |
3699 | protected virtual bool AuthorizeUser(UUID agentID, out string reason) | 3699 | protected virtual bool AuthorizeUser(AgentCircuitData agent, out string reason) |
3700 | { | 3700 | { |
3701 | reason = String.Empty; | 3701 | reason = String.Empty; |
3702 | 3702 | ||
3703 | if (!m_strictAccessControl) return true; | 3703 | if (!m_strictAccessControl) return true; |
3704 | if (Permissions.IsGod(agentID)) return true; | 3704 | if (Permissions.IsGod(agent.AgentID)) return true; |
3705 | 3705 | ||
3706 | if (AuthorizationService != null) | 3706 | if (AuthorizationService != null) |
3707 | { | 3707 | { |
3708 | if (!AuthorizationService.IsAuthorizedForRegion( | 3708 | if (!AuthorizationService.IsAuthorizedForRegion( |
3709 | agent.AgentID.ToString(), agent.firstname, agent.lastname, RegionInfo.RegionID.ToString(), out reason)) | 3709 | agent.AgentID.ToString(), agent.firstname, agent.lastname, RegionInfo.RegionID.ToString(), out reason)) |
3710 | { | 3710 | { |
3711 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} at {1} because the user does not have access to the region", | 3711 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the region", |
3712 | agentID, RegionInfo.RegionName); | 3712 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); |
3713 | 3713 | ||
3714 | return false; | 3714 | return false; |
3715 | } | 3715 | } |
3716 | } | 3716 | } |
3717 | 3717 | ||
3718 | if (m_regInfo.EstateSettings != null) | 3718 | if (m_regInfo.EstateSettings != null) |
3719 | { | 3719 | { |
3720 | int flags = GetUserFlags(agentID); | 3720 | if (m_regInfo.EstateSettings.IsBanned(agent.AgentID,0)) |
3721 | if (m_regInfo.EstateSettings.IsBanned(agentID, flags)) | ||
3722 | { | 3721 | { |
3723 | //Add some more info to help users | 3722 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", |
3724 | if (!m_regInfo.EstateSettings.IsBanned(agentID, 32)) | 3723 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); |
3725 | { | ||
3726 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} at {1} because the region requires age verification", | ||
3727 | agentID, RegionInfo.RegionName); | ||
3728 | reason = String.Format("Denied access to region {0}: Region requires age verification", RegionInfo.RegionName); | ||
3729 | return false; | ||
3730 | } | ||
3731 | if (!m_regInfo.EstateSettings.IsBanned(agentID, 4)) | ||
3732 | { | ||
3733 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} {1} because the region requires payment info on file", | ||
3734 | agentID, RegionInfo.RegionName); | ||
3735 | reason = String.Format("Denied access to region {0}: Region requires payment info on file", RegionInfo.RegionName); | ||
3736 | return false; | ||
3737 | } | ||
3738 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} at {3} because the user is on the banlist", | ||
3739 | agentID, RegionInfo.RegionName); | ||
3740 | reason = String.Format("Denied access to region {0}: You have been banned from that region.", | 3724 | reason = String.Format("Denied access to region {0}: You have been banned from that region.", |
3741 | RegionInfo.RegionName); | 3725 | RegionInfo.RegionName); |
3742 | return false; | 3726 | return false; |
@@ -3753,7 +3737,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3753 | if (groupsModule != null) | 3737 | if (groupsModule != null) |
3754 | { | 3738 | { |
3755 | GroupMembershipData[] GroupMembership = | 3739 | GroupMembershipData[] GroupMembership = |
3756 | groupsModule.GetMembershipData(agentID); | 3740 | groupsModule.GetMembershipData(agent.AgentID); |
3757 | 3741 | ||
3758 | if (GroupMembership != null) | 3742 | if (GroupMembership != null) |
3759 | { | 3743 | { |
@@ -3782,16 +3766,44 @@ namespace OpenSim.Region.Framework.Scenes | |||
3782 | m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); | 3766 | m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); |
3783 | 3767 | ||
3784 | if (!m_regInfo.EstateSettings.PublicAccess && | 3768 | if (!m_regInfo.EstateSettings.PublicAccess && |
3785 | !m_regInfo.EstateSettings.HasAccess(agentID) && | 3769 | !m_regInfo.EstateSettings.HasAccess(agent.AgentID) && |
3786 | !groupAccess) | 3770 | !groupAccess) |
3787 | { | 3771 | { |
3788 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} at {1} because the user does not have access to the estate", | 3772 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", |
3789 | agentID, RegionInfo.RegionName); | 3773 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); |
3790 | reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", | 3774 | reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", |
3791 | RegionInfo.RegionName); | 3775 | RegionInfo.RegionName); |
3792 | return false; | 3776 | return false; |
3793 | } | 3777 | } |
3794 | 3778 | ||
3779 | // TODO: estate/region settings are not properly hooked up | ||
3780 | // to ILandObject.isRestrictedFromLand() | ||
3781 | // if (null != LandChannel) | ||
3782 | // { | ||
3783 | // // region seems to have local Id of 1 | ||
3784 | // ILandObject land = LandChannel.GetLandObject(1); | ||
3785 | // if (null != land) | ||
3786 | // { | ||
3787 | // if (land.isBannedFromLand(agent.AgentID)) | ||
3788 | // { | ||
3789 | // m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user has been banned from land", | ||
3790 | // agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); | ||
3791 | // reason = String.Format("Denied access to private region {0}: You are banned from that region.", | ||
3792 | // RegionInfo.RegionName); | ||
3793 | // return false; | ||
3794 | // } | ||
3795 | |||
3796 | // if (land.isRestrictedFromLand(agent.AgentID)) | ||
3797 | // { | ||
3798 | // m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the region", | ||
3799 | // agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); | ||
3800 | // reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", | ||
3801 | // RegionInfo.RegionName); | ||
3802 | // return false; | ||
3803 | // } | ||
3804 | // } | ||
3805 | // } | ||
3806 | |||
3795 | return true; | 3807 | return true; |
3796 | } | 3808 | } |
3797 | 3809 | ||
@@ -5387,9 +5399,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
5387 | } | 5399 | } |
5388 | } | 5400 | } |
5389 | 5401 | ||
5390 | if (!AuthorizeUser(agentID, out reason)) | 5402 | try |
5403 | { | ||
5404 | if (!AuthorizeUser(GetScenePresence(agentID).ControllingClient.RequestClientInfo(), out reason)) | ||
5405 | { | ||
5406 | // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); | ||
5407 | return false; | ||
5408 | } | ||
5409 | } | ||
5410 | catch | ||
5391 | { | 5411 | { |
5392 | // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); | ||
5393 | return false; | 5412 | return false; |
5394 | } | 5413 | } |
5395 | 5414 | ||