diff options
Final part for implementing SendChildAgentDataUpdate with modules. This is the part that uses the modules in Scene and related classes. This commit breaks compatibility of sim-sim SendChildAgentUpdates with older versions of OpenSim.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 2d0743c..6aa34e4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -149,6 +149,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
149 | protected IAvatarFactory m_AvatarFactory; | 149 | protected IAvatarFactory m_AvatarFactory; |
150 | protected IConfigSource m_config; | 150 | protected IConfigSource m_config; |
151 | protected IRegionSerialiserModule m_serialiser; | 151 | protected IRegionSerialiserModule m_serialiser; |
152 | protected IInterregionCommsOut m_interregionCommsOut; | ||
153 | protected IInterregionCommsIn m_interregionCommsIn; | ||
152 | 154 | ||
153 | // Central Update Loop | 155 | // Central Update Loop |
154 | 156 | ||
@@ -757,6 +759,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
757 | XferManager = RequestModuleInterface<IXfer>(); | 759 | XferManager = RequestModuleInterface<IXfer>(); |
758 | m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); | 760 | m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); |
759 | m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); | 761 | m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); |
762 | m_interregionCommsOut = RequestModuleInterface<IInterregionCommsOut>(); | ||
763 | m_interregionCommsIn = RequestModuleInterface<IInterregionCommsIn>(); | ||
760 | } | 764 | } |
761 | 765 | ||
762 | #endregion | 766 | #endregion |
@@ -896,10 +900,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
896 | { | 900 | { |
897 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); | 901 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); |
898 | } | 902 | } |
899 | catch (NullReferenceException e) | 903 | //catch (NullReferenceException e) |
900 | { | 904 | //{ |
901 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); | 905 | // m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); |
902 | } | 906 | //} |
903 | catch (InvalidOperationException e) | 907 | catch (InvalidOperationException e) |
904 | { | 908 | { |
905 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); | 909 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); |
@@ -1145,7 +1149,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1145 | RegisterCommsEvents(); | 1149 | RegisterCommsEvents(); |
1146 | 1150 | ||
1147 | // These two 'commands' *must be* next to each other or sim rebooting fails. | 1151 | // These two 'commands' *must be* next to each other or sim rebooting fails. |
1148 | m_sceneGridService.RegisterRegion(RegionInfo); | 1152 | m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); |
1149 | m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo); | 1153 | m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo); |
1150 | 1154 | ||
1151 | Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings(); | 1155 | Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings(); |
@@ -2690,12 +2694,21 @@ namespace OpenSim.Region.Environment.Scenes | |||
2690 | m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing; | 2694 | m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing; |
2691 | m_sceneGridService.OnCloseAgentConnection += CloseConnection; | 2695 | m_sceneGridService.OnCloseAgentConnection += CloseConnection; |
2692 | m_sceneGridService.OnRegionUp += OtherRegionUp; | 2696 | m_sceneGridService.OnRegionUp += OtherRegionUp; |
2693 | m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; | 2697 | //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; |
2694 | m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup; | 2698 | m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup; |
2695 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; | 2699 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; |
2696 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; | 2700 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; |
2697 | m_sceneGridService.KiPrimitive += SendKillObject; | 2701 | m_sceneGridService.KiPrimitive += SendKillObject; |
2698 | m_sceneGridService.OnGetLandData += GetLandData; | 2702 | m_sceneGridService.OnGetLandData += GetLandData; |
2703 | |||
2704 | if (m_interregionCommsIn != null) | ||
2705 | { | ||
2706 | m_log.Debug("[SCENE]: Registering with InterregionCommsIn"); | ||
2707 | m_interregionCommsIn.OnChildAgentUpdate += IncomingChildAgentDataUpdate; | ||
2708 | } | ||
2709 | else | ||
2710 | m_log.Debug("[SCENE]: Unable to register with InterregionCommsIn"); | ||
2711 | |||
2699 | } | 2712 | } |
2700 | 2713 | ||
2701 | /// <summary> | 2714 | /// <summary> |
@@ -2707,13 +2720,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
2707 | m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; | 2720 | m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; |
2708 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; | 2721 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; |
2709 | m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup; | 2722 | m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup; |
2710 | m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; | 2723 | //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; |
2711 | m_sceneGridService.OnRegionUp -= OtherRegionUp; | 2724 | m_sceneGridService.OnRegionUp -= OtherRegionUp; |
2712 | m_sceneGridService.OnExpectUser -= NewUserConnection; | 2725 | m_sceneGridService.OnExpectUser -= NewUserConnection; |
2713 | m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing; | 2726 | m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing; |
2714 | m_sceneGridService.OnCloseAgentConnection -= CloseConnection; | 2727 | m_sceneGridService.OnCloseAgentConnection -= CloseConnection; |
2715 | m_sceneGridService.OnGetLandData -= GetLandData; | 2728 | m_sceneGridService.OnGetLandData -= GetLandData; |
2716 | 2729 | ||
2730 | if (m_interregionCommsIn != null) | ||
2731 | m_interregionCommsIn.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; | ||
2732 | |||
2717 | m_sceneGridService.Close(); | 2733 | m_sceneGridService.Close(); |
2718 | } | 2734 | } |
2719 | 2735 | ||
@@ -2937,17 +2953,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
2937 | } | 2953 | } |
2938 | } | 2954 | } |
2939 | 2955 | ||
2940 | public virtual bool IncomingChildAgentDataUpdate(ChildAgentDataUpdate cAgentData) | 2956 | public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) |
2941 | { | 2957 | { |
2942 | ScenePresence childAgentUpdate = GetScenePresence(new UUID(cAgentData.AgentID)); | 2958 | //Console.WriteLine(" XXX Scene IncomingChildAgentDataUpdate in " + RegionInfo.RegionName); |
2959 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); | ||
2943 | if (childAgentUpdate != null) | 2960 | if (childAgentUpdate != null) |
2944 | { | 2961 | { |
2945 | // I can't imagine *yet* why we would get an update if the agent is a root agent.. | 2962 | // I can't imagine *yet* why we would get an update if the agent is a root agent.. |
2946 | // however to avoid a race condition crossing borders.. | 2963 | // however to avoid a race condition crossing borders.. |
2947 | if (childAgentUpdate.IsChildAgent) | 2964 | if (childAgentUpdate.IsChildAgent) |
2948 | { | 2965 | { |
2949 | uint rRegionX = (uint)(cAgentData.regionHandle >> 40); | 2966 | uint rRegionX = (uint)(cAgentData.RegionHandle >> 40); |
2950 | uint rRegionY = (((uint)(cAgentData.regionHandle)) >> 8); | 2967 | uint rRegionY = (((uint)(cAgentData.RegionHandle)) >> 8); |
2951 | uint tRegionX = RegionInfo.RegionLocX; | 2968 | uint tRegionX = RegionInfo.RegionLocX; |
2952 | uint tRegionY = RegionInfo.RegionLocY; | 2969 | uint tRegionY = RegionInfo.RegionLocY; |
2953 | //Send Data to ScenePresence | 2970 | //Send Data to ScenePresence |
@@ -3131,7 +3148,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
3131 | return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying); | 3148 | return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying); |
3132 | } | 3149 | } |
3133 | 3150 | ||
3134 | public void SendOutChildAgentUpdates(ChildAgentDataUpdate cadu, ScenePresence presence) | 3151 | public void SendOutChildAgentUpdates(AgentData cadu, ScenePresence presence) |
3135 | { | 3152 | { |
3136 | m_sceneGridService.SendChildAgentDataUpdate(cadu, presence); | 3153 | m_sceneGridService.SendChildAgentDataUpdate(cadu, presence); |
3137 | } | 3154 | } |