diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4f674a3..8fe2d72 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3699,14 +3699,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
3699 | sp.ControllingClient.Close(true); | 3699 | sp.ControllingClient.Close(true); |
3700 | sp = null; | 3700 | sp = null; |
3701 | } | 3701 | } |
3702 | 3702 | ||
3703 | // Optimistic: add or update the circuit data with the new agent circuit data and teleport flags. | ||
3704 | // We need the circuit data here for some of the subsequent checks. (groups, for example) | ||
3705 | // If the checks fail, we remove the circuit. | ||
3706 | agent.teleportFlags = teleportFlags; | ||
3707 | m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); | ||
3708 | |||
3703 | land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); | 3709 | land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); |
3704 | 3710 | ||
3705 | //On login test land permisions | 3711 | // On login test land permisions |
3706 | if (vialogin) | 3712 | if (vialogin) |
3707 | { | 3713 | { |
3708 | if (land != null && !TestLandRestrictions(agent.AgentID, out reason, ref agent.startpos.X, ref agent.startpos.Y)) | 3714 | if (land != null && !TestLandRestrictions(agent.AgentID, out reason, ref agent.startpos.X, ref agent.startpos.Y)) |
3709 | { | 3715 | { |
3716 | m_authenticateHandler.RemoveCircuit(agent.circuitcode); | ||
3710 | return false; | 3717 | return false; |
3711 | } | 3718 | } |
3712 | } | 3719 | } |
@@ -3718,13 +3725,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3718 | try | 3725 | try |
3719 | { | 3726 | { |
3720 | if (!VerifyUserPresence(agent, out reason)) | 3727 | if (!VerifyUserPresence(agent, out reason)) |
3728 | { | ||
3729 | m_authenticateHandler.RemoveCircuit(agent.circuitcode); | ||
3721 | return false; | 3730 | return false; |
3731 | } | ||
3722 | } | 3732 | } |
3723 | catch (Exception e) | 3733 | catch (Exception e) |
3724 | { | 3734 | { |
3725 | m_log.ErrorFormat( | 3735 | m_log.ErrorFormat( |
3726 | "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace); | 3736 | "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace); |
3727 | 3737 | ||
3738 | m_authenticateHandler.RemoveCircuit(agent.circuitcode); | ||
3728 | return false; | 3739 | return false; |
3729 | } | 3740 | } |
3730 | } | 3741 | } |
@@ -3732,13 +3743,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3732 | try | 3743 | try |
3733 | { | 3744 | { |
3734 | if (!AuthorizeUser(agent, out reason)) | 3745 | if (!AuthorizeUser(agent, out reason)) |
3746 | { | ||
3747 | m_authenticateHandler.RemoveCircuit(agent.circuitcode); | ||
3735 | return false; | 3748 | return false; |
3749 | } | ||
3736 | } | 3750 | } |
3737 | catch (Exception e) | 3751 | catch (Exception e) |
3738 | { | 3752 | { |
3739 | m_log.ErrorFormat( | 3753 | m_log.ErrorFormat( |
3740 | "[SCENE]: Exception authorizing user {0}{1}", e.Message, e.StackTrace); | 3754 | "[SCENE]: Exception authorizing user {0}{1}", e.Message, e.StackTrace); |
3741 | 3755 | ||
3756 | m_authenticateHandler.RemoveCircuit(agent.circuitcode); | ||
3742 | return false; | 3757 | return false; |
3743 | } | 3758 | } |
3744 | 3759 | ||
@@ -3773,9 +3788,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3773 | } | 3788 | } |
3774 | } | 3789 | } |
3775 | 3790 | ||
3776 | // In all cases, add or update the circuit data with the new agent circuit data and teleport flags | ||
3777 | agent.teleportFlags = teleportFlags; | ||
3778 | m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); | ||
3779 | 3791 | ||
3780 | if (vialogin) | 3792 | if (vialogin) |
3781 | { | 3793 | { |