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);
|
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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
@ -682,6 +683,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
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);
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue