aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs87
1 files changed, 37 insertions, 50 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 96e45ed..0d9028c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2955,6 +2955,7 @@ namespace OpenSim.Region.Framework.Scenes
2955 { 2955 {
2956 ScenePresence sp; 2956 ScenePresence sp;
2957 bool vialogin; 2957 bool vialogin;
2958 bool reallyNew = true;
2958 2959
2959 // Validation occurs in LLUDPServer 2960 // Validation occurs in LLUDPServer
2960 // 2961 //
@@ -3013,6 +3014,7 @@ namespace OpenSim.Region.Framework.Scenes
3013 m_log.WarnFormat( 3014 m_log.WarnFormat(
3014 "[SCENE]: Already found {0} scene presence for {1} in {2} when asked to add new scene presence", 3015 "[SCENE]: Already found {0} scene presence for {1} in {2} when asked to add new scene presence",
3015 sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName); 3016 sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName);
3017 reallyNew = false;
3016 } 3018 }
3017 3019
3018 // We must set this here so that TriggerOnNewClient and TriggerOnClientLogin can determine whether the 3020 // We must set this here so that TriggerOnNewClient and TriggerOnClientLogin can determine whether the
@@ -3024,7 +3026,9 @@ namespace OpenSim.Region.Framework.Scenes
3024 // places. However, we still need to do it here for NPCs. 3026 // places. However, we still need to do it here for NPCs.
3025 CacheUserName(sp, aCircuit); 3027 CacheUserName(sp, aCircuit);
3026 3028
3027 EventManager.TriggerOnNewClient(client); 3029 if (reallyNew)
3030 EventManager.TriggerOnNewClient(client);
3031
3028 if (vialogin) 3032 if (vialogin)
3029 EventManager.TriggerOnClientLogin(client); 3033 EventManager.TriggerOnClientLogin(client);
3030 } 3034 }
@@ -3583,15 +3587,8 @@ namespace OpenSim.Region.Framework.Scenes
3583 if (closeChildAgents && isChildAgent) 3587 if (closeChildAgents && isChildAgent)
3584 { 3588 {
3585 // Tell a single agent to disconnect from the region. 3589 // Tell a single agent to disconnect from the region.
3586 IEventQueue eq = RequestModuleInterface<IEventQueue>(); 3590 // Let's do this via UDP
3587 if (eq != null) 3591 avatar.ControllingClient.SendShutdownConnectionNotice();
3588 {
3589 eq.DisableSimulator(RegionInfo.RegionHandle, avatar.UUID);
3590 }
3591 else
3592 {
3593 avatar.ControllingClient.SendShutdownConnectionNotice();
3594 }
3595 } 3592 }
3596 3593
3597 // Only applies to root agents. 3594 // Only applies to root agents.
@@ -3834,42 +3831,40 @@ namespace OpenSim.Region.Framework.Scenes
3834 return false; 3831 return false;
3835 } 3832 }
3836 3833
3837 ScenePresence sp = GetScenePresence(agent.AgentID); 3834 lock (agent)
3838
3839 // If we have noo presence here or if that presence is a zombie root
3840 // presence that will be kicled, we need a new CAPS object.
3841 if (sp == null || (sp != null && !sp.IsChildAgent))
3842 { 3835 {
3843 if (CapsModule != null) 3836 ScenePresence sp = GetScenePresence(agent.AgentID);
3837
3838 if (sp != null)
3844 { 3839 {
3845 lock (agent) 3840 if (!sp.IsChildAgent)
3846 { 3841 {
3847 CapsModule.SetAgentCapsSeeds(agent); 3842 // We have a root agent. Is it in transit?
3848 CapsModule.CreateCaps(agent.AgentID, agent.circuitcode); 3843 if (!EntityTransferModule.IsInTransit(sp.UUID))
3849 } 3844 {
3850 } 3845 // We have a zombie from a crashed session.
3851 } 3846 // Or the same user is trying to be root twice here, won't work.
3847 // Kill it.
3848 m_log.WarnFormat(
3849 "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.",
3850 sp.Name, sp.UUID, RegionInfo.RegionName);
3852 3851
3853 if (sp != null) 3852 if (sp.ControllingClient != null)
3854 { 3853 sp.ControllingClient.Close(true, true);
3855 if (!sp.IsChildAgent)
3856 {
3857 // We have a zombie from a crashed session.
3858 // Or the same user is trying to be root twice here, won't work.
3859 // Kill it.
3860 m_log.WarnFormat(
3861 "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.",
3862 sp.Name, sp.UUID, RegionInfo.RegionName);
3863
3864 if (sp.ControllingClient != null)
3865 sp.ControllingClient.Close(true, true);
3866 3854
3867 sp = null; 3855 sp = null;
3856 }
3857 //else
3858 // m_log.WarnFormat("[SCENE]: Existing root scene presence for {0} {1} in {2}, but agent is in trasit", sp.Name, sp.UUID, RegionInfo.RegionName);
3859 }
3860 else
3861 {
3862 // We have a child agent here
3863 sp.DoNotCloseAfterTeleport = true;
3864 //m_log.WarnFormat("[SCENE]: Existing child scene presence for {0} {1} in {2}", sp.Name, sp.UUID, RegionInfo.RegionName);
3865 }
3868 } 3866 }
3869 }
3870 3867
3871 lock (agent)
3872 {
3873 // Optimistic: add or update the circuit data with the new agent circuit data and teleport flags. 3868 // Optimistic: add or update the circuit data with the new agent circuit data and teleport flags.
3874 // We need the circuit data here for some of the subsequent checks. (groups, for example) 3869 // We need the circuit data here for some of the subsequent checks. (groups, for example)
3875 // If the checks fail, we remove the circuit. 3870 // If the checks fail, we remove the circuit.
@@ -3950,7 +3945,10 @@ namespace OpenSim.Region.Framework.Scenes
3950 sp.AdjustKnownSeeds(); 3945 sp.AdjustKnownSeeds();
3951 3946
3952 if (CapsModule != null) 3947 if (CapsModule != null)
3948 {
3953 CapsModule.SetAgentCapsSeeds(agent); 3949 CapsModule.SetAgentCapsSeeds(agent);
3950 CapsModule.CreateCaps(agent.AgentID, agent.circuitcode);
3951 }
3954 } 3952 }
3955 } 3953 }
3956 3954
@@ -5829,17 +5827,6 @@ Environment.Exit(1);
5829 { 5827 {
5830 reason = "You are banned from the region"; 5828 reason = "You are banned from the region";
5831 5829
5832 if (EntityTransferModule.IsInTransit(agentID))
5833 {
5834 reason = "Agent is still in transit from this region";
5835
5836 m_log.WarnFormat(
5837 "[SCENE]: Denying agent {0} entry into {1} since region still has them registered as in transit",
5838 agentID, RegionInfo.RegionName);
5839
5840 return false;
5841 }
5842
5843 if (Permissions.IsGod(agentID)) 5830 if (Permissions.IsGod(agentID))
5844 { 5831 {
5845 reason = String.Empty; 5832 reason = String.Empty;