aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs178
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs39
3 files changed, 102 insertions, 117 deletions
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
index ba40571..5b06408 100644
--- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
@@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
546 homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile); 546 homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile);
547 547
548 // Call 'new user' event handler 548 // Call 'new user' event handler
549 homeScene.NewUserConnection(reg.RegionHandle, agentData); 549 homeScene.NewUserConnection(agentData);
550 550
551 //string raCap = string.Empty; 551 //string raCap = string.Empty;
552 552
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
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 540303a..830a63d 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -155,22 +155,22 @@ namespace OpenSim.Region.Environment.Scenes
155 /// <param name="regionHandle"></param> 155 /// <param name="regionHandle"></param>
156 /// <param name="agent"></param> 156 /// <param name="agent"></param>
157 /// 157 ///
158 protected void NewUserConnection(ulong regionHandle, AgentCircuitData agent) 158 protected void NewUserConnection(AgentCircuitData agent)
159 { 159 {
160 handlerExpectUser = OnExpectUser; 160 handlerExpectUser = OnExpectUser;
161 if (handlerExpectUser != null) 161 if (handlerExpectUser != null)
162 { 162 {
163 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname); 163 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname);
164 handlerExpectUser(regionHandle, agent); 164 handlerExpectUser(agent);
165 } 165 }
166 } 166 }
167 167
168 protected void GridLogOffUser(ulong regionHandle, UUID AgentID, UUID RegionSecret, string message) 168 protected void GridLogOffUser(UUID AgentID, UUID RegionSecret, string message)
169 { 169 {
170 handlerLogOffUser = OnLogOffUser; 170 handlerLogOffUser = OnLogOffUser;
171 if (handlerLogOffUser != null) 171 if (handlerLogOffUser != null)
172 { 172 {
173 handlerLogOffUser(regionHandle, AgentID, RegionSecret, message); 173 handlerLogOffUser(AgentID, RegionSecret, message);
174 } 174 }
175 } 175 }
176 176
@@ -185,31 +185,31 @@ namespace OpenSim.Region.Environment.Scenes
185 return true; 185 return true;
186 } 186 }
187 187
188 protected bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) 188 protected bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData)
189 { 189 {
190 handlerChildAgentUpdate = OnChildAgentUpdate; 190 handlerChildAgentUpdate = OnChildAgentUpdate;
191 if (handlerChildAgentUpdate != null) 191 if (handlerChildAgentUpdate != null)
192 handlerChildAgentUpdate(regionHandle, cAgentData); 192 handlerChildAgentUpdate(cAgentData);
193 193
194 194
195 return true; 195 return true;
196 } 196 }
197 197
198 protected void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) 198 protected void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
199 { 199 {
200 handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; 200 handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion;
201 if (handlerAvatarCrossingIntoRegion != null) 201 if (handlerAvatarCrossingIntoRegion != null)
202 { 202 {
203 handlerAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying); 203 handlerAvatarCrossingIntoRegion(agentID, position, isFlying);
204 } 204 }
205 } 205 }
206 206
207 protected bool IncomingPrimCrossing(ulong regionHandle, UUID primID, String objXMLData, int XMLMethod) 207 protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod)
208 { 208 {
209 handlerExpectPrim = OnExpectPrim; 209 handlerExpectPrim = OnExpectPrim;
210 if (handlerExpectPrim != null) 210 if (handlerExpectPrim != null)
211 { 211 {
212 return handlerExpectPrim(regionHandle, primID, objXMLData, XMLMethod); 212 return handlerExpectPrim(primID, objXMLData, XMLMethod);
213 } 213 }
214 else 214 else
215 { 215 {
@@ -218,23 +218,25 @@ namespace OpenSim.Region.Environment.Scenes
218 218
219 } 219 }
220 220
221 protected void PrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isPhysical) 221 protected void PrimCrossing(UUID primID, Vector3 position, bool isPhysical)
222 { 222 {
223 handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; 223 handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
224 if (handlerPrimCrossingIntoRegion != null) 224 if (handlerPrimCrossingIntoRegion != null)
225 { 225 {
226 handlerPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical); 226 handlerPrimCrossingIntoRegion(primID, position, isPhysical);
227 } 227 }
228 } 228 }
229 229
230 protected bool CloseConnection(ulong regionHandle, UUID agentID) 230 protected bool CloseConnection(UUID agentID)
231 { 231 {
232 m_log.Info("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID.ToString()); 232 m_log.Debug("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID);
233
233 handlerCloseAgentConnection = OnCloseAgentConnection; 234 handlerCloseAgentConnection = OnCloseAgentConnection;
234 if (handlerCloseAgentConnection != null) 235 if (handlerCloseAgentConnection != null)
235 { 236 {
236 return handlerCloseAgentConnection(regionHandle, agentID); 237 return handlerCloseAgentConnection(agentID);
237 } 238 }
239
238 return false; 240 return false;
239 } 241 }
240 242
@@ -416,8 +418,6 @@ namespace OpenSim.Region.Environment.Scenes
416 // yes, we're notifying ourselves. 418 // yes, we're notifying ourselves.
417 if (handlerRegionUp != null) 419 if (handlerRegionUp != null)
418 handlerRegionUp(region); 420 handlerRegionUp(region);
419
420
421 } 421 }
422 else 422 else
423 { 423 {
@@ -726,7 +726,7 @@ namespace OpenSim.Region.Environment.Scenes
726 { 726 {
727 SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList()); 727 SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList());
728 SendCloseChildAgentConnections(avatar.UUID, childRegions); 728 SendCloseChildAgentConnections(avatar.UUID, childRegions);
729 CloseConnection(m_regionInfo.RegionHandle, avatar.UUID); 729 CloseConnection(avatar.UUID);
730 } 730 }
731 // if (teleport success) // seems to be always success here 731 // if (teleport success) // seems to be always success here
732 // the user may change their profile information in other region, 732 // the user may change their profile information in other region,
@@ -763,7 +763,7 @@ namespace OpenSim.Region.Environment.Scenes
763 } 763 }
764 764
765 /// <summary> 765 /// <summary>
766 /// 766 /// Inform a neighbouring region that an avatar is about to cross into it.
767 /// </summary> 767 /// </summary>
768 /// <param name="regionhandle"></param> 768 /// <param name="regionhandle"></param>
769 /// <param name="agentID"></param> 769 /// <param name="agentID"></param>
@@ -778,7 +778,6 @@ namespace OpenSim.Region.Environment.Scenes
778 return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData, XMLMethod); 778 return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData, XMLMethod);
779 } 779 }
780 780
781
782 public Dictionary<string, string> GetGridSettings() 781 public Dictionary<string, string> GetGridSettings()
783 { 782 {
784 return m_commsProvider.GridService.GetGridSettings(); 783 return m_commsProvider.GridService.GetGridSettings();