aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs42
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs84
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs4
5 files changed, 63 insertions, 75 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 4c9011a..7e9a82a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -342,7 +342,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
342 private AgentUpdateArgs lastarg; 342 private AgentUpdateArgs lastarg;
343 private bool m_IsActive = true; 343 private bool m_IsActive = true;
344 private bool m_IsLoggingOut = false; 344 private bool m_IsLoggingOut = false;
345 private bool m_IsPresenceReady = false;
346 345
347 protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); 346 protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>();
348 protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers 347 protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers
@@ -365,7 +364,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
365 364
366 private Timer m_propertiesPacketTimer; 365 private Timer m_propertiesPacketTimer;
367 private List<ObjectPropertiesPacket.ObjectDataBlock> m_propertiesBlocks = new List<ObjectPropertiesPacket.ObjectDataBlock>(); 366 private List<ObjectPropertiesPacket.ObjectDataBlock> m_propertiesBlocks = new List<ObjectPropertiesPacket.ObjectDataBlock>();
368 private List<Packet> m_pendingPackets;
369 367
370 #endregion Class Members 368 #endregion Class Members
371 369
@@ -418,7 +416,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
418 get { return m_IsActive; } 416 get { return m_IsActive; }
419 set { m_IsActive = value; } 417 set { m_IsActive = value; }
420 } 418 }
421
422 public bool IsLoggingOut 419 public bool IsLoggingOut
423 { 420 {
424 get { return m_IsLoggingOut; } 421 get { return m_IsLoggingOut; }
@@ -11355,47 +11352,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11355 } 11352 }
11356 11353
11357 /// <summary> 11354 /// <summary>
11358 /// This processes packets which have accumulated while the presence was still in the process of initialising.
11359 /// </summary>
11360 public void ProcessPendingPackets()
11361 {
11362 m_IsPresenceReady = true;
11363 if (m_pendingPackets == null)
11364 return;
11365 foreach (Packet p in m_pendingPackets)
11366 {
11367 ProcessInPacket(p);
11368 }
11369 m_pendingPackets.Clear();
11370 }
11371
11372 /// <summary>
11373 /// Entryway from the client to the simulator. All UDP packets from the client will end up here 11355 /// Entryway from the client to the simulator. All UDP packets from the client will end up here
11374 /// </summary> 11356 /// </summary>
11375 /// <param name="Pack">OpenMetaverse.packet</param> 11357 /// <param name="Pack">OpenMetaverse.packet</param>
11376 public void ProcessInPacket(Packet packet) 11358 public void ProcessInPacket(Packet packet)
11377 { 11359 {
11378 if (m_debugPacketLevel > 0) 11360 if (m_debugPacketLevel >= 255)
11379 { 11361 m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
11380 bool outputPacket = true;
11381
11382 if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate)
11383 outputPacket = false;
11384
11385 if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage)
11386 outputPacket = false;
11387
11388 if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
11389 outputPacket = false;
11390
11391 if (outputPacket)
11392 m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type);
11393 }
11394 11362
11395 if (!ProcessPacketMethod(packet)) 11363 if (!ProcessPacketMethod(Pack))
11396 m_log.Warn("[CLIENT]: unhandled packet " + packet.Type); 11364 m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
11397 11365
11398 PacketPool.Instance.ReturnPacket(packet); 11366 PacketPool.Instance.ReturnPacket(Pack);
11399 } 11367 }
11400 11368
11401 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) 11369 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 09f615f..7441a60 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -821,10 +821,6 @@ namespace OpenSim.Region.Examples.SimpleModule
821 { 821 {
822 } 822 }
823 823
824 public void ProcessPendingPackets()
825 {
826 }
827
828 public void ProcessInPacket(Packet NewPack) 824 public void ProcessInPacket(Packet NewPack)
829 { 825 {
830 } 826 }
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
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 96c3d8e..276e46d 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -877,10 +877,6 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
877 877
878 } 878 }
879 879
880 public void ProcessPendingPackets()
881 {
882 }
883
884 public void ProcessInPacket(Packet NewPack) 880 public void ProcessInPacket(Packet NewPack)
885 { 881 {
886 882
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 737ca1b..39c3364 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -836,10 +836,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
836 { 836 {
837 } 837 }
838 838
839 public void ProcessPendingPackets()
840 {
841 }
842
843 public void ProcessInPacket(Packet NewPack) 839 public void ProcessInPacket(Packet NewPack)
844 { 840 {
845 } 841 }