diff options
author | UbitUmarov | 2014-10-21 11:57:47 +0100 |
---|---|---|
committer | UbitUmarov | 2014-10-21 11:57:47 +0100 |
commit | 59413adceecd7f6c9132f03b436b7a0b5cabb443 (patch) | |
tree | 5ff0b203e40f2a693ac9e6130a89cff550cd82a9 /OpenSim/Region/CoreModules | |
parent | Assume childreen don't need to know caps seeds (diff) | |
download | opensim-SC_OLD-59413adceecd7f6c9132f03b436b7a0b5cabb443.zip opensim-SC_OLD-59413adceecd7f6c9132f03b436b7a0b5cabb443.tar.gz opensim-SC_OLD-59413adceecd7f6c9132f03b436b7a0b5cabb443.tar.bz2 opensim-SC_OLD-59413adceecd7f6c9132f03b436b7a0b5cabb443.tar.xz |
do agent crossing async, including QUERYACCESS ( need to check vehicles for
this also ), so it doesn't stop heartbeat
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 19f748a..c898946 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1511,6 +1511,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1511 | 1511 | ||
1512 | public bool Cross(ScenePresence agent, bool isFlying) | 1512 | public bool Cross(ScenePresence agent, bool isFlying) |
1513 | { | 1513 | { |
1514 | agent.IsInTransit = true; | ||
1515 | CrossAsyncDelegate d = CrossAsync; | ||
1516 | d.BeginInvoke(agent, isFlying, CrossCompleted, d); | ||
1517 | return true; | ||
1518 | } | ||
1519 | |||
1520 | private void CrossCompleted(IAsyncResult iar) | ||
1521 | { | ||
1522 | CrossAsyncDelegate icon = (CrossAsyncDelegate)iar.AsyncState; | ||
1523 | ScenePresence agent = icon.EndInvoke(iar); | ||
1524 | |||
1525 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); | ||
1526 | |||
1527 | if(!agent.IsChildAgent) | ||
1528 | { | ||
1529 | // crossing failed | ||
1530 | agent.CrossToNewRegionFail(); | ||
1531 | } | ||
1532 | agent.IsInTransit = false; | ||
1533 | } | ||
1534 | |||
1535 | |||
1536 | public ScenePresence CrossAsync(ScenePresence agent, bool isFlying) | ||
1537 | { | ||
1514 | uint x; | 1538 | uint x; |
1515 | uint y; | 1539 | uint y; |
1516 | Vector3 newpos; | 1540 | Vector3 newpos; |
@@ -1525,16 +1549,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1525 | if (reason == String.Empty) | 1549 | if (reason == String.Empty) |
1526 | agent.ControllingClient.SendAlertMessage("Cannot cross to region"); | 1550 | agent.ControllingClient.SendAlertMessage("Cannot cross to region"); |
1527 | else | 1551 | else |
1528 | agent.ControllingClient.SendAlertMessage("Cannot cross to region: " + reason); | 1552 | agent.ControllingClient.SendAlertMessage("Cannot cross to region: " + reason); |
1529 | return false; | 1553 | return agent; |
1530 | } | 1554 | } |
1531 | 1555 | ||
1532 | agent.IsInTransit = true; | 1556 | // agent.IsInTransit = true; |
1533 | |||
1534 | CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync; | ||
1535 | d.BeginInvoke(agent, newpos, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d); | ||
1536 | 1557 | ||
1537 | return true; | 1558 | CrossAgentToNewRegionAsync(agent, newpos, neighbourRegion, isFlying, version); |
1559 | agent.IsInTransit = false; | ||
1560 | return agent; | ||
1538 | } | 1561 | } |
1539 | 1562 | ||
1540 | 1563 | ||
@@ -1787,8 +1810,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1787 | 1810 | ||
1788 | agent.CloseChildAgents(neighbourx, neighboury); | 1811 | agent.CloseChildAgents(neighbourx, neighboury); |
1789 | 1812 | ||
1790 | |||
1791 | |||
1792 | // the user may change their profile information in other region, | 1813 | // the user may change their profile information in other region, |
1793 | // so the userinfo in UserProfileCache is not reliable any more, delete it | 1814 | // so the userinfo in UserProfileCache is not reliable any more, delete it |
1794 | // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! | 1815 | // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! |