aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-29 13:49:20 +0000
committerMelanie Thielker2008-11-29 13:49:20 +0000
commitb8e8a33d60b98894671a34a19e8d982463fa4785 (patch)
treeb6bb8e0a719b24664d391dd76c3add2c5d2f6666 /OpenSim/Region/Environment
parentFinally make attachments stay put. Randomize local ID generation to (diff)
downloadopensim-SC-b8e8a33d60b98894671a34a19e8d982463fa4785.zip
opensim-SC-b8e8a33d60b98894671a34a19e8d982463fa4785.tar.gz
opensim-SC-b8e8a33d60b98894671a34a19e8d982463fa4785.tar.bz2
opensim-SC-b8e8a33d60b98894671a34a19e8d982463fa4785.tar.xz
Mantis #2584
Applying a patch from Diva. This patch introduces significant improvements in teleporting. Thank you, Diva.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs15
-rw-r--r--OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs19
3 files changed, 51 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs
index 21be82a..4833f27 100644
--- a/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs
+++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs
@@ -78,6 +78,21 @@ namespace OpenSim.Region.Environment
78 return buildEvent("EnableSimulator", llsdBody); 78 return buildEvent("EnableSimulator", llsdBody);
79 } 79 }
80 80
81 public static OSD DisableSimulator(ulong Handle)
82 {
83 OSDMap llsdSimInfo = new OSDMap(1);
84
85 llsdSimInfo.Add("Handle", new OSDBinary(regionHandleToByteArray(Handle)));
86
87 OSDArray arr = new OSDArray(1);
88 arr.Add(llsdSimInfo);
89
90 OSDMap llsdBody = new OSDMap(1);
91 llsdBody.Add("SimulatorInfo", arr);
92
93 return buildEvent("DisableSimulator", llsdBody);
94 }
95
81 public static OSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt, 96 public static OSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt,
82 IPEndPoint newRegionExternalEndPoint, 97 IPEndPoint newRegionExternalEndPoint,
83 string capsURL, UUID AgentID, UUID SessionID) 98 string capsURL, UUID AgentID, UUID SessionID)
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs
index 9dd2426..5d34773 100644
--- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs
@@ -149,6 +149,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
149 149
150 if (destRegionUp) 150 if (destRegionUp)
151 { 151 {
152
152 // Fixing a bug where teleporting while sitting results in the avatar ending up removed from 153 // Fixing a bug where teleporting while sitting results in the avatar ending up removed from
153 // both regions 154 // both regions
154 if (avatar.ParentID != (uint)0) 155 if (avatar.ParentID != (uint)0)
@@ -169,6 +170,17 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
169 agent.child = false; 170 agent.child = false;
170 m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent); 171 m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent);
171 172
173 if (eq != null)
174 {
175 OSD Item = EventQueueHelper.EnableSimulator(realHandle, reg.ExternalEndPoint);
176 eq.Enqueue(Item, avatar.UUID);
177 }
178 else
179 {
180 avatar.ControllingClient.InformClientOfNeighbour(realHandle, reg.ExternalEndPoint);
181 // TODO: make Event Queue disablable!
182 }
183
172 m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId, 184 m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId,
173 position, false); 185 position, false);
174 Thread.Sleep(2000); 186 Thread.Sleep(2000);
@@ -223,6 +235,12 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
223 { 235 {
224 //SendCloseChildAgentConnections(avatar.UUID, avatar.GetKnownRegionList()); 236 //SendCloseChildAgentConnections(avatar.UUID, avatar.GetKnownRegionList());
225 SendCloseChildAgentConnections(avatar.UUID, childRegions); 237 SendCloseChildAgentConnections(avatar.UUID, childRegions);
238 if (eq != null)
239 {
240 OSD Item = EventQueueHelper.DisableSimulator(m_regionInfo.RegionHandle);
241 eq.Enqueue(Item, avatar.UUID);
242 }
243 Thread.Sleep(2000);
226 CloseConnection(avatar.UUID); 244 CloseConnection(avatar.UUID);
227 } 245 }
228 // if (teleport success) // seems to be always success here 246 // if (teleport success) // seems to be always success here
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 64da9d4..54d4298 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -662,6 +662,7 @@ namespace OpenSim.Region.Environment.Scenes
662 662
663 if (destRegionUp) 663 if (destRegionUp)
664 { 664 {
665
665 // Fixing a bug where teleporting while sitting results in the avatar ending up removed from 666 // Fixing a bug where teleporting while sitting results in the avatar ending up removed from
666 // both regions 667 // both regions
667 if (avatar.ParentID != (uint)0) 668 if (avatar.ParentID != (uint)0)
@@ -681,6 +682,16 @@ namespace OpenSim.Region.Environment.Scenes
681 avatar.Scene.RemoveCapsHandler(avatar.UUID); 682 avatar.Scene.RemoveCapsHandler(avatar.UUID);
682 agent.child = false; 683 agent.child = false;
683 m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent); 684 m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent);
685
686 if (eq != null)
687 {
688 OSD Item = EventQueueHelper.EnableSimulator(reg.RegionHandle, reg.ExternalEndPoint);
689 eq.Enqueue(Item, avatar.UUID);
690 }
691 else
692 {
693 avatar.ControllingClient.InformClientOfNeighbour(reg.RegionHandle, reg.ExternalEndPoint);
694 }
684 695
685 m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId, 696 m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId,
686 position, false); 697 position, false);
@@ -724,8 +735,14 @@ namespace OpenSim.Region.Environment.Scenes
724 uint oldRegionY = (((uint)(m_regionInfo.RegionHandle)) >> 8); 735 uint oldRegionY = (((uint)(m_regionInfo.RegionHandle)) >> 8);
725 if (Util.fast_distance2d((int)(newRegionX - oldRegionX), (int)(newRegionY - oldRegionY)) > 3) 736 if (Util.fast_distance2d((int)(newRegionX - oldRegionX), (int)(newRegionY - oldRegionY)) > 3)
726 { 737 {
727 SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList()); 738 //SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList());
728 SendCloseChildAgentConnections(avatar.UUID, childRegions); 739 SendCloseChildAgentConnections(avatar.UUID, childRegions);
740 if (eq != null)
741 {
742 OSD Item = EventQueueHelper.DisableSimulator(m_regionInfo.RegionHandle);
743 eq.Enqueue(Item, avatar.UUID);
744 }
745 Thread.Sleep(2000);
729 CloseConnection(avatar.UUID); 746 CloseConnection(avatar.UUID);
730 } 747 }
731 // if (teleport success) // seems to be always success here 748 // if (teleport success) // seems to be always success here