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')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 42 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 |
2 files changed, 46 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; |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6a3983f..c4ae0f0 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -113,6 +113,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
113 | { | 113 | { |
114 | get { return m_attachments; } | 114 | get { return m_attachments; } |
115 | } | 115 | } |
116 | |||
116 | protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>(); | 117 | protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>(); |
117 | 118 | ||
118 | private Dictionary<UUID, ScriptControllers> scriptedcontrols = new Dictionary<UUID, ScriptControllers>(); | 119 | private Dictionary<UUID, ScriptControllers> scriptedcontrols = new Dictionary<UUID, ScriptControllers>(); |
@@ -136,6 +137,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
136 | private bool m_updateflag; | 137 | private bool m_updateflag; |
137 | private byte m_movementflag; | 138 | private byte m_movementflag; |
138 | private Vector3? m_forceToApply; | 139 | private Vector3? m_forceToApply; |
140 | private int m_userFlags; | ||
141 | public int UserFlags | ||
142 | { | ||
143 | get { return m_userFlags; } | ||
144 | } | ||
145 | |||
139 | private uint m_requestedSitTargetID; | 146 | private uint m_requestedSitTargetID; |
140 | private UUID m_requestedSitTargetUUID; | 147 | private UUID m_requestedSitTargetUUID; |
141 | public bool SitGround = false; | 148 | public bool SitGround = false; |
@@ -763,6 +770,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
763 | m_localId = m_scene.AllocateLocalId(); | 770 | m_localId = m_scene.AllocateLocalId(); |
764 | 771 | ||
765 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); | 772 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); |
773 | m_userFlags = account.UserFlags; | ||
766 | 774 | ||
767 | if (account != null) | 775 | if (account != null) |
768 | m_userLevel = account.UserLevel; | 776 | m_userLevel = account.UserLevel; |