aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs34
1 files changed, 20 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index f49d072..f612d17 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -57,7 +57,6 @@ namespace OpenSim.Region.Framework.Scenes
57 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 57 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
58 58
59 protected CommunicationsManager m_commsProvider; 59 protected CommunicationsManager m_commsProvider;
60 protected IInterregionCommsOut m_interregionCommsOut;
61 protected RegionInfo m_regionInfo; 60 protected RegionInfo m_regionInfo;
62 protected Scene m_scene; 61 protected Scene m_scene;
63 62
@@ -135,7 +134,6 @@ namespace OpenSim.Region.Framework.Scenes
135 { 134 {
136 m_scene = s; 135 m_scene = s;
137 m_regionInfo = s.RegionInfo; 136 m_regionInfo = s.RegionInfo;
138 m_interregionCommsOut = m_scene.RequestModuleInterface<IInterregionCommsOut>();
139 } 137 }
140 138
141 /// <summary> 139 /// <summary>
@@ -255,6 +253,7 @@ namespace OpenSim.Region.Framework.Scenes
255 { 253 {
256 InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate) iar.AsyncState; 254 InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate) iar.AsyncState;
257 icon.EndInvoke(iar); 255 icon.EndInvoke(iar);
256 m_log.WarnFormat(" --> InformClientOfNeighbourCompleted");
258 } 257 }
259 258
260 /// <summary> 259 /// <summary>
@@ -285,8 +284,8 @@ namespace OpenSim.Region.Framework.Scenes
285 284
286 string reason = String.Empty; 285 string reason = String.Empty;
287 286
288 287
289 bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, 0, out reason); 288 bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, 0, out reason); // m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, 0, out reason);
290 289
291 if (regionAccepted && newAgent) 290 if (regionAccepted && newAgent)
292 { 291 {
@@ -460,6 +459,7 @@ namespace OpenSim.Region.Framework.Scenes
460 int count = 0; 459 int count = 0;
461 foreach (GridRegion neighbour in neighbours) 460 foreach (GridRegion neighbour in neighbours)
462 { 461 {
462 m_log.WarnFormat("--> Going to send child agent to {0}", neighbour.RegionName);
463 // Don't do it if there's already an agent in that region 463 // Don't do it if there's already an agent in that region
464 if (newRegions.Contains(neighbour.RegionHandle)) 464 if (newRegions.Contains(neighbour.RegionHandle))
465 newAgent = true; 465 newAgent = true;
@@ -600,7 +600,10 @@ namespace OpenSim.Region.Framework.Scenes
600 try 600 try
601 { 601 {
602 //m_commsProvider.InterRegion.ChildAgentUpdate(regionHandle, cAgentData); 602 //m_commsProvider.InterRegion.ChildAgentUpdate(regionHandle, cAgentData);
603 m_interregionCommsOut.SendChildAgentUpdate(regionHandle, cAgentData); 603 uint x = 0, y = 0;
604 Utils.LongToUInts(regionHandle, out x, out y);
605 GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
606 m_scene.SimulationService.UpdateAgent(destination, cAgentData);
604 } 607 }
605 catch 608 catch
606 { 609 {
@@ -660,7 +663,10 @@ namespace OpenSim.Region.Framework.Scenes
660 // let's do our best, but there's not much we can do if the neighbour doesn't accept. 663 // let's do our best, but there's not much we can do if the neighbour doesn't accept.
661 664
662 //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); 665 //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID);
663 m_interregionCommsOut.SendCloseAgent(regionHandle, agentID); 666 uint x = 0, y = 0;
667 Utils.LongToUInts(regionHandle, out x, out y);
668 GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
669 m_scene.SimulationService.CloseAgent(destination, agentID);
664 } 670 }
665 671
666 private void SendCloseChildAgentCompleted(IAsyncResult iar) 672 private void SendCloseChildAgentCompleted(IAsyncResult iar)
@@ -810,7 +816,7 @@ namespace OpenSim.Region.Framework.Scenes
810 816
811 // Let's create an agent there if one doesn't exist yet. 817 // Let's create an agent there if one doesn't exist yet.
812 //if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit)) 818 //if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit))
813 if (!m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, agentCircuit, teleportFlags, out reason)) 819 if (!m_scene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason))
814 { 820 {
815 avatar.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}", 821 avatar.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}",
816 reason)); 822 reason));
@@ -896,9 +902,9 @@ namespace OpenSim.Region.Framework.Scenes
896 avatar.CopyTo(agent); 902 avatar.CopyTo(agent);
897 agent.Position = position; 903 agent.Position = position;
898 agent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort + 904 agent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort +
899 "/agent/" + avatar.UUID.ToString() + "/" + avatar.Scene.RegionInfo.RegionHandle.ToString() + "/release/"; 905 "/agent/" + avatar.UUID.ToString() + "/" + avatar.Scene.RegionInfo.RegionID.ToString() + "/release/";
900 906
901 m_interregionCommsOut.SendChildAgentUpdate(reg.RegionHandle, agent); 907 m_scene.SimulationService.UpdateAgent(reg, agent);
902 908
903 m_log.DebugFormat( 909 m_log.DebugFormat(
904 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, avatar.UUID); 910 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, avatar.UUID);
@@ -929,7 +935,7 @@ namespace OpenSim.Region.Framework.Scenes
929 avatar.Scene.InformClientOfNeighbours(avatar); 935 avatar.Scene.InformClientOfNeighbours(avatar);
930 936
931 // Finally, kill the agent we just created at the destination. 937 // Finally, kill the agent we just created at the destination.
932 m_interregionCommsOut.SendCloseAgent(reg.RegionHandle, avatar.UUID); 938 m_scene.SimulationService.CloseAgent(reg, avatar.UUID);
933 939
934 return; 940 return;
935 } 941 }
@@ -943,7 +949,7 @@ namespace OpenSim.Region.Framework.Scenes
943 avatar.MakeChildAgent(); 949 avatar.MakeChildAgent();
944 950
945 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it 951 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
946 avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle, true); 952 avatar.CrossAttachmentsIntoNewRegion(reg, true);
947 953
948 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 954 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
949 955
@@ -1338,9 +1344,9 @@ namespace OpenSim.Region.Framework.Scenes
1338 if (isFlying) 1344 if (isFlying)
1339 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; 1345 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
1340 cAgent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort + 1346 cAgent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort +
1341 "/agent/" + agent.UUID.ToString() + "/" + agent.Scene.RegionInfo.RegionHandle.ToString() + "/release/"; 1347 "/agent/" + agent.UUID.ToString() + "/" + agent.Scene.RegionInfo.RegionID.ToString() + "/release/";
1342 1348
1343 m_interregionCommsOut.SendChildAgentUpdate(neighbourHandle, cAgent); 1349 m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent);
1344 1350
1345 // Next, let's close the child agent connections that are too far away. 1351 // Next, let's close the child agent connections that are too far away.
1346 agent.CloseChildAgents(neighbourx, neighboury); 1352 agent.CloseChildAgents(neighbourx, neighboury);
@@ -1391,7 +1397,7 @@ namespace OpenSim.Region.Framework.Scenes
1391 // now we have a child agent in this region. Request all interesting data about other (root) agents 1397 // now we have a child agent in this region. Request all interesting data about other (root) agents
1392 agent.SendInitialFullUpdateToAllClients(); 1398 agent.SendInitialFullUpdateToAllClients();
1393 1399
1394 agent.CrossAttachmentsIntoNewRegion(neighbourHandle, true); 1400 agent.CrossAttachmentsIntoNewRegion(neighbourRegion, true);
1395 1401
1396 // m_scene.SendKillObject(m_localId); 1402 // m_scene.SendKillObject(m_localId);
1397 1403