try to improve vehicles crossing with Xengine. Lag seems main issue now, but needs testing, specially the fail cases, that most likelly need more work
parent
6b54c741ca
commit
5becc16acf
|
@ -2607,7 +2607,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
return neighbourRegion;
|
return neighbourRegion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* not in use. -> CrossPrimGroupIntoNewRegion
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Move the given scene object into a new region depending on which region its absolute position has moved
|
/// Move the given scene object into a new region depending on which region its absolute position has moved
|
||||||
/// into.
|
/// into.
|
||||||
|
@ -2672,7 +2672,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
grp.ScheduleGroupForFullUpdate();
|
grp.ScheduleGroupForFullUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Move the given scene object into a new region
|
/// Move the given scene object into a new region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2682,7 +2682,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
/// true if the crossing itself was successful, false on failure
|
/// true if the crossing itself was successful, false on failure
|
||||||
/// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region
|
/// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent)
|
public bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent, bool removeScripts)
|
||||||
{
|
{
|
||||||
//m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<");
|
//m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<");
|
||||||
|
|
||||||
|
@ -2714,7 +2714,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// We remove the object here
|
// We remove the object here
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
grp.Scene.DeleteSceneObject(grp, silent);
|
grp.Scene.DeleteSceneObject(grp, silent, removeScripts);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -2764,7 +2764,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
"[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}",
|
"[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}",
|
||||||
clone.UUID, destination.RegionName);
|
clone.UUID, destination.RegionName);
|
||||||
|
|
||||||
CrossPrimGroupIntoNewRegion(destination, Vector3.Zero, clone, silent);
|
CrossPrimGroupIntoNewRegion(destination, Vector3.Zero, clone, silent,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,8 +96,8 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out string version, out Vector3 newpos);
|
GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out string version, out Vector3 newpos);
|
||||||
GridRegion GetObjectDestination(SceneObjectGroup grp, Vector3 targetPosition, out Vector3 newpos);
|
GridRegion GetObjectDestination(SceneObjectGroup grp, Vector3 targetPosition, out Vector3 newpos);
|
||||||
bool checkAgentAccessToRegion(ScenePresence agent, GridRegion destiny, Vector3 position, out string version, out string reason);
|
bool checkAgentAccessToRegion(ScenePresence agent, GridRegion destiny, Vector3 position, out string version, out string reason);
|
||||||
void Cross(SceneObjectGroup sog, Vector3 position, bool silent);
|
// void Cross(SceneObjectGroup sog, Vector3 position, bool silent);
|
||||||
bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent);
|
bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent, bool removeScripts);
|
||||||
|
|
||||||
ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version);
|
ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version);
|
||||||
|
|
||||||
|
|
|
@ -2709,6 +2709,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_sceneGraph.updateScenePartGroup(part, grp);
|
m_sceneGraph.updateScenePartGroup(part, grp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* not in use, outdate by async method
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Move the given scene object into a new region depending on which region its absolute position has moved
|
/// Move the given scene object into a new region depending on which region its absolute position has moved
|
||||||
/// into.
|
/// into.
|
||||||
|
@ -2757,6 +2759,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (EntityTransferModule != null)
|
if (EntityTransferModule != null)
|
||||||
EntityTransferModule.Cross(grp, attemptedPosition, silent);
|
EntityTransferModule.Cross(grp, attemptedPosition, silent);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Simple test to see if a position is in the current region.
|
// Simple test to see if a position is in the current region.
|
||||||
// This test is mostly used to see if a region crossing is necessary.
|
// This test is mostly used to see if a region crossing is necessary.
|
||||||
|
|
|
@ -672,7 +672,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
if (sog.m_linkedAvatars.Count == 0)
|
if (sog.m_linkedAvatars.Count == 0)
|
||||||
{
|
{
|
||||||
entityTransfer.CrossPrimGroupIntoNewRegion(destination, newpos, sog, true);
|
entityTransfer.CrossPrimGroupIntoNewRegion(destination, newpos, sog, true, true);
|
||||||
return sog;
|
return sog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,7 +716,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
av.ParentID = 0;
|
av.ParentID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entityTransfer.CrossPrimGroupIntoNewRegion(destination, newpos, sog, true))
|
if (entityTransfer.CrossPrimGroupIntoNewRegion(destination, newpos, sog, true, false))
|
||||||
{
|
{
|
||||||
foreach (avtocrossInfo avinfo in avsToCross)
|
foreach (avtocrossInfo avinfo in avsToCross)
|
||||||
{
|
{
|
||||||
|
@ -730,14 +730,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
|
// CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
|
||||||
// d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
|
// d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
|
||||||
entityTransfer.CrossAgentToNewRegionAsync(av, newpos, destination, av.Flying, version);
|
entityTransfer.CrossAgentToNewRegionAsync(av, newpos, destination, av.Flying, version);
|
||||||
if(av.IsChildAgent)
|
if (av.IsChildAgent)
|
||||||
{
|
{
|
||||||
|
// avatar crossed do some extra cleanup
|
||||||
if (av.ParentUUID != UUID.Zero)
|
if (av.ParentUUID != UUID.Zero)
|
||||||
{
|
{
|
||||||
av.ClearControls();
|
av.ClearControls();
|
||||||
av.ParentPart = null;
|
av.ParentPart = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// avatar cross failed we need do dedicated standUp
|
||||||
|
// part of it was done at CrossAgentToNewRegionAsync
|
||||||
|
// so for now just remove the sog controls
|
||||||
|
// this may need extra care
|
||||||
|
av.UnRegisterSeatControls(sog.UUID);
|
||||||
|
}
|
||||||
|
|
||||||
av.ParentUUID = UUID.Zero;
|
av.ParentUUID = UUID.Zero;
|
||||||
// In any case
|
// In any case
|
||||||
av.IsInTransit = false;
|
av.IsInTransit = false;
|
||||||
|
@ -748,6 +758,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar already in transit {0} to {1}", av.Name, val);
|
m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar already in transit {0} to {1}", av.Name, val);
|
||||||
}
|
}
|
||||||
avsToCross.Clear();
|
avsToCross.Clear();
|
||||||
|
sog.RemoveScriptInstances(true);
|
||||||
return sog;
|
return sog;
|
||||||
}
|
}
|
||||||
else // cross failed, put avas back ??
|
else // cross failed, put avas back ??
|
||||||
|
@ -805,6 +816,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* outdated
|
||||||
private void CrossAgentToNewRegionCompleted(ScenePresence agent)
|
private void CrossAgentToNewRegionCompleted(ScenePresence agent)
|
||||||
{
|
{
|
||||||
//// If the cross was successful, this agent is a child agent
|
//// If the cross was successful, this agent is a child agent
|
||||||
|
@ -829,7 +841,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
m_log.DebugFormat("[SCENE OBJECT]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
|
m_log.DebugFormat("[SCENE OBJECT]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
public override Vector3 Velocity
|
public override Vector3 Velocity
|
||||||
{
|
{
|
||||||
get { return RootPart.Velocity; }
|
get { return RootPart.Velocity; }
|
||||||
|
|
|
@ -5264,7 +5264,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UnRegisterSeatControls(UUID obj)
|
public void UnRegisterSeatControls(UUID obj)
|
||||||
{
|
{
|
||||||
List<UUID> takers = new List<UUID>();
|
List<UUID> takers = new List<UUID>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue