aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDiva Canto2010-06-13 19:06:22 -0700
committerDiva Canto2010-06-13 19:06:22 -0700
commit19558f380a1e9cbaff849eb15262266ea79b60d2 (patch)
tree1209b45e0beb2100d65b539db5a6ba3448ff7abb /OpenSim/Region
parentFox my changes to radmin (diff)
downloadopensim-SC_OLD-19558f380a1e9cbaff849eb15262266ea79b60d2.zip
opensim-SC_OLD-19558f380a1e9cbaff849eb15262266ea79b60d2.tar.gz
opensim-SC_OLD-19558f380a1e9cbaff849eb15262266ea79b60d2.tar.bz2
opensim-SC_OLD-19558f380a1e9cbaff849eb15262266ea79b60d2.tar.xz
Fixes the long-standing RegionUp bug! Plus lots of other cleanups related to neighbours.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs28
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs17
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs8
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs29
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs21
10 files changed, 48 insertions, 70 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 6d16c52..a7b4c66 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -352,7 +352,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
352 // Save avatar attachment information 352 // Save avatar attachment information
353 if (m_scene.AvatarFactory != null) 353 if (m_scene.AvatarFactory != null)
354 { 354 {
355 m_log.Debug("[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", ItemID: " + itemID); 355 m_log.Debug("[ATTACHMENTS MODULE]: Dettaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
356 m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); 356 m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
357 } 357 }
358 } 358 }
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 22c8937..7e5a8ec 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -198,7 +198,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
198 198
199 public void UpdateDatabase(UUID user, AvatarAppearance appearance) 199 public void UpdateDatabase(UUID user, AvatarAppearance appearance)
200 { 200 {
201 //m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); 201 m_log.DebugFormat("[APPEARANCE]: UpdateDatabase");
202 AvatarData adata = new AvatarData(appearance); 202 AvatarData adata = new AvatarData(appearance);
203 m_scene.AvatarService.SetAvatar(user, adata); 203 m_scene.AvatarService.SetAvatar(user, adata);
204 } 204 }
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 5d50a83..ab1cfc3 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -922,12 +922,40 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
922 /// </summary> 922 /// </summary>
923 public void EnableChildAgent(ScenePresence sp, GridRegion region) 923 public void EnableChildAgent(ScenePresence sp, GridRegion region)
924 { 924 {
925 m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighour {0}", region.RegionName);
926
927 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
925 AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); 928 AgentCircuitData agent = sp.ControllingClient.RequestClientInfo();
926 agent.BaseFolder = UUID.Zero; 929 agent.BaseFolder = UUID.Zero;
927 agent.InventoryFolder = UUID.Zero; 930 agent.InventoryFolder = UUID.Zero;
928 agent.startpos = new Vector3(128, 128, 70); 931 agent.startpos = new Vector3(128, 128, 70);
929 agent.child = true; 932 agent.child = true;
930 agent.Appearance = sp.Appearance; 933 agent.Appearance = sp.Appearance;
934 agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
935
936 agent.ChildrenCapSeeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
937 m_log.DebugFormat("[XXX] Seeds 1 {0}", agent.ChildrenCapSeeds.Count);
938
939 if (!agent.ChildrenCapSeeds.ContainsKey(sp.Scene.RegionInfo.RegionHandle))
940 agent.ChildrenCapSeeds.Add(sp.Scene.RegionInfo.RegionHandle, sp.ControllingClient.RequestClientInfo().CapsPath);
941 m_log.DebugFormat("[XXX] Seeds 2 {0}", agent.ChildrenCapSeeds.Count);
942
943 sp.AddNeighbourRegion(region.RegionHandle, agent.CapsPath);
944 foreach (ulong h in agent.ChildrenCapSeeds.Keys)
945 m_log.DebugFormat("[XXX] --> {0}", h);
946 m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle);
947 agent.ChildrenCapSeeds.Add(region.RegionHandle, agent.CapsPath);
948
949 if (sp.Scene.CapsModule != null)
950 {
951 sp.Scene.CapsModule.SetChildrenSeed(sp.UUID, agent.ChildrenCapSeeds);
952 }
953
954 if (currentAgentCircuit != null)
955 {
956 agent.ServiceURLs = currentAgentCircuit.ServiceURLs;
957 agent.Viewer = currentAgentCircuit.Viewer;
958 }
931 959
932 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; 960 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
933 d.BeginInvoke(sp, agent, region, region.ExternalEndPoint, true, 961 d.BeginInvoke(sp, agent, region, region.ExternalEndPoint, true,
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
index 8a90370..35518d5 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
@@ -123,17 +123,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour
123 123
124 public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) 124 public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
125 { 125 {
126 m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}",
127 thisRegion.RegionName, regionHandle, m_Scenes.Count);
128 foreach (Scene s in m_Scenes) 126 foreach (Scene s in m_Scenes)
129 { 127 {
130 if (s.RegionInfo.RegionHandle == regionHandle) 128 if (s.RegionInfo.RegionHandle == regionHandle)
131 { 129 {
132 m_log.Debug("[NEIGHBOUR IN CONNECTOR]: Found region to SendHelloNeighbour"); 130 //m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0} to {1}", thisRegion.RegionName, s.RegionInfo.RegionName);
133 return s.IncomingHelloNeighbour(thisRegion); 131 return s.IncomingHelloNeighbour(thisRegion);
134 } 132 }
135 } 133 }
136 m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: region handle {0} not found", regionHandle);
137 return null; 134 return null;
138 } 135 }
139 136
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
index 1b00c8a..b2e3f4f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
@@ -181,22 +181,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
181 181
182 public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) 182 public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
183 { 183 {
184 if (m_LocalCache.ContainsKey(regionID)) 184 return m_GridService.GetNeighbours(scopeID, regionID);
185 {
186 List<GridRegion> neighbours = m_LocalCache[regionID].GetNeighbours();
187 if (neighbours.Count == 0)
188 // try the DB
189 neighbours = m_GridService.GetNeighbours(scopeID, regionID);
190 return neighbours;
191 }
192 else
193 {
194 m_log.WarnFormat("[LOCAL GRID CONNECTOR]: GetNeighbours: Requested region {0} is not on this sim", regionID);
195 return new List<GridRegion>();
196 }
197
198 // Don't go to the DB
199 //return m_GridService.GetNeighbours(scopeID, regionID);
200 } 185 }
201 186
202 public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) 187 public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
index 46741a5..16e25e6 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
@@ -153,12 +153,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
153 return false; 153 return false;
154 } 154 }
155 155
156 // Let's override GetNeighbours completely -- never go to the grid server
157 // Neighbours are/should be cached locally
158 // For retrieval from the DB, caller should call GetRegionByPosition
159 public override List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) 156 public override List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
160 { 157 {
161 return m_LocalGridService.GetNeighbours(scopeID, regionID); 158 return base.GetNeighbours(scopeID, regionID);
162 } 159 }
163 160
164 public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) 161 public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
index daba0b3..f71bf46 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
@@ -121,17 +121,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour
121 121
122 public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) 122 public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
123 { 123 {
124 m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}", 124 m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}.",
125 thisRegion.RegionName, regionHandle, m_Scenes.Count); 125 thisRegion.RegionName, regionHandle);
126 foreach (Scene s in m_Scenes) 126 foreach (Scene s in m_Scenes)
127 { 127 {
128 if (s.RegionInfo.RegionHandle == regionHandle) 128 if (s.RegionInfo.RegionHandle == regionHandle)
129 { 129 {
130 m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour"); 130 //m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour");
131 return s.IncomingHelloNeighbour(thisRegion); 131 return s.IncomingHelloNeighbour(thisRegion);
132 } 132 }
133 } 133 }
134 m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle); 134 //m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle);
135 return null; 135 return null;
136 } 136 }
137 137
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index 9e8454f..3f577f2 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
@@ -181,7 +181,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
181 // else do the remote thing 181 // else do the remote thing
182 if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) 182 if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
183 { 183 {
184 //m_regionClient.SendUserInformation(regInfo, aCircuit);
185 return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason); 184 return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason);
186 } 185 }
187 return false; 186 return false;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 55060c3..2ff611e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -948,12 +948,6 @@ namespace OpenSim.Region.Framework.Scenes
948 // Let the grid service module know, so this can be cached 948 // Let the grid service module know, so this can be cached
949 m_eventManager.TriggerOnRegionUp(otherRegion); 949 m_eventManager.TriggerOnRegionUp(otherRegion);
950 950
951 RegionInfo regInfo = new RegionInfo(xcell, ycell, otherRegion.InternalEndPoint, otherRegion.ExternalHostName);
952 regInfo.RegionID = otherRegion.RegionID;
953 regInfo.RegionName = otherRegion.RegionName;
954 regInfo.ScopeID = otherRegion.ScopeID;
955 regInfo.ExternalHostName = otherRegion.ExternalHostName;
956 GridRegion r = new GridRegion(regInfo);
957 try 951 try
958 { 952 {
959 ForEachScenePresence(delegate(ScenePresence agent) 953 ForEachScenePresence(delegate(ScenePresence agent)
@@ -968,7 +962,7 @@ namespace OpenSim.Region.Framework.Scenes
968 old.Add(otherRegion.RegionHandle); 962 old.Add(otherRegion.RegionHandle);
969 agent.DropOldNeighbours(old); 963 agent.DropOldNeighbours(old);
970 if (m_teleportModule != null) 964 if (m_teleportModule != null)
971 m_teleportModule.EnableChildAgent(agent, r); 965 m_teleportModule.EnableChildAgent(agent, otherRegion);
972 } 966 }
973 } 967 }
974 ); 968 );
@@ -1518,6 +1512,7 @@ namespace OpenSim.Region.Framework.Scenes
1518 { 1512 {
1519 m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); 1513 m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName);
1520 LoginsDisabled = false; 1514 LoginsDisabled = false;
1515 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
1521 } 1516 }
1522 } 1517 }
1523 } 1518 }
@@ -1802,6 +1797,8 @@ namespace OpenSim.Region.Framework.Scenes
1802 { 1797 {
1803 RegisterCommsEvents(); 1798 RegisterCommsEvents();
1804 1799
1800 m_sceneGridService.SetScene(this);
1801
1805 // These two 'commands' *must be* next to each other or sim rebooting fails. 1802 // These two 'commands' *must be* next to each other or sim rebooting fails.
1806 //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); 1803 //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo);
1807 1804
@@ -1812,24 +1809,6 @@ namespace OpenSim.Region.Framework.Scenes
1812 throw new Exception(error); 1809 throw new Exception(error);
1813 } 1810 }
1814 1811
1815 m_sceneGridService.SetScene(this);
1816 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
1817
1818 //Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings();
1819
1820 //if (dGridSettings.ContainsKey("allow_forceful_banlines"))
1821 //{
1822 // if (dGridSettings["allow_forceful_banlines"] != "TRUE")
1823 // {
1824 // m_log.Info("[GRID]: Grid is disabling forceful parcel banlists");
1825 // EventManager.TriggerSetAllowForcefulBan(false);
1826 // }
1827 // else
1828 // {
1829 // m_log.Info("[GRID]: Grid is allowing forceful parcel banlists");
1830 // EventManager.TriggerSetAllowForcefulBan(true);
1831 // }
1832 //}
1833 } 1812 }
1834 1813
1835 /// <summary> 1814 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index bd8ccce..c675322 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -182,24 +182,17 @@ namespace OpenSim.Region.Framework.Scenes
182 { 182 {
183 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); 183 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
184 184
185 for (int x = (int)region.RegionLocX - 1; x <= region.RegionLocX + 1; x++) 185 List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID);
186 m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count);
187 foreach (GridRegion n in neighbours)
186 { 188 {
187 for (int y = (int)region.RegionLocY - 1; y <= region.RegionLocY + 1; y++) 189 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
188 { 190 d.BeginInvoke(neighbourService, region, n.RegionHandle,
189 if (!((x == region.RegionLocX) && (y == region.RegionLocY))) // skip this region 191 InformNeighborsThatRegionisUpCompleted,
190 { 192 d);
191 ulong handle = Utils.UIntsToLong((uint)x * Constants.RegionSize, (uint)y * Constants.RegionSize);
192 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
193
194 d.BeginInvoke(neighbourService, region, handle,
195 InformNeighborsThatRegionisUpCompleted,
196 d);
197 }
198 }
199 } 193 }
200 } 194 }
201 195
202
203 public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle); 196 public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle);
204 197
205 /// <summary> 198 /// <summary>