Mantis #2584
Applying a patch from Diva. This patch introduces significant improvements in teleporting. Thank you, Diva.0.6.1-post-fixes
parent
1b3a3ffc77
commit
b8e8a33d60
|
@ -78,6 +78,21 @@ namespace OpenSim.Region.Environment
|
|||
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,
|
||||
IPEndPoint newRegionExternalEndPoint,
|
||||
string capsURL, UUID AgentID, UUID SessionID)
|
||||
|
|
|
@ -149,6 +149,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
|
|||
|
||||
if (destRegionUp)
|
||||
{
|
||||
|
||||
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
|
||||
// both regions
|
||||
if (avatar.ParentID != (uint)0)
|
||||
|
@ -169,6 +170,17 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
|
|||
agent.child = false;
|
||||
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,
|
||||
position, false);
|
||||
Thread.Sleep(2000);
|
||||
|
@ -223,6 +235,12 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
|
|||
{
|
||||
//SendCloseChildAgentConnections(avatar.UUID, avatar.GetKnownRegionList());
|
||||
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);
|
||||
}
|
||||
// if (teleport success) // seems to be always success here
|
||||
|
|
|
@ -662,6 +662,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
if (destRegionUp)
|
||||
{
|
||||
|
||||
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
|
||||
// both regions
|
||||
if (avatar.ParentID != (uint)0)
|
||||
|
@ -681,6 +682,16 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
avatar.Scene.RemoveCapsHandler(avatar.UUID);
|
||||
agent.child = false;
|
||||
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,
|
||||
position, false);
|
||||
|
@ -724,8 +735,14 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
uint oldRegionY = (((uint)(m_regionInfo.RegionHandle)) >> 8);
|
||||
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);
|
||||
if (eq != null)
|
||||
{
|
||||
OSD Item = EventQueueHelper.DisableSimulator(m_regionInfo.RegionHandle);
|
||||
eq.Enqueue(Item, avatar.UUID);
|
||||
}
|
||||
Thread.Sleep(2000);
|
||||
CloseConnection(avatar.UUID);
|
||||
}
|
||||
// if (teleport success) // seems to be always success here
|
||||
|
|
Loading…
Reference in New Issue