diff options
author | Teravus Ovares | 2008-01-22 08:52:51 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-01-22 08:52:51 +0000 |
commit | 5cf96daaf29209e065b852a0eefeb7f5dbd88b48 (patch) | |
tree | 34518c3c3609fbe6654a651d6ad357d257f60f26 /OpenSim/Region | |
parent | * Renamed a number of TerrainEngine functions to conform naming standards bet... (diff) | |
download | opensim-SC_OLD-5cf96daaf29209e065b852a0eefeb7f5dbd88b48.zip opensim-SC_OLD-5cf96daaf29209e065b852a0eefeb7f5dbd88b48.tar.gz opensim-SC_OLD-5cf96daaf29209e065b852a0eefeb7f5dbd88b48.tar.bz2 opensim-SC_OLD-5cf96daaf29209e065b852a0eefeb7f5dbd88b48.tar.xz |
* Enabled dead region tracking for ChildAgentDataUpdates
** If the region fails 3 times, then ChildAgentDataUpdates no longer get sent to that region
* Enabled Child_Get_Tasks in grid mode.
* When Child_Get_Tasks is enabled on neighbor regions, the neighbor region uses the client's draw distance to send out prim. This is a lot less likely to flood the client now since the ChildAgentDataUpdate contains both the throttle settings and the draw distance. This means that with this enabled, you can see prim in other regions in grid mode. Very experimental.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 29 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/PacketQueue.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 198 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 30 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | 33 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 58 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 5 |
9 files changed, 270 insertions, 112 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 7d83df7..e84e239 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -276,8 +276,8 @@ namespace OpenSim | |||
276 | 276 | ||
277 | m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); | 277 | m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); |
278 | } | 278 | } |
279 | if (!m_sandbox) | 279 | //if (!m_sandbox) |
280 | m_SendChildAgentTaskData = false; | 280 | //m_SendChildAgentTaskData = false; |
281 | 281 | ||
282 | 282 | ||
283 | m_networkServersInfo.loadFromConfiguration(m_config); | 283 | m_networkServersInfo.loadFromConfiguration(m_config); |
@@ -485,8 +485,8 @@ namespace OpenSim | |||
485 | if (m_SendChildAgentTaskData) | 485 | if (m_SendChildAgentTaskData) |
486 | { | 486 | { |
487 | MainLog.Instance.Error("WARNING", | 487 | MainLog.Instance.Error("WARNING", |
488 | "Send Child Agent Task Updates is enabled. This is for testing only. It doesn't work on grid mode!"); | 488 | "Send Child Agent Task Updates is enabled. This is for testing only."); |
489 | Thread.Sleep(12000); | 489 | //Thread.Sleep(12000); |
490 | } | 490 | } |
491 | return | 491 | return |
492 | new Scene(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, | 492 | new Scene(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, |
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index f37ffc9..9d9a792 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -641,7 +641,8 @@ namespace OpenSim.Region.ClientStack | |||
641 | } | 641 | } |
642 | mov.Data.LookAt = look; | 642 | mov.Data.LookAt = look; |
643 | 643 | ||
644 | OutPacket(mov, ThrottleOutPacketType.Task); | 644 | // Hack to get this out immediately and skip the throttles |
645 | OutPacket(mov, ThrottleOutPacketType.Unknown); | ||
645 | } | 646 | } |
646 | 647 | ||
647 | /// <summary> | 648 | /// <summary> |
@@ -824,7 +825,8 @@ namespace OpenSim.Region.ClientStack | |||
824 | newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port; | 825 | newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port; |
825 | newSimPack.RegionData.SeedCapability = Helpers.StringToField(capsURL); | 826 | newSimPack.RegionData.SeedCapability = Helpers.StringToField(capsURL); |
826 | 827 | ||
827 | OutPacket(newSimPack, ThrottleOutPacketType.Task); | 828 | // Hack to get this out immediately and skip throttles |
829 | OutPacket(newSimPack, ThrottleOutPacketType.Unknown); | ||
828 | } | 830 | } |
829 | 831 | ||
830 | public void SendMapBlock(List<MapBlockData> mapBlocks) | 832 | public void SendMapBlock(List<MapBlockData> mapBlocks) |
@@ -858,7 +860,9 @@ namespace OpenSim.Region.ClientStack | |||
858 | tpLocal.Info.LocationID = 2; | 860 | tpLocal.Info.LocationID = 2; |
859 | tpLocal.Info.LookAt = lookAt; | 861 | tpLocal.Info.LookAt = lookAt; |
860 | tpLocal.Info.Position = position; | 862 | tpLocal.Info.Position = position; |
861 | OutPacket(tpLocal, ThrottleOutPacketType.Task); | 863 | |
864 | // Hack to get this out immediately and skip throttles | ||
865 | OutPacket(tpLocal, ThrottleOutPacketType.Unknown); | ||
862 | } | 866 | } |
863 | 867 | ||
864 | public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, | 868 | public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, |
@@ -884,7 +888,9 @@ namespace OpenSim.Region.ClientStack | |||
884 | teleport.Info.SimPort = (ushort)newRegionEndPoint.Port; | 888 | teleport.Info.SimPort = (ushort)newRegionEndPoint.Port; |
885 | teleport.Info.LocationID = 4; | 889 | teleport.Info.LocationID = 4; |
886 | teleport.Info.TeleportFlags = 1 << 4; | 890 | teleport.Info.TeleportFlags = 1 << 4; |
887 | OutPacket(teleport, ThrottleOutPacketType.Task); | 891 | |
892 | // Hack to get this out immediately and skip throttles. | ||
893 | OutPacket(teleport, ThrottleOutPacketType.Unknown); | ||
888 | } | 894 | } |
889 | 895 | ||
890 | /// <summary> | 896 | /// <summary> |
@@ -895,7 +901,9 @@ namespace OpenSim.Region.ClientStack | |||
895 | TeleportFailedPacket tpFailed = (TeleportFailedPacket)PacketPool.Instance.GetPacket(PacketType.TeleportFailed); | 901 | TeleportFailedPacket tpFailed = (TeleportFailedPacket)PacketPool.Instance.GetPacket(PacketType.TeleportFailed); |
896 | tpFailed.Info.AgentID = AgentId; | 902 | tpFailed.Info.AgentID = AgentId; |
897 | tpFailed.Info.Reason = Helpers.StringToField(reason); | 903 | tpFailed.Info.Reason = Helpers.StringToField(reason); |
898 | OutPacket(tpFailed, ThrottleOutPacketType.Task); | 904 | |
905 | // Hack to get this out immediately and skip throttles | ||
906 | OutPacket(tpFailed, ThrottleOutPacketType.Unknown); | ||
899 | } | 907 | } |
900 | 908 | ||
901 | /// <summary> | 909 | /// <summary> |
@@ -906,7 +914,9 @@ namespace OpenSim.Region.ClientStack | |||
906 | //TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart); | 914 | //TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart); |
907 | TeleportStartPacket tpStart = new TeleportStartPacket(); | 915 | TeleportStartPacket tpStart = new TeleportStartPacket(); |
908 | tpStart.Info.TeleportFlags = 16; // Teleport via location | 916 | tpStart.Info.TeleportFlags = 16; // Teleport via location |
909 | OutPacket(tpStart, ThrottleOutPacketType.Task); | 917 | |
918 | // Hack to get this out immediately and skip throttles | ||
919 | OutPacket(tpStart, ThrottleOutPacketType.Unknown); | ||
910 | } | 920 | } |
911 | 921 | ||
912 | public void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) | 922 | public void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) |
@@ -1882,7 +1892,7 @@ namespace OpenSim.Region.ClientStack | |||
1882 | objectData.PathTwistBegin = primData.PathTwistBegin; | 1892 | objectData.PathTwistBegin = primData.PathTwistBegin; |
1883 | objectData.ExtraParams = primData.ExtraParams; | 1893 | objectData.ExtraParams = primData.ExtraParams; |
1884 | } | 1894 | } |
1885 | 1895 | ||
1886 | /// <summary> | 1896 | /// <summary> |
1887 | /// Set some default values in a ObjectUpdatePacket | 1897 | /// Set some default values in a ObjectUpdatePacket |
1888 | /// </summary> | 1898 | /// </summary> |
@@ -2222,6 +2232,11 @@ namespace OpenSim.Region.ClientStack | |||
2222 | */ | 2232 | */ |
2223 | } | 2233 | } |
2224 | 2234 | ||
2235 | public byte[] GetThrottlesPacked(float multiplier) | ||
2236 | { | ||
2237 | return m_packetQueue.GetThrottlesPacked(multiplier); | ||
2238 | } | ||
2239 | |||
2225 | public void SetChildAgentThrottle(byte[] throttles) | 2240 | public void SetChildAgentThrottle(byte[] throttles) |
2226 | { | 2241 | { |
2227 | m_packetQueue.SetThrottleFromClient(throttles); | 2242 | m_packetQueue.SetThrottleFromClient(throttles); |
diff --git a/OpenSim/Region/ClientStack/PacketQueue.cs b/OpenSim/Region/ClientStack/PacketQueue.cs index 1065f63..685f91b 100644 --- a/OpenSim/Region/ClientStack/PacketQueue.cs +++ b/OpenSim/Region/ClientStack/PacketQueue.cs | |||
@@ -356,7 +356,7 @@ namespace OpenSim.Region.ClientStack | |||
356 | return (int) (((float) value/(float) curmax)*newmax); | 356 | return (int) (((float) value/(float) curmax)*newmax); |
357 | } | 357 | } |
358 | 358 | ||
359 | private byte[] GetThrottlesPacked(float multiplier) | 359 | public byte[] GetThrottlesPacked(float multiplier) |
360 | { | 360 | { |
361 | int singlefloat = 4; | 361 | int singlefloat = 4; |
362 | float tResend = ResendThrottle.Throttle*multiplier; | 362 | float tResend = ResendThrottle.Throttle*multiplier; |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 73cd061..8429d00 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -50,6 +50,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
50 | private LocalBackEndServices m_localBackend = new LocalBackEndServices(); | 50 | private LocalBackEndServices m_localBackend = new LocalBackEndServices(); |
51 | private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>(); | 51 | private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>(); |
52 | private List<SimpleRegionInfo> m_knownRegions = new List<SimpleRegionInfo>(); | 52 | private List<SimpleRegionInfo> m_knownRegions = new List<SimpleRegionInfo>(); |
53 | private Dictionary<ulong, int> m_deadRegionCache = new Dictionary<ulong, int>(); | ||
53 | private Dictionary<string, string> m_queuedGridSettings = new Dictionary<string, string>(); | 54 | private Dictionary<string, string> m_queuedGridSettings = new Dictionary<string, string>(); |
54 | 55 | ||
55 | public BaseHttpServer httpListener; | 56 | public BaseHttpServer httpListener; |
@@ -499,79 +500,99 @@ namespace OpenSim.Region.Communications.OGS1 | |||
499 | 500 | ||
500 | public bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) | 501 | public bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) |
501 | { | 502 | { |
502 | RegionInfo regInfo = null; | 503 | int failures = 0; |
503 | try | 504 | lock (m_deadRegionCache) |
504 | { | 505 | { |
505 | if (m_localBackend.ChildAgentUpdate(regionHandle, cAgentData)) | 506 | if (m_deadRegionCache.ContainsKey(regionHandle)) |
506 | { | 507 | { |
507 | return true; | 508 | failures = m_deadRegionCache[regionHandle]; |
508 | } | 509 | } |
509 | 510 | } | |
510 | regInfo = RequestNeighbourInfo(regionHandle); | 511 | if (failures <= 3) |
511 | if (regInfo != null) | 512 | { |
513 | RegionInfo regInfo = null; | ||
514 | try | ||
512 | { | 515 | { |
513 | //don't want to be creating a new link to the remote instance every time like we are here | 516 | if (m_localBackend.ChildAgentUpdate(regionHandle, cAgentData)) |
514 | bool retValue = false; | ||
515 | |||
516 | |||
517 | OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting) Activator.GetObject( | ||
518 | typeof (OGS1InterRegionRemoting), | ||
519 | "tcp://" + regInfo.RemotingAddress + | ||
520 | ":" + regInfo.RemotingPort + | ||
521 | "/InterRegions"); | ||
522 | |||
523 | if (remObject != null) | ||
524 | { | 517 | { |
525 | retValue = remObject.ChildAgentUpdate(regionHandle, cAgentData); | 518 | return true; |
526 | } | 519 | } |
527 | else | 520 | |
521 | regInfo = RequestNeighbourInfo(regionHandle); | ||
522 | if (regInfo != null) | ||
528 | { | 523 | { |
529 | Console.WriteLine("remoting object not found"); | 524 | //don't want to be creating a new link to the remote instance every time like we are here |
525 | bool retValue = false; | ||
526 | |||
527 | |||
528 | OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( | ||
529 | typeof(OGS1InterRegionRemoting), | ||
530 | "tcp://" + regInfo.RemotingAddress + | ||
531 | ":" + regInfo.RemotingPort + | ||
532 | "/InterRegions"); | ||
533 | |||
534 | if (remObject != null) | ||
535 | { | ||
536 | retValue = remObject.ChildAgentUpdate(regionHandle, cAgentData); | ||
537 | } | ||
538 | else | ||
539 | { | ||
540 | Console.WriteLine("remoting object not found"); | ||
541 | } | ||
542 | remObject = null; | ||
543 | //MainLog.Instance.Verbose("INTER", | ||
544 | //gdebugRegionName + | ||
545 | //": OGS1 tried to Update Child Agent data on outside region and got " + | ||
546 | //retValue.ToString()); | ||
547 | |||
548 | return retValue; | ||
530 | } | 549 | } |
531 | remObject = null; | 550 | NoteDeadRegion(regionHandle); |
532 | MainLog.Instance.Verbose("INTER", | ||
533 | gdebugRegionName + | ||
534 | ": OGS1 tried to Update Child Agent data on outside region and got " + | ||
535 | retValue.ToString()); | ||
536 | 551 | ||
537 | return retValue; | 552 | return false; |
553 | } | ||
554 | catch (RemotingException e) | ||
555 | { | ||
556 | NoteDeadRegion(regionHandle); | ||
557 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + | ||
558 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
559 | MainLog.Instance.Debug(e.ToString()); | ||
560 | return false; | ||
561 | } | ||
562 | catch (SocketException e) | ||
563 | { | ||
564 | NoteDeadRegion(regionHandle); | ||
565 | MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + " " + | ||
566 | regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
567 | MainLog.Instance.Debug(e.ToString()); | ||
568 | return false; | ||
569 | } | ||
570 | catch (InvalidCredentialException e) | ||
571 | { | ||
572 | NoteDeadRegion(regionHandle); | ||
573 | MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + | ||
574 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
575 | MainLog.Instance.Debug(e.ToString()); | ||
576 | return false; | ||
577 | } | ||
578 | catch (AuthenticationException e) | ||
579 | { | ||
580 | NoteDeadRegion(regionHandle); | ||
581 | MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + | ||
582 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
583 | MainLog.Instance.Debug(e.ToString()); | ||
584 | return false; | ||
585 | } | ||
586 | catch (Exception e) | ||
587 | { | ||
588 | NoteDeadRegion(regionHandle); | ||
589 | MainLog.Instance.Debug(e.ToString()); | ||
590 | return false; | ||
538 | } | 591 | } |
539 | |||
540 | return false; | ||
541 | } | ||
542 | catch (RemotingException e) | ||
543 | { | ||
544 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + | ||
545 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
546 | MainLog.Instance.Debug(e.ToString()); | ||
547 | return false; | ||
548 | } | ||
549 | catch (SocketException e) | ||
550 | { | ||
551 | MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + | ||
552 | regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
553 | MainLog.Instance.Debug(e.ToString()); | ||
554 | return false; | ||
555 | } | ||
556 | catch (InvalidCredentialException e) | ||
557 | { | ||
558 | MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + | ||
559 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
560 | MainLog.Instance.Debug(e.ToString()); | ||
561 | return false; | ||
562 | } | ||
563 | catch (AuthenticationException e) | ||
564 | { | ||
565 | MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + | ||
566 | regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
567 | MainLog.Instance.Debug(e.ToString()); | ||
568 | return false; | ||
569 | } | 592 | } |
570 | catch (Exception e) | 593 | else |
571 | { | 594 | { |
572 | MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + | 595 | //MainLog.Instance.Verbose("INTERREGION", "Skipped Sending Child Update to a region because it failed too many times:" + regionHandle.ToString()); |
573 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
574 | MainLog.Instance.Debug(e.ToString()); | ||
575 | return false; | 596 | return false; |
576 | } | 597 | } |
577 | } | 598 | } |
@@ -622,11 +643,12 @@ namespace OpenSim.Region.Communications.OGS1 | |||
622 | return retValue; | 643 | return retValue; |
623 | 644 | ||
624 | } | 645 | } |
625 | 646 | NoteDeadRegion(regionHandle); | |
626 | return false; | 647 | return false; |
627 | } | 648 | } |
628 | catch (RemotingException e) | 649 | catch (RemotingException e) |
629 | { | 650 | { |
651 | NoteDeadRegion(regionHandle); | ||
630 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + | 652 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + |
631 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 653 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
632 | MainLog.Instance.Debug(e.ToString()); | 654 | MainLog.Instance.Debug(e.ToString()); |
@@ -634,6 +656,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
634 | } | 656 | } |
635 | catch (SocketException e) | 657 | catch (SocketException e) |
636 | { | 658 | { |
659 | NoteDeadRegion(regionHandle); | ||
637 | MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + | 660 | MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + |
638 | regInfo.RegionLocX + "," + regInfo.RegionLocY); | 661 | regInfo.RegionLocX + "," + regInfo.RegionLocY); |
639 | MainLog.Instance.Debug(e.ToString()); | 662 | MainLog.Instance.Debug(e.ToString()); |
@@ -641,6 +664,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
641 | } | 664 | } |
642 | catch (InvalidCredentialException e) | 665 | catch (InvalidCredentialException e) |
643 | { | 666 | { |
667 | NoteDeadRegion(regionHandle); | ||
644 | MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + | 668 | MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + |
645 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 669 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
646 | MainLog.Instance.Debug(e.ToString()); | 670 | MainLog.Instance.Debug(e.ToString()); |
@@ -648,6 +672,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
648 | } | 672 | } |
649 | catch (AuthenticationException e) | 673 | catch (AuthenticationException e) |
650 | { | 674 | { |
675 | NoteDeadRegion(regionHandle); | ||
651 | MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + | 676 | MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + |
652 | regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 677 | regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
653 | MainLog.Instance.Debug(e.ToString()); | 678 | MainLog.Instance.Debug(e.ToString()); |
@@ -655,6 +680,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
655 | } | 680 | } |
656 | catch (Exception e) | 681 | catch (Exception e) |
657 | { | 682 | { |
683 | NoteDeadRegion(regionHandle); | ||
658 | MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + | 684 | MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + |
659 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 685 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
660 | MainLog.Instance.Debug(e.ToString()); | 686 | MainLog.Instance.Debug(e.ToString()); |
@@ -813,11 +839,12 @@ namespace OpenSim.Region.Communications.OGS1 | |||
813 | 839 | ||
814 | return retValue; | 840 | return retValue; |
815 | } | 841 | } |
816 | 842 | NoteDeadRegion(regionHandle); | |
817 | return false; | 843 | return false; |
818 | } | 844 | } |
819 | catch (RemotingException e) | 845 | catch (RemotingException e) |
820 | { | 846 | { |
847 | NoteDeadRegion(regionHandle); | ||
821 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + | 848 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + |
822 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 849 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
823 | MainLog.Instance.Debug(e.ToString()); | 850 | MainLog.Instance.Debug(e.ToString()); |
@@ -825,6 +852,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
825 | } | 852 | } |
826 | catch (SocketException e) | 853 | catch (SocketException e) |
827 | { | 854 | { |
855 | NoteDeadRegion(regionHandle); | ||
828 | MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + | 856 | MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + |
829 | regInfo.RegionLocX + "," + regInfo.RegionLocY); | 857 | regInfo.RegionLocX + "," + regInfo.RegionLocY); |
830 | MainLog.Instance.Debug(e.ToString()); | 858 | MainLog.Instance.Debug(e.ToString()); |
@@ -832,6 +860,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
832 | } | 860 | } |
833 | catch (InvalidCredentialException e) | 861 | catch (InvalidCredentialException e) |
834 | { | 862 | { |
863 | NoteDeadRegion(regionHandle); | ||
835 | MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + | 864 | MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + |
836 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 865 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
837 | MainLog.Instance.Debug(e.ToString()); | 866 | MainLog.Instance.Debug(e.ToString()); |
@@ -839,6 +868,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
839 | } | 868 | } |
840 | catch (AuthenticationException e) | 869 | catch (AuthenticationException e) |
841 | { | 870 | { |
871 | NoteDeadRegion(regionHandle); | ||
842 | MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + | 872 | MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + |
843 | regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 873 | regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
844 | MainLog.Instance.Debug(e.ToString()); | 874 | MainLog.Instance.Debug(e.ToString()); |
@@ -846,6 +876,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
846 | } | 876 | } |
847 | catch (Exception e) | 877 | catch (Exception e) |
848 | { | 878 | { |
879 | NoteDeadRegion(regionHandle); | ||
849 | MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + | 880 | MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + |
850 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 881 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
851 | MainLog.Instance.Debug(e.ToString()); | 882 | MainLog.Instance.Debug(e.ToString()); |
@@ -895,10 +926,12 @@ namespace OpenSim.Region.Communications.OGS1 | |||
895 | } | 926 | } |
896 | //TODO need to see if we know about where this region is and use .net remoting | 927 | //TODO need to see if we know about where this region is and use .net remoting |
897 | // to inform it. | 928 | // to inform it. |
929 | NoteDeadRegion(regionHandle); | ||
898 | return false; | 930 | return false; |
899 | } | 931 | } |
900 | catch (RemotingException e) | 932 | catch (RemotingException e) |
901 | { | 933 | { |
934 | NoteDeadRegion(regionHandle); | ||
902 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + | 935 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + |
903 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 936 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
904 | MainLog.Instance.Debug(e.ToString()); | 937 | MainLog.Instance.Debug(e.ToString()); |
@@ -906,6 +939,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
906 | } | 939 | } |
907 | catch | 940 | catch |
908 | { | 941 | { |
942 | NoteDeadRegion(regionHandle); | ||
909 | return false; | 943 | return false; |
910 | } | 944 | } |
911 | } | 945 | } |
@@ -945,10 +979,12 @@ namespace OpenSim.Region.Communications.OGS1 | |||
945 | } | 979 | } |
946 | //TODO need to see if we know about where this region is and use .net remoting | 980 | //TODO need to see if we know about where this region is and use .net remoting |
947 | // to inform it. | 981 | // to inform it. |
982 | NoteDeadRegion(regionHandle); | ||
948 | return false; | 983 | return false; |
949 | } | 984 | } |
950 | catch (RemotingException e) | 985 | catch (RemotingException e) |
951 | { | 986 | { |
987 | NoteDeadRegion(regionHandle); | ||
952 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + | 988 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + |
953 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 989 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
954 | MainLog.Instance.Debug(e.ToString()); | 990 | MainLog.Instance.Debug(e.ToString()); |
@@ -956,6 +992,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
956 | } | 992 | } |
957 | catch | 993 | catch |
958 | { | 994 | { |
995 | NoteDeadRegion(regionHandle); | ||
959 | return false; | 996 | return false; |
960 | } | 997 | } |
961 | } | 998 | } |
@@ -994,10 +1031,12 @@ namespace OpenSim.Region.Communications.OGS1 | |||
994 | } | 1031 | } |
995 | //TODO need to see if we know about where this region is and use .net remoting | 1032 | //TODO need to see if we know about where this region is and use .net remoting |
996 | // to inform it. | 1033 | // to inform it. |
1034 | NoteDeadRegion(regionHandle); | ||
997 | return false; | 1035 | return false; |
998 | } | 1036 | } |
999 | catch (RemotingException e) | 1037 | catch (RemotingException e) |
1000 | { | 1038 | { |
1039 | NoteDeadRegion(regionHandle); | ||
1001 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region to tell it to close child agents: " + regInfo.RegionName + | 1040 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region to tell it to close child agents: " + regInfo.RegionName + |
1002 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | 1041 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); |
1003 | //MainLog.Instance.Debug(e.ToString()); | 1042 | //MainLog.Instance.Debug(e.ToString()); |
@@ -1006,6 +1045,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1006 | 1045 | ||
1007 | catch (SocketException e) | 1046 | catch (SocketException e) |
1008 | { | 1047 | { |
1048 | NoteDeadRegion(regionHandle); | ||
1009 | MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region using tcp://" + | 1049 | MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region using tcp://" + |
1010 | regInfo.RemotingAddress + | 1050 | regInfo.RemotingAddress + |
1011 | ":" + regInfo.RemotingPort + | 1051 | ":" + regInfo.RemotingPort + |
@@ -1016,6 +1056,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1016 | } | 1056 | } |
1017 | catch (InvalidCredentialException e) | 1057 | catch (InvalidCredentialException e) |
1018 | { | 1058 | { |
1059 | NoteDeadRegion(regionHandle); | ||
1019 | MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" + | 1060 | MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" + |
1020 | regInfo.RemotingAddress + | 1061 | regInfo.RemotingAddress + |
1021 | ":" + regInfo.RemotingPort + | 1062 | ":" + regInfo.RemotingPort + |
@@ -1025,6 +1066,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1025 | } | 1066 | } |
1026 | catch (AuthenticationException e) | 1067 | catch (AuthenticationException e) |
1027 | { | 1068 | { |
1069 | NoteDeadRegion(regionHandle); | ||
1028 | MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" + | 1070 | MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" + |
1029 | regInfo.RemotingAddress + | 1071 | regInfo.RemotingAddress + |
1030 | ":" + regInfo.RemotingPort + | 1072 | ":" + regInfo.RemotingPort + |
@@ -1034,6 +1076,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1034 | } | 1076 | } |
1035 | catch (WebException e) | 1077 | catch (WebException e) |
1036 | { | 1078 | { |
1079 | NoteDeadRegion(regionHandle); | ||
1037 | MainLog.Instance.Warn("WebException exception: Unable to connect to adjacent region using tcp://" + | 1080 | MainLog.Instance.Warn("WebException exception: Unable to connect to adjacent region using tcp://" + |
1038 | regInfo.RemotingAddress + | 1081 | regInfo.RemotingAddress + |
1039 | ":" + regInfo.RemotingPort + | 1082 | ":" + regInfo.RemotingPort + |
@@ -1043,6 +1086,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1043 | } | 1086 | } |
1044 | catch (Exception e) | 1087 | catch (Exception e) |
1045 | { | 1088 | { |
1089 | NoteDeadRegion(regionHandle); | ||
1046 | // This line errors with a Null Reference Exception.. Why? @.@ | 1090 | // This line errors with a Null Reference Exception.. Why? @.@ |
1047 | //MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + | 1091 | //MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + |
1048 | // ":" + regInfo.RemotingPort + | 1092 | // ":" + regInfo.RemotingPort + |
@@ -1091,11 +1135,21 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1091 | { | 1135 | { |
1092 | MainLog.Instance.Verbose("INTER", | 1136 | MainLog.Instance.Verbose("INTER", |
1093 | gdebugRegionName + "Incoming OGS1 RegionUpReport: " + "(" + regionData.RegionLocX + | 1137 | gdebugRegionName + "Incoming OGS1 RegionUpReport: " + "(" + regionData.RegionLocX + |
1094 | "," + regionData.RegionLocY + ")"); | 1138 | "," + regionData.RegionLocY + "). Giving this region a fresh set of 'dead' tries"); |
1095 | 1139 | ||
1096 | try | 1140 | try |
1097 | { | 1141 | { |
1142 | lock (m_deadRegionCache) | ||
1143 | { | ||
1144 | if (m_deadRegionCache.ContainsKey(regionData.RegionHandle)) | ||
1145 | { | ||
1146 | |||
1147 | m_deadRegionCache.Remove(regionData.RegionHandle); | ||
1148 | } | ||
1149 | } | ||
1150 | |||
1098 | return m_localBackend.TriggerRegionUp(new RegionInfo(regionData), regionhandle); | 1151 | return m_localBackend.TriggerRegionUp(new RegionInfo(regionData), regionhandle); |
1152 | |||
1099 | } | 1153 | } |
1100 | 1154 | ||
1101 | catch (RemotingException e) | 1155 | catch (RemotingException e) |
@@ -1107,7 +1161,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1107 | 1161 | ||
1108 | public bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) | 1162 | public bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) |
1109 | { | 1163 | { |
1110 | MainLog.Instance.Verbose("INTER", "Incoming OGS1 Child Agent Data Update"); | 1164 | //MainLog.Instance.Verbose("INTER", "Incoming OGS1 Child Agent Data Update"); |
1111 | 1165 | ||
1112 | try | 1166 | try |
1113 | { | 1167 | { |
@@ -1227,6 +1281,20 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1227 | } | 1281 | } |
1228 | socket.Close(); | 1282 | socket.Close(); |
1229 | } | 1283 | } |
1284 | public void NoteDeadRegion(ulong regionhandle) | ||
1285 | { | ||
1286 | lock (m_deadRegionCache) | ||
1287 | { | ||
1288 | if (m_deadRegionCache.ContainsKey(regionhandle)) | ||
1289 | { | ||
1290 | m_deadRegionCache[regionhandle] = m_deadRegionCache[regionhandle] + 1; | ||
1291 | } | ||
1292 | else | ||
1293 | { | ||
1294 | m_deadRegionCache.Add(regionhandle, 1); | ||
1295 | } | ||
1296 | } | ||
1297 | } | ||
1230 | } | 1298 | } |
1231 | 1299 | ||
1232 | } \ No newline at end of file | 1300 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 9aa3f20..6c0ed28 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -537,20 +537,24 @@ namespace OpenSim.Region.Environment.Scenes | |||
537 | // the initial update for and what we'll use to limit the | 537 | // the initial update for and what we'll use to limit the |
538 | // space we check for new objects on movement. | 538 | // space we check for new objects on movement. |
539 | 539 | ||
540 | if (presence.IsChildAgent) | 540 | if (presence.IsChildAgent && m_parentScene.m_sendTasksToChild) |
541 | { | 541 | { |
542 | //Vector3 avPosition = new Vector3(presence.AbsolutePosition.X,presence.AbsolutePosition.Y,presence.AbsolutePosition.Z); | 542 | LLVector3 oLoc = ((SceneObjectGroup)ent).AbsolutePosition; |
543 | //LLVector3 oLoc = ((SceneObjectGroup)ent).AbsolutePosition; | 543 | float distResult = (float)Util.GetDistanceTo(presence.AbsolutePosition,oLoc); |
544 | //Vector3 objPosition = new Vector3(oLoc.X,oLoc.Y,oLoc.Z); | 544 | |
545 | //float distResult = Vector3Distance(avPosition, objPosition); | 545 | //MainLog.Instance.Verbose("DISTANCE", distResult.ToString()); |
546 | //if (distResult > 512) | 546 | |
547 | //{ | 547 | if (distResult > 60) |
548 | //int x = 0; | 548 | { |
549 | //} | 549 | int x = 0; |
550 | //if (distResult < presence.DrawDistance) | 550 | } |
551 | //{ | 551 | if (distResult < presence.DrawDistance) |
552 | ((SceneObjectGroup) ent).ScheduleFullUpdateToAvatar(presence); | 552 | { |
553 | //} | 553 | // Send Only if we don't already know about it. |
554 | // KnownPrim also makes the prim known when called. | ||
555 | if (!presence.KnownPrim(((SceneObjectGroup) ent).UUID)) | ||
556 | ((SceneObjectGroup) ent).ScheduleFullUpdateToAvatar(presence); | ||
557 | } | ||
554 | } | 558 | } |
555 | else | 559 | else |
556 | { | 560 | { |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 64b9abb..f32de2e 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1391,6 +1391,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1391 | m_sceneGridService.OnCloseAgentConnection += CloseConnection; | 1391 | m_sceneGridService.OnCloseAgentConnection += CloseConnection; |
1392 | m_sceneGridService.OnRegionUp += OtherRegionUp; | 1392 | m_sceneGridService.OnRegionUp += OtherRegionUp; |
1393 | m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; | 1393 | m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; |
1394 | |||
1395 | |||
1394 | 1396 | ||
1395 | 1397 | ||
1396 | 1398 | ||
@@ -1492,19 +1494,25 @@ namespace OpenSim.Region.Environment.Scenes | |||
1492 | public virtual bool IncomingChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) | 1494 | public virtual bool IncomingChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) |
1493 | { | 1495 | { |
1494 | ScenePresence childAgentUpdate = GetScenePresence(new LLUUID(cAgentData.AgentID)); | 1496 | ScenePresence childAgentUpdate = GetScenePresence(new LLUUID(cAgentData.AgentID)); |
1495 | if (!(childAgentUpdate.Equals(null))) | 1497 | if (childAgentUpdate != null) |
1496 | { | 1498 | { |
1497 | // I can't imagine *yet* why we would get an update if the agent is a root agent.. | 1499 | // I can't imagine *yet* why we would get an update if the agent is a root agent.. |
1498 | // however to avoid a race condition crossing borders.. | 1500 | // however to avoid a race condition crossing borders.. |
1499 | if (childAgentUpdate.IsChildAgent) | 1501 | if (childAgentUpdate.IsChildAgent) |
1500 | { | 1502 | { |
1503 | uint rRegionX = (uint)(cAgentData.regionHandle >> 40); | ||
1504 | uint rRegionY = (((uint)(cAgentData.regionHandle)) >> 8); | ||
1505 | uint tRegionX = RegionInfo.RegionLocX; | ||
1506 | uint tRegionY = RegionInfo.RegionLocY; | ||
1501 | //Send Data to ScenePresence | 1507 | //Send Data to ScenePresence |
1502 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); | 1508 | childAgentUpdate.ChildAgentDataUpdate(cAgentData, tRegionX, tRegionY, rRegionX, rRegionY); |
1503 | // Not Implemented: | 1509 | // Not Implemented: |
1504 | //TODO: Do we need to pass the message on to one of our neighbors? | 1510 | //TODO: Do we need to pass the message on to one of our neighbors? |
1511 | |||
1505 | } | 1512 | } |
1513 | return true; | ||
1506 | } | 1514 | } |
1507 | return true; | 1515 | return false; |
1508 | } | 1516 | } |
1509 | 1517 | ||
1510 | /// <summary> | 1518 | /// <summary> |
@@ -1614,6 +1622,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1614 | return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying); | 1622 | return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying); |
1615 | } | 1623 | } |
1616 | 1624 | ||
1625 | public void SendOutChildAgentUpdates(ChildAgentDataUpdate cadu, ScenePresence presence) | ||
1626 | { | ||
1627 | m_sceneGridService.SendChildAgentDataUpdate(cadu, presence); | ||
1628 | } | ||
1629 | |||
1617 | #endregion | 1630 | #endregion |
1618 | 1631 | ||
1619 | #region Module Methods | 1632 | #region Module Methods |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index a9c2c2f..805b44c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -332,7 +332,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
332 | //bool val = m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region)); | 332 | //bool val = m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region)); |
333 | } | 333 | } |
334 | 334 | ||
335 | public delegate void SendChildAgentDataUpdateDelegate(ulong regionHandle, ChildAgentDataUpdate cAgentData); | 335 | public delegate void SendChildAgentDataUpdateDelegate(ChildAgentDataUpdate cAgentData, ScenePresence presence); |
336 | 336 | ||
337 | /// <summary> | 337 | /// <summary> |
338 | /// This informs all neighboring regions about the settings of it's child agent. | 338 | /// This informs all neighboring regions about the settings of it's child agent. |
@@ -341,18 +341,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
341 | /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. | 341 | /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. |
342 | /// | 342 | /// |
343 | /// </summary> | 343 | /// </summary> |
344 | private void SendChildAgentDataUpdateAsync(ulong regionHandle, ChildAgentDataUpdate cAgentData) | 344 | private void SendChildAgentDataUpdateAsync(ChildAgentDataUpdate cAgentData, ScenePresence presence) |
345 | { | 345 | { |
346 | MainLog.Instance.Notice("INTERGRID", "Informing a neighbor about my agent."); | 346 | //MainLog.Instance.Notice("INTERGRID", "Informing neighbors about my agent."); |
347 | bool regionAccepted = m_commsProvider.InterRegion.ChildAgentUpdate(regionHandle, cAgentData); | ||
348 | 347 | ||
349 | if (regionAccepted) | 348 | foreach (ulong regionHandle in presence.KnownChildRegions) |
350 | { | ||
351 | MainLog.Instance.Notice("INTERGRID", "Completed sending a neighbor an update about my agent"); | ||
352 | } | ||
353 | else | ||
354 | { | 349 | { |
355 | MainLog.Instance.Notice("INTERGRID", "Failed sending a neighbor an update about my agent"); | 350 | bool regionAccepted = m_commsProvider.InterRegion.ChildAgentUpdate(regionHandle, cAgentData); |
351 | |||
352 | if (regionAccepted) | ||
353 | { | ||
354 | //MainLog.Instance.Notice("INTERGRID", "Completed sending a neighbor an update about my agent"); | ||
355 | } | ||
356 | else | ||
357 | { | ||
358 | //MainLog.Instance.Notice("INTERGRID", "Failed sending a neighbor an update about my agent"); | ||
359 | } | ||
356 | } | 360 | } |
357 | } | 361 | } |
358 | 362 | ||
@@ -362,11 +366,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
362 | icon.EndInvoke(iar); | 366 | icon.EndInvoke(iar); |
363 | } | 367 | } |
364 | 368 | ||
365 | public void SendChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) | 369 | public void SendChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, ScenePresence presence) |
366 | { | 370 | { |
367 | // This assumes that we know what our neighbors are. | 371 | // This assumes that we know what our neighbors are. |
368 | SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync; | 372 | SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync; |
369 | d.BeginInvoke(regionHandle, cAgentData, | 373 | d.BeginInvoke(cAgentData,presence, |
370 | SendChildAgentDataUpdateCompleted, | 374 | SendChildAgentDataUpdateCompleted, |
371 | d); | 375 | d); |
372 | } | 376 | } |
@@ -374,11 +378,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
374 | public delegate void SendCloseChildAgentDelegate( ScenePresence presence); | 378 | public delegate void SendCloseChildAgentDelegate( ScenePresence presence); |
375 | 379 | ||
376 | /// <summary> | 380 | /// <summary> |
377 | /// This informs all neighboring regions about the settings of it's child agent. | 381 | /// This Closes child agents on neighboring regions |
378 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | 382 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. |
379 | /// | ||
380 | /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. | ||
381 | /// | ||
382 | /// </summary> | 383 | /// </summary> |
383 | private void SendCloseChildAgentAsync(ScenePresence presence) | 384 | private void SendCloseChildAgentAsync(ScenePresence presence) |
384 | { | 385 | { |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index c8310e4..f37b38b 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -55,6 +55,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
55 | private LLVector3 m_requestedSitOffset = new LLVector3(); | 55 | private LLVector3 m_requestedSitOffset = new LLVector3(); |
56 | private float m_sitAvatarHeight = 2.0f; | 56 | private float m_sitAvatarHeight = 2.0f; |
57 | private float m_godlevel = 0; | 57 | private float m_godlevel = 0; |
58 | private LLVector3 m_LastChildAgentUpdatePosition = new LLVector3(); | ||
58 | 59 | ||
59 | private int m_perfMonMS = 0; | 60 | private int m_perfMonMS = 0; |
60 | 61 | ||
@@ -90,6 +91,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
90 | private LLQuaternion m_headrotation = new LLQuaternion(); | 91 | private LLQuaternion m_headrotation = new LLQuaternion(); |
91 | private byte m_state = (byte) 0; | 92 | private byte m_state = (byte) 0; |
92 | 93 | ||
94 | private List<LLUUID> m_knownPrimUUID = new List<LLUUID>(); | ||
95 | |||
93 | // Agent's Draw distance. | 96 | // Agent's Draw distance. |
94 | protected float m_DrawDistance = 0f; | 97 | protected float m_DrawDistance = 0f; |
95 | 98 | ||
@@ -136,6 +139,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
136 | get { return m_physicsActor; } | 139 | get { return m_physicsActor; } |
137 | } | 140 | } |
138 | 141 | ||
142 | public bool KnownPrim(LLUUID primID) | ||
143 | { | ||
144 | if (m_knownPrimUUID.Contains(primID)) | ||
145 | { | ||
146 | return true; | ||
147 | } | ||
148 | m_knownPrimUUID.Add(primID); | ||
149 | return false; | ||
150 | } | ||
151 | |||
152 | |||
139 | public bool Updated | 153 | public bool Updated |
140 | { | 154 | { |
141 | set { m_updateflag = value; } | 155 | set { m_updateflag = value; } |
@@ -499,7 +513,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
499 | m_scene.CommsManager.UserProfileCacheService.UpdateUserInventory(m_uuid); | 513 | m_scene.CommsManager.UserProfileCacheService.UpdateUserInventory(m_uuid); |
500 | //if (!m_gotAllObjectsInScene) | 514 | //if (!m_gotAllObjectsInScene) |
501 | //{ | 515 | //{ |
502 | //m_scene.SendAllSceneObjectsToClient(this); | 516 | m_scene.SendAllSceneObjectsToClient(this); |
503 | //m_gotAllObjectsInScene = true; | 517 | //m_gotAllObjectsInScene = true; |
504 | //} | 518 | //} |
505 | } | 519 | } |
@@ -1408,6 +1422,29 @@ namespace OpenSim.Region.Environment.Scenes | |||
1408 | m_scene.NotifyMyCoarseLocationChange(); | 1422 | m_scene.NotifyMyCoarseLocationChange(); |
1409 | } | 1423 | } |
1410 | } | 1424 | } |
1425 | |||
1426 | // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m | ||
1427 | if (Util.GetDistanceTo(AbsolutePosition,m_LastChildAgentUpdatePosition) > 32) | ||
1428 | { | ||
1429 | ChildAgentDataUpdate cadu = new ChildAgentDataUpdate(); | ||
1430 | cadu.ActiveGroupID=LLUUID.Zero.UUID; | ||
1431 | cadu.AgentID = UUID.UUID; | ||
1432 | cadu.alwaysrun = m_setAlwaysRun; | ||
1433 | cadu.AVHeight = m_avHeight; | ||
1434 | LLVector3 tempCameraCenter = new LLVector3(m_CameraCenter.x, m_CameraCenter.y, m_CameraCenter.z); | ||
1435 | cadu.cameraPosition = new sLLVector3(tempCameraCenter); | ||
1436 | cadu.drawdistance = m_DrawDistance; | ||
1437 | cadu.godlevel = m_godlevel; | ||
1438 | cadu.GroupAccess = 0; | ||
1439 | cadu.Position = new sLLVector3(AbsolutePosition); | ||
1440 | cadu.regionHandle = m_scene.RegionInfo.RegionHandle; | ||
1441 | cadu.throttles = ControllingClient.GetThrottlesPacked(1f); | ||
1442 | cadu.Velocity = new sLLVector3(Velocity); | ||
1443 | m_scene.SendOutChildAgentUpdates(cadu,this); | ||
1444 | m_LastChildAgentUpdatePosition.X = AbsolutePosition.X; | ||
1445 | m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y; | ||
1446 | m_LastChildAgentUpdatePosition.Z = AbsolutePosition.Z; | ||
1447 | } | ||
1411 | } | 1448 | } |
1412 | 1449 | ||
1413 | #endregion | 1450 | #endregion |
@@ -1532,15 +1569,30 @@ namespace OpenSim.Region.Environment.Scenes | |||
1532 | /// This updates important decision making data about a child agent | 1569 | /// This updates important decision making data about a child agent |
1533 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region | 1570 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region |
1534 | /// </summary> | 1571 | /// </summary> |
1535 | public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData) | 1572 | public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY) |
1536 | { | 1573 | { |
1537 | // | 1574 | // |
1575 | int shiftx = ((int)rRegionX - (int)tRegionX) * 256; | ||
1576 | int shifty = ((int)rRegionY - (int)tRegionY) * 256; | ||
1577 | |||
1538 | m_DrawDistance = cAgentData.drawdistance; | 1578 | m_DrawDistance = cAgentData.drawdistance; |
1539 | m_pos = new LLVector3(cAgentData.Position.x, cAgentData.Position.y, cAgentData.Position.z); | 1579 | m_pos = new LLVector3(cAgentData.Position.x + shiftx, cAgentData.Position.y + shifty, cAgentData.Position.z); |
1580 | |||
1581 | // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region | ||
1540 | m_CameraCenter = | 1582 | m_CameraCenter = |
1541 | new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); | 1583 | new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); |
1584 | |||
1585 | |||
1542 | m_godlevel = cAgentData.godlevel; | 1586 | m_godlevel = cAgentData.godlevel; |
1587 | SetHeight(cAgentData.AVHeight); | ||
1588 | |||
1543 | ControllingClient.SetChildAgentThrottle(cAgentData.throttles); | 1589 | ControllingClient.SetChildAgentThrottle(cAgentData.throttles); |
1590 | |||
1591 | |||
1592 | |||
1593 | // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. | ||
1594 | if (m_scene.m_sendTasksToChild) | ||
1595 | m_scene.SendAllSceneObjectsToClient(this); | ||
1544 | //cAgentData.AVHeight; | 1596 | //cAgentData.AVHeight; |
1545 | //cAgentData.regionHandle; | 1597 | //cAgentData.regionHandle; |
1546 | //m_velocity = cAgentData.Velocity; | 1598 | //m_velocity = cAgentData.Velocity; |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 69060f1..ea1e28e 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -226,7 +226,12 @@ namespace SimpleApp | |||
226 | public virtual void SetChildAgentThrottle(byte[] throttle) | 226 | public virtual void SetChildAgentThrottle(byte[] throttle) |
227 | { | 227 | { |
228 | } | 228 | } |
229 | public byte[] GetThrottlesPacked(float multiplier) | ||
230 | { | ||
231 | return new byte[0]; | ||
232 | } | ||
229 | 233 | ||
234 | |||
230 | public virtual void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) | 235 | public virtual void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) |
231 | { | 236 | { |
232 | } | 237 | } |