diff options
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index fc4110b..6a5f84a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2443,7 +2443,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2443 | // If the user is banned, we won't let any of their objects | 2443 | // If the user is banned, we won't let any of their objects |
2444 | // enter. Period. | 2444 | // enter. Period. |
2445 | // | 2445 | // |
2446 | if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID)) | 2446 | int flags = GetUserFlags(sceneObject.OwnerID); |
2447 | if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID, flags)) | ||
2447 | { | 2448 | { |
2448 | m_log.Info("[INTERREGION]: Denied prim crossing for " + | 2449 | m_log.Info("[INTERREGION]: Denied prim crossing for " + |
2449 | "banned avatar"); | 2450 | "banned avatar"); |
@@ -2547,6 +2548,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
2547 | return 2; // StateSource.PrimCrossing | 2548 | return 2; // StateSource.PrimCrossing |
2548 | } | 2549 | } |
2549 | 2550 | ||
2551 | public int GetUserFlags(UUID user) | ||
2552 | { | ||
2553 | //Unfortunately the SP approach means that the value is cached until region is restarted | ||
2554 | /* | ||
2555 | ScenePresence sp; | ||
2556 | if (TryGetScenePresence(user, out sp)) | ||
2557 | { | ||
2558 | return sp.UserFlags; | ||
2559 | } | ||
2560 | else | ||
2561 | { | ||
2562 | */ | ||
2563 | UserAccount uac = UserAccountService.GetUserAccount(RegionInfo.ScopeID, user); | ||
2564 | return uac.UserFlags; | ||
2565 | //} | ||
2566 | } | ||
2550 | #endregion | 2567 | #endregion |
2551 | 2568 | ||
2552 | #region Add/Remove Avatar Methods | 2569 | #region Add/Remove Avatar Methods |
@@ -3626,10 +3643,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
3626 | 3643 | ||
3627 | if (m_regInfo.EstateSettings != null) | 3644 | if (m_regInfo.EstateSettings != null) |
3628 | { | 3645 | { |
3629 | if (m_regInfo.EstateSettings.IsBanned(agentID)) | 3646 | int flags = GetUserFlags(agent.AgentID); |
3647 | if (m_regInfo.EstateSettings.IsBanned(agentID, flags)) | ||
3630 | { | 3648 | { |
3631 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} at {1} because the user is on the banlist", | 3649 | //Add some more info to help users |
3650 | if (!m_regInfo.EstateSettings.IsBanned(agentID, 32)) | ||
3651 | { | ||
3652 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} at {1} because the region requires age verification", | ||
3632 | agentID, RegionInfo.RegionName); | 3653 | agentID, RegionInfo.RegionName); |
3654 | reason = String.Format("Denied access to region {0}: Region requires age verification", RegionInfo.RegionName); | ||
3655 | return false; | ||
3656 | } | ||
3657 | if (!m_regInfo.EstateSettings.IsBanned(agentID, 4)) | ||
3658 | { | ||
3659 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} {1} because the region requires payment info on file", | ||
3660 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); | ||
3661 | reason = String.Format("Denied access to region {0}: Region requires payment info on file", RegionInfo.RegionName); | ||
3662 | return false; | ||
3663 | } | ||
3664 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} at {3} because the user is on the banlist", | ||
3665 | agent.AgentID, RegionInfo.RegionName); | ||
3633 | reason = String.Format("Denied access to region {0}: You have been banned from that region.", | 3666 | reason = String.Format("Denied access to region {0}: You have been banned from that region.", |
3634 | RegionInfo.RegionName); | 3667 | RegionInfo.RegionName); |
3635 | return false; | 3668 | return false; |
@@ -3788,7 +3821,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3788 | 3821 | ||
3789 | // We have to wait until the viewer contacts this region after receiving EAC. | 3822 | // We have to wait until the viewer contacts this region after receiving EAC. |
3790 | // That calls AddNewClient, which finally creates the ScenePresence | 3823 | // That calls AddNewClient, which finally creates the ScenePresence |
3791 | if (m_regInfo.EstateSettings.IsBanned(cAgentData.AgentID)) | 3824 | int flags = GetUserFlags(cAgentData.AgentID); |
3825 | if (m_regInfo.EstateSettings.IsBanned(cAgentData.AgentID, flags)) | ||
3792 | { | 3826 | { |
3793 | m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: banned", cAgentData.AgentID); | 3827 | m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: banned", cAgentData.AgentID); |
3794 | return false; | 3828 | return false; |