diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2ca82ca..99248c1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2443,14 +2443,7 @@ 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 | int flags = 0; | 2446 | int flags = GetUserFlags(sceneObject.OwnerID); |
2447 | ScenePresence sp; | ||
2448 | if (TryGetScenePresence(sceneObject.OwnerID, out sp)) | ||
2449 | { | ||
2450 | flags = sp.UserFlags; | ||
2451 | } | ||
2452 | |||
2453 | |||
2454 | if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID, flags)) | 2447 | if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID, flags)) |
2455 | { | 2448 | { |
2456 | m_log.Info("[INTERREGION]: Denied prim crossing for " + | 2449 | m_log.Info("[INTERREGION]: Denied prim crossing for " + |
@@ -2480,7 +2473,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2480 | SceneObjectPart RootPrim = sceneObject.RootPart; | 2473 | SceneObjectPart RootPrim = sceneObject.RootPart; |
2481 | 2474 | ||
2482 | // Fix up attachment Parent Local ID | 2475 | // Fix up attachment Parent Local ID |
2483 | sp = GetScenePresence(sceneObject.OwnerID); | 2476 | ScenePresence sp = GetScenePresence(sceneObject.OwnerID); |
2484 | 2477 | ||
2485 | if (sp != null) | 2478 | if (sp != null) |
2486 | { | 2479 | { |
@@ -2554,7 +2547,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
2554 | } | 2547 | } |
2555 | return 2; // StateSource.PrimCrossing | 2548 | return 2; // StateSource.PrimCrossing |
2556 | } | 2549 | } |
2557 | 2550 | public int GetUserFlags(UUID user) | |
2551 | { | ||
2552 | //Unfortunately the SP approach means that the value is cached until region is restarted | ||
2553 | /* | ||
2554 | ScenePresence sp; | ||
2555 | if (TryGetScenePresence(user, out sp)) | ||
2556 | { | ||
2557 | return sp.UserFlags; | ||
2558 | } | ||
2559 | else | ||
2560 | { | ||
2561 | */ | ||
2562 | UserAccount uac = UserAccountService.GetUserAccount(RegionInfo.ScopeID, user, false); | ||
2563 | return uac.UserFlags; | ||
2564 | //} | ||
2565 | } | ||
2558 | #endregion | 2566 | #endregion |
2559 | 2567 | ||
2560 | #region Add/Remove Avatar Methods | 2568 | #region Add/Remove Avatar Methods |
@@ -3625,12 +3633,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3625 | 3633 | ||
3626 | if (m_regInfo.EstateSettings != null) | 3634 | if (m_regInfo.EstateSettings != null) |
3627 | { | 3635 | { |
3628 | int flags = 0; | 3636 | int flags = GetUserFlags(agent.AgentID); |
3629 | ScenePresence sp; | ||
3630 | if (TryGetScenePresence(agent.AgentID, out sp)) | ||
3631 | { | ||
3632 | flags = sp.UserFlags; | ||
3633 | } | ||
3634 | if ((!m_seeIntoBannedRegion) && m_regInfo.EstateSettings.IsBanned(agent.AgentID, flags)) | 3637 | if ((!m_seeIntoBannedRegion) && m_regInfo.EstateSettings.IsBanned(agent.AgentID, flags)) |
3635 | { | 3638 | { |
3636 | //Add some more info to help users | 3639 | //Add some more info to help users |
@@ -3836,12 +3839,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3836 | 3839 | ||
3837 | // We have to wait until the viewer contacts this region after receiving EAC. | 3840 | // We have to wait until the viewer contacts this region after receiving EAC. |
3838 | // That calls AddNewClient, which finally creates the ScenePresence | 3841 | // That calls AddNewClient, which finally creates the ScenePresence |
3839 | int flags = 0; | 3842 | int flags = GetUserFlags(cAgentData.AgentID); |
3840 | ScenePresence sp; | ||
3841 | if (TryGetScenePresence(cAgentData.AgentID, out sp)) | ||
3842 | { | ||
3843 | flags = sp.UserFlags; | ||
3844 | } | ||
3845 | if (m_regInfo.EstateSettings.IsBanned(cAgentData.AgentID, flags)) | 3843 | if (m_regInfo.EstateSettings.IsBanned(cAgentData.AgentID, flags)) |
3846 | { | 3844 | { |
3847 | m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: banned", cAgentData.AgentID); | 3845 | m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: banned", cAgentData.AgentID); |