Applying a patch from Diva. This patch introduces significant improvements
in teleporting. Thank you, Diva.
0.6.1-post-fixes
Melanie Thielker 2008-11-29 13:49:20 +00:00
parent 1b3a3ffc77
commit b8e8a33d60
3 changed files with 51 additions and 1 deletions

View File

@ -78,6 +78,21 @@ namespace OpenSim.Region.Environment
return buildEvent("EnableSimulator", llsdBody); return buildEvent("EnableSimulator", llsdBody);
} }
public static OSD DisableSimulator(ulong Handle)
{
OSDMap llsdSimInfo = new OSDMap(1);
llsdSimInfo.Add("Handle", new OSDBinary(regionHandleToByteArray(Handle)));
OSDArray arr = new OSDArray(1);
arr.Add(llsdSimInfo);
OSDMap llsdBody = new OSDMap(1);
llsdBody.Add("SimulatorInfo", arr);
return buildEvent("DisableSimulator", llsdBody);
}
public static OSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt, public static OSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt,
IPEndPoint newRegionExternalEndPoint, IPEndPoint newRegionExternalEndPoint,
string capsURL, UUID AgentID, UUID SessionID) string capsURL, UUID AgentID, UUID SessionID)

View File

@ -149,6 +149,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
if (destRegionUp) if (destRegionUp)
{ {
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from // Fixing a bug where teleporting while sitting results in the avatar ending up removed from
// both regions // both regions
if (avatar.ParentID != (uint)0) if (avatar.ParentID != (uint)0)
@ -169,6 +170,17 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
agent.child = false; agent.child = false;
m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent); m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent);
if (eq != null)
{
OSD Item = EventQueueHelper.EnableSimulator(realHandle, reg.ExternalEndPoint);
eq.Enqueue(Item, avatar.UUID);
}
else
{
avatar.ControllingClient.InformClientOfNeighbour(realHandle, reg.ExternalEndPoint);
// TODO: make Event Queue disablable!
}
m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId, m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId,
position, false); position, false);
Thread.Sleep(2000); Thread.Sleep(2000);
@ -223,6 +235,12 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
{ {
//SendCloseChildAgentConnections(avatar.UUID, avatar.GetKnownRegionList()); //SendCloseChildAgentConnections(avatar.UUID, avatar.GetKnownRegionList());
SendCloseChildAgentConnections(avatar.UUID, childRegions); SendCloseChildAgentConnections(avatar.UUID, childRegions);
if (eq != null)
{
OSD Item = EventQueueHelper.DisableSimulator(m_regionInfo.RegionHandle);
eq.Enqueue(Item, avatar.UUID);
}
Thread.Sleep(2000);
CloseConnection(avatar.UUID); CloseConnection(avatar.UUID);
} }
// if (teleport success) // seems to be always success here // if (teleport success) // seems to be always success here

View File

@ -662,6 +662,7 @@ namespace OpenSim.Region.Environment.Scenes
if (destRegionUp) if (destRegionUp)
{ {
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from // Fixing a bug where teleporting while sitting results in the avatar ending up removed from
// both regions // both regions
if (avatar.ParentID != (uint)0) if (avatar.ParentID != (uint)0)
@ -681,6 +682,16 @@ namespace OpenSim.Region.Environment.Scenes
avatar.Scene.RemoveCapsHandler(avatar.UUID); avatar.Scene.RemoveCapsHandler(avatar.UUID);
agent.child = false; agent.child = false;
m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent); m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent);
if (eq != null)
{
OSD Item = EventQueueHelper.EnableSimulator(reg.RegionHandle, reg.ExternalEndPoint);
eq.Enqueue(Item, avatar.UUID);
}
else
{
avatar.ControllingClient.InformClientOfNeighbour(reg.RegionHandle, reg.ExternalEndPoint);
}
m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId, m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId,
position, false); position, false);
@ -724,8 +735,14 @@ namespace OpenSim.Region.Environment.Scenes
uint oldRegionY = (((uint)(m_regionInfo.RegionHandle)) >> 8); uint oldRegionY = (((uint)(m_regionInfo.RegionHandle)) >> 8);
if (Util.fast_distance2d((int)(newRegionX - oldRegionX), (int)(newRegionY - oldRegionY)) > 3) if (Util.fast_distance2d((int)(newRegionX - oldRegionX), (int)(newRegionY - oldRegionY)) > 3)
{ {
SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList()); //SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList());
SendCloseChildAgentConnections(avatar.UUID, childRegions); SendCloseChildAgentConnections(avatar.UUID, childRegions);
if (eq != null)
{
OSD Item = EventQueueHelper.DisableSimulator(m_regionInfo.RegionHandle);
eq.Enqueue(Item, avatar.UUID);
}
Thread.Sleep(2000);
CloseConnection(avatar.UUID); CloseConnection(avatar.UUID);
} }
// if (teleport success) // seems to be always success here // if (teleport success) // seems to be always success here