aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-11-12 19:12:33 +0000
committerJustin Clarke Casey2008-11-12 19:12:33 +0000
commitb636bb0f9ec50252164da6e94f2f7b71af8afe6b (patch)
tree64487d9680429e3ffc708e03dd33f8d5522cf802 /OpenSim/Region/Environment/Scenes/Scene.cs
parentChange HTTP server backlog/acceptors to 64, per Adam Z (diff)
downloadopensim-SC_OLD-b636bb0f9ec50252164da6e94f2f7b71af8afe6b.zip
opensim-SC_OLD-b636bb0f9ec50252164da6e94f2f7b71af8afe6b.tar.gz
opensim-SC_OLD-b636bb0f9ec50252164da6e94f2f7b71af8afe6b.tar.bz2
opensim-SC_OLD-b636bb0f9ec50252164da6e94f2f7b71af8afe6b.tar.xz
* Stop the pointless passing of a scene's own region handler back to it in region comms
* Some scene methods ignored it, others did nothing if the region handler given did not match their own (which would never be triggered)
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs178
1 files changed, 82 insertions, 96 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index ceadf7a..0d0823e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2106,9 +2106,10 @@ namespace OpenSim.Region.Environment.Scenes
2106 /// <param name="objXMLData"></param> 2106 /// <param name="objXMLData"></param>
2107 /// <param name="XMLMethod"></param> 2107 /// <param name="XMLMethod"></param>
2108 /// <returns></returns> 2108 /// <returns></returns>
2109 public bool IncomingInterRegionPrimGroup(ulong regionHandle, UUID primID, string objXMLData, int XMLMethod) 2109 public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod)
2110 { 2110 {
2111 m_log.Warn("[INTERREGION]: A new prim arrived from a neighbor"); 2111 m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID);
2112
2112 if (XMLMethod == 0) 2113 if (XMLMethod == 0)
2113 { 2114 {
2114 SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); 2115 SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData);
@@ -2702,51 +2703,42 @@ namespace OpenSim.Region.Environment.Scenes
2702 /// </summary> 2703 /// </summary>
2703 /// <param name="regionHandle"></param> 2704 /// <param name="regionHandle"></param>
2704 /// <param name="agent"></param> 2705 /// <param name="agent"></param>
2705 public void NewUserConnection(ulong regionHandle, AgentCircuitData agent) 2706 public void NewUserConnection(AgentCircuitData agent)
2706 { 2707 {
2707 if (regionHandle == m_regInfo.RegionHandle) 2708 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID))
2708 { 2709 {
2709 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) 2710 m_log.WarnFormat(
2710 { 2711 "[CONNECTION DEBUGGING]: Denied access to: {0} at {1} because the user is on the region banlist",
2711 m_log.WarnFormat( 2712 agent.AgentID, RegionInfo.RegionName);
2712 "[CONNECTION DEBUGGING]: Denied access to: {0} [{1}] at {2} because the user is on the region banlist", 2713 }
2713 agent.AgentID, regionHandle, RegionInfo.RegionName);
2714 }
2715 2714
2716 capsPaths[agent.AgentID] = agent.CapsPath; 2715 capsPaths[agent.AgentID] = agent.CapsPath;
2717 2716
2718 if (!agent.child) 2717 if (!agent.child)
2719 { 2718 {
2720 AddCapsHandler(agent.AgentID); 2719 AddCapsHandler(agent.AgentID);
2721 2720
2722 // Honor parcel landing type and position. 2721 // Honor parcel landing type and position.
2723 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); 2722 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
2724 if (land != null) 2723 if (land != null)
2724 {
2725 if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero)
2725 { 2726 {
2726 if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero) 2727 agent.startpos = land.landData.UserLocation;
2727 {
2728 agent.startpos = land.landData.UserLocation;
2729 }
2730 } 2728 }
2731 } 2729 }
2730 }
2732 2731
2733 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 2732 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
2734 // rewrite session_id 2733 // rewrite session_id
2735 CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID); 2734 CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID);
2736 if (userinfo != null) 2735 if (userinfo != null)
2737 { 2736 {
2738 userinfo.SessionID = agent.SessionID; 2737 userinfo.SessionID = agent.SessionID;
2739 }
2740 else
2741 {
2742 m_log.WarnFormat("[USERINFO CACHE]: We couldn't find a User Info record for {0}. This is usually an indication that the UUID we're looking up is invalid", agent.AgentID);
2743 }
2744 } 2738 }
2745 else 2739 else
2746 { 2740 {
2747 m_log.WarnFormat( 2741 m_log.WarnFormat("[USERINFO CACHE]: We couldn't find a User Info record for {0}. This is usually an indication that the UUID we're looking up is invalid", agent.AgentID);
2748 "[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}",
2749 agent.AgentID, regionHandle, RegionInfo.RegionName);
2750 } 2742 }
2751 } 2743 }
2752 2744
@@ -2760,31 +2752,28 @@ namespace OpenSim.Region.Environment.Scenes
2760 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); 2752 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc);
2761 } 2753 }
2762 2754
2763 protected void HandleLogOffUserFromGrid(ulong regionHandle, UUID AvatarID, UUID RegionSecret, string message) 2755 protected void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
2764 { 2756 {
2765 if (RegionInfo.RegionHandle == regionHandle) 2757 ScenePresence loggingOffUser = null;
2758 loggingOffUser = GetScenePresence(AvatarID);
2759 if (loggingOffUser != null)
2766 { 2760 {
2767 ScenePresence loggingOffUser = null; 2761 if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId)
2768 loggingOffUser = GetScenePresence(AvatarID);
2769 if (loggingOffUser != null)
2770 { 2762 {
2771 if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId) 2763 loggingOffUser.ControllingClient.Kick(message);
2772 { 2764 // Give them a second to receive the message!
2773 loggingOffUser.ControllingClient.Kick(message); 2765 System.Threading.Thread.Sleep(1000);
2774 // Give them a second to receive the message! 2766 loggingOffUser.ControllingClient.Close(true);
2775 System.Threading.Thread.Sleep(1000);
2776 loggingOffUser.ControllingClient.Close(true);
2777 }
2778 else
2779 {
2780 m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
2781 }
2782 } 2767 }
2783 else 2768 else
2784 { 2769 {
2785 m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString()); 2770 m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
2786 } 2771 }
2787 } 2772 }
2773 else
2774 {
2775 m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
2776 }
2788 } 2777 }
2789 2778
2790 /// <summary> 2779 /// <summary>
@@ -2865,42 +2854,38 @@ namespace OpenSim.Region.Environment.Scenes
2865 /// <summary> 2854 /// <summary>
2866 /// Triggered when an agent crosses into this sim. Also happens on initial login. 2855 /// Triggered when an agent crosses into this sim. Also happens on initial login.
2867 /// </summary> 2856 /// </summary>
2868 /// <param name="regionHandle"></param>
2869 /// <param name="agentID"></param> 2857 /// <param name="agentID"></param>
2870 /// <param name="position"></param> 2858 /// <param name="position"></param>
2871 /// <param name="isFlying"></param> 2859 /// <param name="isFlying"></param>
2872 public virtual void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) 2860 public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
2873 { 2861 {
2874 if (regionHandle == m_regInfo.RegionHandle) 2862 ScenePresence presence;
2863
2864 lock (m_scenePresences)
2875 { 2865 {
2876 ScenePresence presence; 2866 m_scenePresences.TryGetValue(agentID, out presence);
2877 2867 }
2878 lock (m_scenePresences) 2868
2869 if (presence != null)
2870 {
2871 try
2879 { 2872 {
2880 m_scenePresences.TryGetValue(agentID, out presence); 2873 presence.MakeRootAgent(position, isFlying);
2881 } 2874 }
2882 2875 catch (Exception e)
2883 if (presence != null)
2884 {
2885 try
2886 {
2887 presence.MakeRootAgent(position, isFlying);
2888 }
2889 catch (Exception e)
2890 {
2891 m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}", e);
2892 }
2893 }
2894 else
2895 { 2876 {
2896 m_log.ErrorFormat( 2877 m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}", e);
2897 "[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
2898 agentID, RegionInfo.RegionName);
2899 } 2878 }
2900 } 2879 }
2880 else
2881 {
2882 m_log.ErrorFormat(
2883 "[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
2884 agentID, RegionInfo.RegionName);
2885 }
2901 } 2886 }
2902 2887
2903 public virtual bool IncomingChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) 2888 public virtual bool IncomingChildAgentDataUpdate(ChildAgentDataUpdate cAgentData)
2904 { 2889 {
2905 ScenePresence childAgentUpdate = GetScenePresence(new UUID(cAgentData.AgentID)); 2890 ScenePresence childAgentUpdate = GetScenePresence(new UUID(cAgentData.AgentID));
2906 if (childAgentUpdate != null) 2891 if (childAgentUpdate != null)
@@ -2918,8 +2903,10 @@ namespace OpenSim.Region.Environment.Scenes
2918 // Not Implemented: 2903 // Not Implemented:
2919 //TODO: Do we need to pass the message on to one of our neighbors? 2904 //TODO: Do we need to pass the message on to one of our neighbors?
2920 } 2905 }
2906
2921 return true; 2907 return true;
2922 } 2908 }
2909
2923 return false; 2910 return false;
2924 } 2911 }
2925 2912
@@ -2928,29 +2915,28 @@ namespace OpenSim.Region.Environment.Scenes
2928 /// </summary> 2915 /// </summary>
2929 /// <param name="regionHandle"></param> 2916 /// <param name="regionHandle"></param>
2930 /// <param name="agentID"></param> 2917 /// <param name="agentID"></param>
2931 public bool CloseConnection(ulong regionHandle, UUID agentID) 2918 public bool CloseConnection(UUID agentID)
2932 { 2919 {
2933 if (regionHandle == m_regionHandle) 2920 ScenePresence presence = m_innerScene.GetScenePresence(agentID);
2921
2922 if (presence != null)
2934 { 2923 {
2935 ScenePresence presence = m_innerScene.GetScenePresence(agentID); 2924 // Nothing is removed here, so down count it as such
2936 if (presence != null) 2925 // if (presence.IsChildAgent)
2937 { 2926 // {
2938 // Nothing is removed here, so down count it as such 2927 // m_innerScene.removeUserCount(false);
2939 // if (presence.IsChildAgent) 2928 // }
2940 // { 2929 // else
2941 // m_innerScene.removeUserCount(false); 2930 // {
2942 // } 2931 // m_innerScene.removeUserCount(true);
2943 // else 2932 // }
2944 // { 2933
2945 // m_innerScene.removeUserCount(true); 2934 // Tell a single agent to disconnect from the region.
2946 // } 2935 presence.ControllingClient.SendShutdownConnectionNotice();
2947 2936
2948 // Tell a single agent to disconnect from the region. 2937 presence.ControllingClient.Close(true);
2949 presence.ControllingClient.SendShutdownConnectionNotice();
2950
2951 presence.ControllingClient.Close(true);
2952 }
2953 } 2938 }
2939
2954 return true; 2940 return true;
2955 } 2941 }
2956 2942