diff options
author | Melanie | 2013-03-26 03:26:02 +0000 |
---|---|---|
committer | Melanie | 2013-03-26 03:26:02 +0000 |
commit | 95d0a7d4faffd94199f49e2bd0d658d2d8333189 (patch) | |
tree | 639471bf99034d3209ca6b8496668d9e0fbdbe84 /OpenSim/Region/CoreModules | |
parent | Merge branch 'master' into careminster (diff) | |
parent | BulletSim: new algorithm for vertical attraction which uses quaternion (diff) | |
download | opensim-SC-95d0a7d4faffd94199f49e2bd0d658d2d8333189.zip opensim-SC-95d0a7d4faffd94199f49e2bd0d658d2d8333189.tar.gz opensim-SC-95d0a7d4faffd94199f49e2bd0d658d2d8333189.tar.bz2 opensim-SC-95d0a7d4faffd94199f49e2bd0d658d2d8333189.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 119 |
1 files changed, 109 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index a30d8eb..974fd57 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -33,6 +33,7 @@ using System.Threading; | |||
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Capabilities; | 34 | using OpenSim.Framework.Capabilities; |
35 | using OpenSim.Framework.Client; | 35 | using OpenSim.Framework.Client; |
36 | using OpenSim.Framework.Monitoring; | ||
36 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.Physics.Manager; |
@@ -77,6 +78,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
77 | /// </remarks> | 78 | /// </remarks> |
78 | public bool DisableInterRegionTeleportCancellation { get; set; } | 79 | public bool DisableInterRegionTeleportCancellation { get; set; } |
79 | 80 | ||
81 | /// <summary> | ||
82 | /// Number of times inter-region teleport was attempted. | ||
83 | /// </summary> | ||
84 | private Stat m_interRegionTeleportAttempts; | ||
85 | |||
86 | /// <summary> | ||
87 | /// Number of times inter-region teleport was aborted (due to simultaneous client logout). | ||
88 | /// </summary> | ||
89 | private Stat m_interRegionTeleportAborts; | ||
90 | |||
91 | /// <summary> | ||
92 | /// Number of times inter-region teleport was successfully cancelled by the client. | ||
93 | /// </summary> | ||
94 | private Stat m_interRegionTeleportCancels; | ||
95 | |||
96 | /// <summary> | ||
97 | /// Number of times inter-region teleport failed due to server/client/network problems (e.g. viewer failed to | ||
98 | /// connect with destination region). | ||
99 | /// </summary> | ||
100 | /// <remarks> | ||
101 | /// This is not necessarily a problem for this simulator - in open-grid/hg conditions, viewer connectivity to | ||
102 | /// destination simulator is unknown. | ||
103 | /// </remarks> | ||
104 | private Stat m_interRegionTeleportFailures; | ||
105 | |||
80 | protected bool m_Enabled = false; | 106 | protected bool m_Enabled = false; |
81 | 107 | ||
82 | public Scene Scene { get; private set; } | 108 | public Scene Scene { get; private set; } |
@@ -156,6 +182,60 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
156 | 182 | ||
157 | Scene = scene; | 183 | Scene = scene; |
158 | 184 | ||
185 | m_interRegionTeleportAttempts = | ||
186 | new Stat( | ||
187 | "InterRegionTeleportAttempts", | ||
188 | "Number of inter-region teleports attempted.", | ||
189 | "This does not count attempts which failed due to pre-conditions (e.g. target simulator refused access).\n" | ||
190 | + "You can get successfully teleports by subtracting aborts, cancels and teleport failures from this figure.", | ||
191 | "", | ||
192 | "entitytransfer", | ||
193 | Scene.Name, | ||
194 | StatType.Push, | ||
195 | null, | ||
196 | StatVerbosity.Debug); | ||
197 | |||
198 | m_interRegionTeleportAborts = | ||
199 | new Stat( | ||
200 | "InterRegionTeleportAborts", | ||
201 | "Number of inter-region teleports aborted due to client actions.", | ||
202 | "The chief action is simultaneous logout whilst teleporting.", | ||
203 | "", | ||
204 | "entitytransfer", | ||
205 | Scene.Name, | ||
206 | StatType.Push, | ||
207 | null, | ||
208 | StatVerbosity.Debug); | ||
209 | |||
210 | m_interRegionTeleportCancels = | ||
211 | new Stat( | ||
212 | "InterRegionTeleportCancels", | ||
213 | "Number of inter-region teleports cancelled by the client.", | ||
214 | null, | ||
215 | "", | ||
216 | "entitytransfer", | ||
217 | Scene.Name, | ||
218 | StatType.Push, | ||
219 | null, | ||
220 | StatVerbosity.Debug); | ||
221 | |||
222 | m_interRegionTeleportFailures = | ||
223 | new Stat( | ||
224 | "InterRegionTeleportFailures", | ||
225 | "Number of inter-region teleports that failed due to server/client/network issues.", | ||
226 | "This number may not be very helpful in open-grid/hg situations as the network connectivity/quality of destinations is uncontrollable.", | ||
227 | "", | ||
228 | "entitytransfer", | ||
229 | Scene.Name, | ||
230 | StatType.Push, | ||
231 | null, | ||
232 | StatVerbosity.Debug); | ||
233 | |||
234 | StatsManager.RegisterStat(m_interRegionTeleportAttempts); | ||
235 | StatsManager.RegisterStat(m_interRegionTeleportAborts); | ||
236 | StatsManager.RegisterStat(m_interRegionTeleportCancels); | ||
237 | StatsManager.RegisterStat(m_interRegionTeleportFailures); | ||
238 | |||
159 | scene.RegisterModuleInterface<IEntityTransferModule>(this); | 239 | scene.RegisterModuleInterface<IEntityTransferModule>(this); |
160 | scene.EventManager.OnNewClient += OnNewClient; | 240 | scene.EventManager.OnNewClient += OnNewClient; |
161 | } | 241 | } |
@@ -173,7 +253,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
173 | 253 | ||
174 | public virtual void Close() {} | 254 | public virtual void Close() {} |
175 | 255 | ||
176 | public virtual void RemoveRegion(Scene scene) {} | 256 | public virtual void RemoveRegion(Scene scene) |
257 | { | ||
258 | StatsManager.DeregisterStat(m_interRegionTeleportAttempts); | ||
259 | StatsManager.DeregisterStat(m_interRegionTeleportAborts); | ||
260 | StatsManager.DeregisterStat(m_interRegionTeleportCancels); | ||
261 | StatsManager.DeregisterStat(m_interRegionTeleportFailures); | ||
262 | } | ||
177 | 263 | ||
178 | public virtual void RegionLoaded(Scene scene) | 264 | public virtual void RegionLoaded(Scene scene) |
179 | { | 265 | { |
@@ -548,6 +634,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
548 | return; | 634 | return; |
549 | } | 635 | } |
550 | 636 | ||
637 | // Before this point, teleport 'failure' is due to checkable pre-conditions such as whether the target | ||
638 | // simulator can be found and is explicitly prepared to allow access. Therefore, we will not count these | ||
639 | // as server attempts. | ||
640 | m_interRegionTeleportAttempts.Value++; | ||
641 | |||
551 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Destination is running version {0}", version); | 642 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Destination is running version {0}", version); |
552 | 643 | ||
553 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from | 644 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from |
@@ -600,6 +691,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
600 | bool logout = false; | 691 | bool logout = false; |
601 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) | 692 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) |
602 | { | 693 | { |
694 | m_interRegionTeleportFailures.Value++; | ||
695 | |||
603 | sp.ControllingClient.SendTeleportFailed(String.Format("Teleport refused: {0}", reason)); | 696 | sp.ControllingClient.SendTeleportFailed(String.Format("Teleport refused: {0}", reason)); |
604 | 697 | ||
605 | m_log.DebugFormat( | 698 | m_log.DebugFormat( |
@@ -611,6 +704,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
611 | 704 | ||
612 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Cancelling) | 705 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Cancelling) |
613 | { | 706 | { |
707 | m_interRegionTeleportCancels.Value++; | ||
708 | |||
614 | m_log.DebugFormat( | 709 | m_log.DebugFormat( |
615 | "[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after CreateAgent on client request", | 710 | "[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after CreateAgent on client request", |
616 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 711 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -619,6 +714,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
619 | } | 714 | } |
620 | else if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 715 | else if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
621 | { | 716 | { |
717 | m_interRegionTeleportAborts.Value++; | ||
718 | |||
622 | m_log.DebugFormat( | 719 | m_log.DebugFormat( |
623 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after CreateAgent due to previous client close.", | 720 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after CreateAgent due to previous client close.", |
624 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 721 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -688,6 +785,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
688 | // establish th econnection to the destination which makes it return true. | 785 | // establish th econnection to the destination which makes it return true. |
689 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 786 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
690 | { | 787 | { |
788 | m_interRegionTeleportAborts.Value++; | ||
789 | |||
691 | m_log.DebugFormat( | 790 | m_log.DebugFormat( |
692 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} before UpdateAgent", | 791 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} before UpdateAgent", |
693 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 792 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -703,6 +802,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
703 | { | 802 | { |
704 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 803 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
705 | { | 804 | { |
805 | m_interRegionTeleportAborts.Value++; | ||
806 | |||
706 | m_log.DebugFormat( | 807 | m_log.DebugFormat( |
707 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after UpdateAgent due to previous client close.", | 808 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after UpdateAgent due to previous client close.", |
708 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 809 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -720,6 +821,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
720 | 821 | ||
721 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Cancelling) | 822 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Cancelling) |
722 | { | 823 | { |
824 | m_interRegionTeleportCancels.Value++; | ||
825 | |||
723 | m_log.DebugFormat( | 826 | m_log.DebugFormat( |
724 | "[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after UpdateAgent on client request", | 827 | "[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after UpdateAgent on client request", |
725 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 828 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -755,6 +858,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
755 | { | 858 | { |
756 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 859 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
757 | { | 860 | { |
861 | m_interRegionTeleportAborts.Value++; | ||
862 | |||
758 | m_log.DebugFormat( | 863 | m_log.DebugFormat( |
759 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after WaitForAgentArrivedAtDestination due to previous client close.", | 864 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after WaitForAgentArrivedAtDestination due to previous client close.", |
760 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 865 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -767,6 +872,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
767 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); | 872 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); |
768 | 873 | ||
769 | Fail(sp, finalDestination, logout, "Destination region did not signal teleport completion."); | 874 | Fail(sp, finalDestination, logout, "Destination region did not signal teleport completion."); |
875 | |||
770 | return; | 876 | return; |
771 | } | 877 | } |
772 | 878 | ||
@@ -808,15 +914,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
808 | // now we have a child agent in this region. | 914 | // now we have a child agent in this region. |
809 | sp.Reset(); | 915 | sp.Reset(); |
810 | } | 916 | } |
811 | |||
812 | // Commented pending deletion since this method no longer appears to do anything at all | ||
813 | // // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! | ||
814 | // if (sp.Scene.NeedSceneCacheClear(sp.UUID)) | ||
815 | // { | ||
816 | // m_log.DebugFormat( | ||
817 | // "[ENTITY TRANSFER MODULE]: User {0} is going to another region, profile cache removed", | ||
818 | // sp.UUID); | ||
819 | // } | ||
820 | } | 917 | } |
821 | 918 | ||
822 | /// <summary> | 919 | /// <summary> |
@@ -852,6 +949,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
852 | { | 949 | { |
853 | CleanupFailedInterRegionTeleport(sp, finalDestination); | 950 | CleanupFailedInterRegionTeleport(sp, finalDestination); |
854 | 951 | ||
952 | m_interRegionTeleportFailures.Value++; | ||
953 | |||
855 | sp.ControllingClient.SendTeleportFailed( | 954 | sp.ControllingClient.SendTeleportFailed( |
856 | string.Format( | 955 | string.Format( |
857 | "Problems connecting to destination {0}, reason: {1}", finalDestination.RegionName, reason)); | 956 | "Problems connecting to destination {0}, reason: {1}", finalDestination.RegionName, reason)); |