diff options
Diffstat (limited to 'OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs')
-rw-r--r-- | OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 905540d..3144d76 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | |||
@@ -39,8 +39,11 @@ using OpenSim.Framework.Console; | |||
39 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.Physics.Manager; |
40 | using Mono.Addins; | 40 | using Mono.Addins; |
41 | 41 | ||
42 | [assembly: Addin("RegionCombinerModule", "0.1")] | ||
43 | [assembly: AddinDependency("OpenSim", "0.5")] | ||
42 | namespace OpenSim.Region.RegionCombinerModule | 44 | namespace OpenSim.Region.RegionCombinerModule |
43 | { | 45 | { |
46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | ||
44 | public class RegionCombinerModule : ISharedRegionModule, IRegionCombinerModule | 47 | public class RegionCombinerModule : ISharedRegionModule, IRegionCombinerModule |
45 | { | 48 | { |
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -719,21 +722,21 @@ namespace OpenSim.Region.RegionCombinerModule | |||
719 | rootConn.ClientEventForwarder = new RegionCombinerClientEventForwarder(rootConn); | 722 | rootConn.ClientEventForwarder = new RegionCombinerClientEventForwarder(rootConn); |
720 | 723 | ||
721 | // Sets up the CoarseLocationUpdate forwarder for this root region | 724 | // Sets up the CoarseLocationUpdate forwarder for this root region |
722 | scene.EventManager.OnNewPresence += SetCoarseLocationDelegate; | 725 | scene.EventManager.OnNewPresence += SetCourseLocationDelegate; |
723 | 726 | ||
724 | // Adds this root region to a dictionary of regions that are connectable | 727 | // Adds this root region to a dictionary of regions that are connectable |
725 | m_regions.Add(scene.RegionInfo.originRegionID, rootConn); | 728 | m_regions.Add(scene.RegionInfo.originRegionID, rootConn); |
726 | } | 729 | } |
727 | } | 730 | } |
728 | 731 | ||
729 | private void SetCoarseLocationDelegate(ScenePresence presence) | 732 | private void SetCourseLocationDelegate(ScenePresence presence) |
730 | { | 733 | { |
731 | presence.SetSendCoarseLocationMethod(SendCoarseLocationUpdates); | 734 | presence.SetSendCourseLocationMethod(SendCourseLocationUpdates); |
732 | } | 735 | } |
733 | 736 | ||
734 | // This delegate was refactored for non-combined regions. | 737 | // This delegate was refactored for non-combined regions. |
735 | // This combined region version will not use the pre-compiled lists of locations and ids | 738 | // This combined region version will not use the pre-compiled lists of locations and ids |
736 | private void SendCoarseLocationUpdates(UUID sceneId, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) | 739 | private void SendCourseLocationUpdates(UUID sceneId, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) |
737 | { | 740 | { |
738 | RegionConnections connectiondata = null; | 741 | RegionConnections connectiondata = null; |
739 | lock (m_regions) | 742 | lock (m_regions) |
@@ -756,18 +759,18 @@ namespace OpenSim.Region.RegionCombinerModule | |||
756 | } | 759 | } |
757 | }); | 760 | }); |
758 | 761 | ||
759 | DistributeCoarseLocationUpdates(CoarseLocations, AvatarUUIDs, connectiondata, presence); | 762 | DistributeCourseLocationUpdates(CoarseLocations, AvatarUUIDs, connectiondata, presence); |
760 | } | 763 | } |
761 | 764 | ||
762 | private void DistributeCoarseLocationUpdates(List<Vector3> locations, List<UUID> uuids, | 765 | private void DistributeCourseLocationUpdates(List<Vector3> locations, List<UUID> uuids, |
763 | RegionConnections connectiondata, ScenePresence rootPresence) | 766 | RegionConnections connectiondata, ScenePresence rootPresence) |
764 | { | 767 | { |
765 | RegionData[] rdata = connectiondata.ConnectedRegions.ToArray(); | 768 | RegionData[] rdata = connectiondata.ConnectedRegions.ToArray(); |
766 | //List<IClientAPI> clients = new List<IClientAPI>(); | 769 | //List<IClientAPI> clients = new List<IClientAPI>(); |
767 | Dictionary<Vector2, RegionCoarseLocationStruct> updates = new Dictionary<Vector2, RegionCoarseLocationStruct>(); | 770 | Dictionary<Vector2, RegionCourseLocationStruct> updates = new Dictionary<Vector2, RegionCourseLocationStruct>(); |
768 | 771 | ||
769 | // Root Region entry | 772 | // Root Region entry |
770 | RegionCoarseLocationStruct rootupdatedata = new RegionCoarseLocationStruct(); | 773 | RegionCourseLocationStruct rootupdatedata = new RegionCourseLocationStruct(); |
771 | rootupdatedata.Locations = new List<Vector3>(); | 774 | rootupdatedata.Locations = new List<Vector3>(); |
772 | rootupdatedata.Uuids = new List<UUID>(); | 775 | rootupdatedata.Uuids = new List<UUID>(); |
773 | rootupdatedata.Offset = Vector2.Zero; | 776 | rootupdatedata.Offset = Vector2.Zero; |
@@ -781,7 +784,7 @@ namespace OpenSim.Region.RegionCombinerModule | |||
781 | foreach (RegionData regiondata in rdata) | 784 | foreach (RegionData regiondata in rdata) |
782 | { | 785 | { |
783 | Vector2 offset = new Vector2(regiondata.Offset.X, regiondata.Offset.Y); | 786 | Vector2 offset = new Vector2(regiondata.Offset.X, regiondata.Offset.Y); |
784 | RegionCoarseLocationStruct updatedata = new RegionCoarseLocationStruct(); | 787 | RegionCourseLocationStruct updatedata = new RegionCourseLocationStruct(); |
785 | updatedata.Locations = new List<Vector3>(); | 788 | updatedata.Locations = new List<Vector3>(); |
786 | updatedata.Uuids = new List<UUID>(); | 789 | updatedata.Uuids = new List<UUID>(); |
787 | updatedata.Offset = offset; | 790 | updatedata.Offset = offset; |
@@ -807,7 +810,7 @@ namespace OpenSim.Region.RegionCombinerModule | |||
807 | if (!updates.ContainsKey(offset)) | 810 | if (!updates.ContainsKey(offset)) |
808 | { | 811 | { |
809 | // This shouldn't happen | 812 | // This shouldn't happen |
810 | RegionCoarseLocationStruct updatedata = new RegionCoarseLocationStruct(); | 813 | RegionCourseLocationStruct updatedata = new RegionCourseLocationStruct(); |
811 | updatedata.Locations = new List<Vector3>(); | 814 | updatedata.Locations = new List<Vector3>(); |
812 | updatedata.Uuids = new List<UUID>(); | 815 | updatedata.Uuids = new List<UUID>(); |
813 | updatedata.Offset = offset; | 816 | updatedata.Offset = offset; |