aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2010-11-05 14:27:14 +0100
committerMelanie2010-11-05 14:27:14 +0100
commitf985775962ae8da0010cc5ef5f903a53b550f5d2 (patch)
tree53c9233ad397080143f9e2087fdfb7b79e67e5b5 /OpenSim/Region/Framework
parentMerge branch 'master' into careminster-presence-refactor (diff)
downloadopensim-SC_OLD-f985775962ae8da0010cc5ef5f903a53b550f5d2.zip
opensim-SC_OLD-f985775962ae8da0010cc5ef5f903a53b550f5d2.tar.gz
opensim-SC_OLD-f985775962ae8da0010cc5ef5f903a53b550f5d2.tar.bz2
opensim-SC_OLD-f985775962ae8da0010cc5ef5f903a53b550f5d2.tar.xz
Revert "Fix for hanging on "Connecting to region".. caused by packets being processed before the presence has bound to receive events. Fixed this by adding packets to a queue and then processing them when the presence is ready."
This reverts commit 91b1d17e5bd3ff6ed006744bc529b53a67af1a64. Conflicts: OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs OpenSim/Region/Framework/Scenes/ScenePresence.cs
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs84
1 files changed, 58 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3866647..ec39df8 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -127,7 +127,7 @@ namespace OpenSim.Region.Framework.Scenes
127 127
128 private Vector3 m_avInitialPos; // used to calculate unscripted sit rotation 128 private Vector3 m_avInitialPos; // used to calculate unscripted sit rotation
129 private Vector3 m_avUnscriptedSitPos; // for non-scripted prims 129 private Vector3 m_avUnscriptedSitPos; // for non-scripted prims
130 private Vector3 m_lastPosition; 130 private Vector3 m_lastPosition;
131 private Vector3 m_lastWorldPosition; 131 private Vector3 m_lastWorldPosition;
132 private Quaternion m_lastRotation; 132 private Quaternion m_lastRotation;
133 private Vector3 m_lastVelocity; 133 private Vector3 m_lastVelocity;
@@ -766,11 +766,8 @@ namespace OpenSim.Region.Framework.Scenes
766 766
767// MIC: This gets called again in CompleteMovement 767// MIC: This gets called again in CompleteMovement
768 SendInitialFullUpdateToAllClients(); 768 SendInitialFullUpdateToAllClients();
769
769 RegisterToEvents(); 770 RegisterToEvents();
770 if (m_controllingClient != null)
771 {
772 m_controllingClient.ProcessPendingPackets();
773 }
774 SetDirectionVectors(); 771 SetDirectionVectors();
775 } 772 }
776 773
@@ -895,7 +892,11 @@ namespace OpenSim.Region.Framework.Scenes
895 892
896 m_rootRegionHandle = m_scene.RegionInfo.RegionHandle; 893 m_rootRegionHandle = m_scene.RegionInfo.RegionHandle;
897 894
895<<<<<<< HEAD
898 m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); 896 m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene);
897=======
898 m_scene.SetRootAgentScene(m_uuid);
899>>>>>>> 91b1d17... Fix for hanging on "Connecting to region".. caused by packets being processed before the presence has bound to receive events. Fixed this by adding packets to a queue and then processing them when the presence is ready.
899 900
900 // Moved this from SendInitialData to ensure that m_appearance is initialized 901 // Moved this from SendInitialData to ensure that m_appearance is initialized
901 // before the inventory is processed in MakeRootAgent. This fixes a race condition 902 // before the inventory is processed in MakeRootAgent. This fixes a race condition
@@ -911,6 +912,7 @@ namespace OpenSim.Region.Framework.Scenes
911 { 912 {
912 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.N); 913 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.N);
913 pos.Y = crossedBorder.BorderLine.Z - 1; 914 pos.Y = crossedBorder.BorderLine.Z - 1;
915<<<<<<< HEAD
914 } 916 }
915 917
916 //If they're TP'ing in or logging in, we haven't had time to add any known child regions yet. 918 //If they're TP'ing in or logging in, we haven't had time to add any known child regions yet.
@@ -927,6 +929,24 @@ namespace OpenSim.Region.Framework.Scenes
927 pos = land.LandData.UserLocation; 929 pos = land.LandData.UserLocation;
928 } 930 }
929 } 931 }
932=======
933 }
934
935 //If they're TP'ing in or logging in, we haven't had time to add any known child regions yet.
936 //This has the unfortunate consequence that if somebody is TP'ing who is already a child agent,
937 //they'll bypass the landing point. But I can't think of any decent way of fixing this.
938 if (KnownChildRegionHandles.Count == 0)
939 {
940 ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y);
941 if (land != null)
942 {
943 //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni.
944 if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && m_userLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid)
945 {
946 pos = land.LandData.UserLocation;
947 }
948 }
949>>>>>>> 91b1d17... Fix for hanging on "Connecting to region".. caused by packets being processed before the presence has bound to receive events. Fixed this by adding packets to a queue and then processing them when the presence is ready.
930 } 950 }
931 951
932 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0) 952 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
@@ -1110,8 +1130,8 @@ namespace OpenSim.Region.Framework.Scenes
1110 bool isFlying = false; 1130 bool isFlying = false;
1111 1131
1112 if (m_physicsActor != null) 1132 if (m_physicsActor != null)
1113 isFlying = m_physicsActor.Flying; 1133 isFlying = m_physicsActor.Flying;
1114 1134
1115 RemoveFromPhysicalScene(); 1135 RemoveFromPhysicalScene();
1116 Velocity = Vector3.Zero; 1136 Velocity = Vector3.Zero;
1117 AbsolutePosition = pos; 1137 AbsolutePosition = pos;
@@ -1122,7 +1142,7 @@ namespace OpenSim.Region.Framework.Scenes
1122 SetHeight(m_appearance.AvatarHeight); 1142 SetHeight(m_appearance.AvatarHeight);
1123 } 1143 }
1124 1144
1125 SendTerseUpdateToAllClients(); 1145 SendTerseUpdateToAllClients();
1126 1146
1127 } 1147 }
1128 1148
@@ -1240,6 +1260,7 @@ namespace OpenSim.Region.Framework.Scenes
1240 pos.Z = ground + 1.5f; 1260 pos.Z = ground + 1.5f;
1241 AbsolutePosition = pos; 1261 AbsolutePosition = pos;
1242 } 1262 }
1263
1243 m_isChildAgent = false; 1264 m_isChildAgent = false;
1244 bool m_flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); 1265 bool m_flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
1245 MakeRootAgent(AbsolutePosition, m_flying); 1266 MakeRootAgent(AbsolutePosition, m_flying);
@@ -1827,14 +1848,14 @@ namespace OpenSim.Region.Framework.Scenes
1827// else 1848// else
1828// { // single or child prim 1849// { // single or child prim
1829 1850
1830// } 1851// }
1831 if (part == null) //CW: Part may be gone. llDie() for example. 1852 if (part == null) //CW: Part may be gone. llDie() for example.
1832 { 1853 {
1833 partRot = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f); 1854 partRot = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
1834 } 1855 }
1835 else 1856 else
1836 { 1857 {
1837 partRot = part.GetWorldRotation(); 1858 partRot = part.GetWorldRotation();
1838 } 1859 }
1839 1860
1840 Quaternion partIRot = Quaternion.Inverse(partRot); 1861 Quaternion partIRot = Quaternion.Inverse(partRot);
@@ -1842,6 +1863,7 @@ namespace OpenSim.Region.Framework.Scenes
1842 Quaternion avatarRot = Quaternion.Inverse(Quaternion.Inverse(Rotation) * partIRot); // world or. of the av 1863 Quaternion avatarRot = Quaternion.Inverse(Quaternion.Inverse(Rotation) * partIRot); // world or. of the av
1843 Vector3 avStandUp = new Vector3(1.0f, 0f, 0f) * avatarRot; // 1M infront of av 1864 Vector3 avStandUp = new Vector3(1.0f, 0f, 0f) * avatarRot; // 1M infront of av
1844 1865
1866<<<<<<< HEAD
1845 1867
1846 if (m_physicsActor == null) 1868 if (m_physicsActor == null)
1847 { 1869 {
@@ -1854,11 +1876,24 @@ namespace OpenSim.Region.Framework.Scenes
1854 AbsolutePosition = avWorldStandUp; //KF: Fix stand up. 1876 AbsolutePosition = avWorldStandUp; //KF: Fix stand up.
1855 part.IsOccupied = false; 1877 part.IsOccupied = false;
1856 part.ParentGroup.DeleteAvatar(ControllingClient.AgentId); 1878 part.ParentGroup.DeleteAvatar(ControllingClient.AgentId);
1879=======
1880
1881 if (m_physicsActor == null)
1882 {
1883 AddToPhysicalScene(false);
1884>>>>>>> 91b1d17... Fix for hanging on "Connecting to region".. caused by packets being processed before the presence has bound to receive events. Fixed this by adding packets to a queue and then processing them when the presence is ready.
1857 } 1885 }
1858 else 1886 //CW: If the part isn't null then we can set the current position
1859 { 1887 if (part != null)
1860 //CW: Since the part doesn't exist, a coarse standup position isn't an issue 1888 {
1861 AbsolutePosition = m_lastWorldPosition; 1889 Vector3 avWorldStandUp = avStandUp + part.GetWorldPosition() + (m_pos * partRot); // + av sit offset!
1890 AbsolutePosition = avWorldStandUp; //KF: Fix stand up.
1891 part.IsOccupied = false;
1892 }
1893 else
1894 {
1895 //CW: Since the part doesn't exist, a coarse standup position isn't an issue
1896 AbsolutePosition = m_lastWorldPosition;
1862 } 1897 }
1863 1898
1864 m_parentPosition = Vector3.Zero; 1899 m_parentPosition = Vector3.Zero;
@@ -2022,7 +2057,7 @@ namespace OpenSim.Region.Framework.Scenes
2022// if (Util.GetDistanceTo(AbsolutePosition, autopilotTarget) < 4.5) 2057// if (Util.GetDistanceTo(AbsolutePosition, autopilotTarget) < 4.5)
2023 if( (Math.Abs(AbsolutePosition.X - autopilotTarget.X) < 256.0f) && (Math.Abs(AbsolutePosition.Y - autopilotTarget.Y) < 256.0f) ) 2058 if( (Math.Abs(AbsolutePosition.X - autopilotTarget.X) < 256.0f) && (Math.Abs(AbsolutePosition.Y - autopilotTarget.Y) < 256.0f) )
2024 { 2059 {
2025 autopilot = false; // close enough 2060 autopilot = false; // close enough
2026 m_lastWorldPosition = m_pos; /* CW - This give us a position to return the avatar to if the part is killed before standup. 2061 m_lastWorldPosition = m_pos; /* CW - This give us a position to return the avatar to if the part is killed before standup.
2027 Not using the part's position because returning the AV to the last known standing 2062 Not using the part's position because returning the AV to the last known standing
2028 position is likely to be more friendly, isn't it? */ 2063 position is likely to be more friendly, isn't it? */
@@ -2032,7 +2067,7 @@ namespace OpenSim.Region.Framework.Scenes
2032 } // else the autopilot will get us close 2067 } // else the autopilot will get us close
2033 } 2068 }
2034 else 2069 else
2035 { // its a scripted sit 2070 { // its a scripted sit
2036 m_lastWorldPosition = part.AbsolutePosition; /* CW - This give us a position to return the avatar to if the part is killed before standup. 2071 m_lastWorldPosition = part.AbsolutePosition; /* CW - This give us a position to return the avatar to if the part is killed before standup.
2037 I *am* using the part's position this time because we have no real idea how far away 2072 I *am* using the part's position this time because we have no real idea how far away
2038 the avatar is from the sit target. */ 2073 the avatar is from the sit target. */
@@ -3993,10 +4028,7 @@ if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for ju
3993 m_scene = scene; 4028 m_scene = scene;
3994 4029
3995 RegisterToEvents(); 4030 RegisterToEvents();
3996 if (m_controllingClient != null) 4031
3997 {
3998 m_controllingClient.ProcessPendingPackets();
3999 }
4000 /* 4032 /*
4001 AbsolutePosition = client.StartPos; 4033 AbsolutePosition = client.StartPos;
4002 4034