diff options
author | UbitUmarov | 2016-07-26 21:39:47 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-26 21:39:47 +0100 |
commit | 52decfcc16bab0332798745d59c43277f1c034b6 (patch) | |
tree | a07e3791dbf9309e010e59de725b4242d2de1079 /OpenSim/Region/CoreModules | |
parent | add a public SetGroupPowers to clientView (diff) | |
download | opensim-SC-52decfcc16bab0332798745d59c43277f1c034b6.zip opensim-SC-52decfcc16bab0332798745d59c43277f1c034b6.tar.gz opensim-SC-52decfcc16bab0332798745d59c43277f1c034b6.tar.bz2 opensim-SC-52decfcc16bab0332798745d59c43277f1c034b6.tar.xz |
reduce some grid services calls on region crossings, sending more information on the agent update ( groups v2 needs change )
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 74 |
1 files changed, 3 insertions, 71 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 696d1dd..a14fb25 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -922,7 +922,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
922 | 922 | ||
923 | // Let's send a full update of the agent. This is a synchronous call. | 923 | // Let's send a full update of the agent. This is a synchronous call. |
924 | AgentData agent = new AgentData(); | 924 | AgentData agent = new AgentData(); |
925 | sp.CopyTo(agent); | 925 | sp.CopyTo(agent,false); |
926 | 926 | ||
927 | if ((teleportFlags & (uint)TeleportFlags.IsFlying) != 0) | 927 | if ((teleportFlags & (uint)TeleportFlags.IsFlying) != 0) |
928 | agent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 928 | agent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
@@ -1142,7 +1142,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1142 | 1142 | ||
1143 | // Let's send a full update of the agent. | 1143 | // Let's send a full update of the agent. |
1144 | AgentData agent = new AgentData(); | 1144 | AgentData agent = new AgentData(); |
1145 | sp.CopyTo(agent); | 1145 | sp.CopyTo(agent,false); |
1146 | agent.Position = agentCircuit.startpos; | 1146 | agent.Position = agentCircuit.startpos; |
1147 | 1147 | ||
1148 | if ((teleportFlags & (uint)TeleportFlags.IsFlying) != 0) | 1148 | if ((teleportFlags & (uint)TeleportFlags.IsFlying) != 0) |
@@ -1701,7 +1701,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1701 | try | 1701 | try |
1702 | { | 1702 | { |
1703 | AgentData cAgent = new AgentData(); | 1703 | AgentData cAgent = new AgentData(); |
1704 | agent.CopyTo(cAgent); | 1704 | agent.CopyTo(cAgent,true); |
1705 | 1705 | ||
1706 | // agent.Appearance.WearableCacheItems = null; | 1706 | // agent.Appearance.WearableCacheItems = null; |
1707 | 1707 | ||
@@ -2534,11 +2534,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2534 | if (newRegionSizeY == 0) | 2534 | if (newRegionSizeY == 0) |
2535 | newRegionSizeY = Constants.RegionSize; | 2535 | newRegionSizeY = Constants.RegionSize; |
2536 | 2536 | ||
2537 | |||
2538 | newpos.X = targetPosition.X - (neighbourRegion.RegionLocX - (int)scene.RegionInfo.WorldLocX); | 2537 | newpos.X = targetPosition.X - (neighbourRegion.RegionLocX - (int)scene.RegionInfo.WorldLocX); |
2539 | newpos.Y = targetPosition.Y - (neighbourRegion.RegionLocY - (int)scene.RegionInfo.WorldLocY); | 2538 | newpos.Y = targetPosition.Y - (neighbourRegion.RegionLocY - (int)scene.RegionInfo.WorldLocY); |
2540 | 2539 | ||
2541 | |||
2542 | const float enterDistance = 0.2f; | 2540 | const float enterDistance = 0.2f; |
2543 | newpos.X = Util.Clamp(newpos.X, enterDistance, newRegionSizeX - enterDistance); | 2541 | newpos.X = Util.Clamp(newpos.X, enterDistance, newRegionSizeX - enterDistance); |
2544 | newpos.Y = Util.Clamp(newpos.Y, enterDistance, newRegionSizeY - enterDistance); | 2542 | newpos.Y = Util.Clamp(newpos.Y, enterDistance, newRegionSizeY - enterDistance); |
@@ -2546,72 +2544,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2546 | return neighbourRegion; | 2544 | return neighbourRegion; |
2547 | } | 2545 | } |
2548 | 2546 | ||
2549 | /* not in use. -> CrossPrimGroupIntoNewRegion | ||
2550 | /// <summary> | ||
2551 | /// Move the given scene object into a new region depending on which region its absolute position has moved | ||
2552 | /// into. | ||
2553 | /// | ||
2554 | /// Using the objects new world location, ask the grid service for a the new region and adjust the prim | ||
2555 | /// position to be relative to the new region. | ||
2556 | /// </summary> | ||
2557 | /// <param name="grp">the scene object that we're crossing</param> | ||
2558 | /// <param name="attemptedPosition">the attempted out of region position of the scene object. This position is | ||
2559 | /// relative to the region the object currently is in.</param> | ||
2560 | /// <param name="silent">if 'true', the deletion of the client from the region is not broadcast to the clients</param> | ||
2561 | public void Cross(SceneObjectGroup grp, Vector3 attemptedPosition, bool silent) | ||
2562 | { | ||
2563 | if (grp == null) | ||
2564 | return; | ||
2565 | if (grp.IsDeleted) | ||
2566 | return; | ||
2567 | |||
2568 | Scene scene = grp.Scene; | ||
2569 | if (scene == null) | ||
2570 | return; | ||
2571 | |||
2572 | // Remember the old group position in case the region lookup fails so position can be restored. | ||
2573 | Vector3 oldGroupPosition = grp.RootPart.GroupPosition; | ||
2574 | |||
2575 | // Compute the absolute position of the object. | ||
2576 | double objectWorldLocX = (double)scene.RegionInfo.WorldLocX + attemptedPosition.X; | ||
2577 | double objectWorldLocY = (double)scene.RegionInfo.WorldLocY + attemptedPosition.Y; | ||
2578 | |||
2579 | // Ask the grid service for the region that contains the passed address | ||
2580 | GridRegion destination = GetRegionContainingWorldLocation(scene.GridService, scene.RegionInfo.ScopeID, | ||
2581 | objectWorldLocX, objectWorldLocY); | ||
2582 | |||
2583 | Vector3 pos = Vector3.Zero; | ||
2584 | if (destination != null) | ||
2585 | { | ||
2586 | // Adjust the object's relative position from the old region (attemptedPosition) | ||
2587 | // to be relative to the new region (pos). | ||
2588 | pos = new Vector3( (float)(objectWorldLocX - (double)destination.RegionLocX), | ||
2589 | (float)(objectWorldLocY - (double)destination.RegionLocY), | ||
2590 | attemptedPosition.Z); | ||
2591 | } | ||
2592 | |||
2593 | if (destination == null || !CrossPrimGroupIntoNewRegion(destination, pos, grp, silent)) | ||
2594 | { | ||
2595 | m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}", grp.UUID); | ||
2596 | |||
2597 | // We are going to move the object back to the old position so long as the old position | ||
2598 | // is in the region | ||
2599 | oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X, 1.0f, (float)(scene.RegionInfo.RegionSizeX - 1)); | ||
2600 | oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y, 1.0f, (float)(scene.RegionInfo.RegionSizeY - 1)); | ||
2601 | oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z, 1.0f, Constants.RegionHeight); | ||
2602 | |||
2603 | grp.AbsolutePosition = oldGroupPosition; | ||
2604 | grp.Velocity = Vector3.Zero; | ||
2605 | if (grp.RootPart.PhysActor != null) | ||
2606 | grp.RootPart.PhysActor.CrossingFailure(); | ||
2607 | |||
2608 | if (grp.RootPart.KeyframeMotion != null) | ||
2609 | grp.RootPart.KeyframeMotion.CrossingFailure(); | ||
2610 | |||
2611 | grp.ScheduleGroupForFullUpdate(); | ||
2612 | } | ||
2613 | } | ||
2614 | */ | ||
2615 | /// <summary> | 2547 | /// <summary> |
2616 | /// Move the given scene object into a new region | 2548 | /// Move the given scene object into a new region |
2617 | /// </summary> | 2549 | /// </summary> |