aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IClientAPI.cs17
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs239
-rwxr-xr-xOpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs9
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs19
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs35
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs66
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs399
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs4
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs4
12 files changed, 499 insertions, 315 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 0c5224b..5a5e5d0 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -602,16 +602,26 @@ namespace OpenSim.Framework
602 { 602 {
603 // we are on the new one 603 // we are on the new one
604 if (m_flags.HasFlag(PrimUpdateFlags.CancelKill)) 604 if (m_flags.HasFlag(PrimUpdateFlags.CancelKill))
605 m_flags = PrimUpdateFlags.FullUpdatewithAnim; 605 {
606 if (m_flags.HasFlag(PrimUpdateFlags.UpdateProbe))
607 m_flags = PrimUpdateFlags.UpdateProbe;
608 else
609 m_flags = PrimUpdateFlags.FullUpdatewithAnim;
610 }
606 } 611 }
607 612
608 public virtual void Update(EntityUpdate oldupdate) 613 public virtual void Update(EntityUpdate oldupdate)
609 { 614 {
610 // we are on the new one 615 // we are on the new one
611 PrimUpdateFlags updateFlags = oldupdate.Flags; 616 PrimUpdateFlags updateFlags = oldupdate.Flags;
617 if (updateFlags.HasFlag(PrimUpdateFlags.UpdateProbe))
618 updateFlags &= ~PrimUpdateFlags.UpdateProbe;
612 if (m_flags.HasFlag(PrimUpdateFlags.CancelKill)) 619 if (m_flags.HasFlag(PrimUpdateFlags.CancelKill))
613 { 620 {
614 m_flags = PrimUpdateFlags.FullUpdatewithAnim; 621 if(m_flags.HasFlag(PrimUpdateFlags.UpdateProbe))
622 m_flags = PrimUpdateFlags.UpdateProbe;
623 else
624 m_flags = PrimUpdateFlags.FullUpdatewithAnim;
615 } 625 }
616 else 626 else
617 m_flags |= updateFlags; 627 m_flags |= updateFlags;
@@ -679,6 +689,7 @@ namespace OpenSim.Framework
679 689
680 FullUpdatewithAnim = FullUpdate | Animations, 690 FullUpdatewithAnim = FullUpdate | Animations,
681 691
692 UpdateProbe = 0x10000000, // 1 << 28
682 SendInTransit = 0x20000000, // 1 << 29 693 SendInTransit = 0x20000000, // 1 << 29
683 CancelKill = 0x40000000, // 1 << 30 694 CancelKill = 0x40000000, // 1 << 30
684 Kill = 0x80000000 // 1 << 31 695 Kill = 0x80000000 // 1 << 31
@@ -805,7 +816,7 @@ namespace OpenSim.Framework
805 event TeleportCancel OnTeleportCancel; 816 event TeleportCancel OnTeleportCancel;
806 event DeRezObject OnDeRezObject; 817 event DeRezObject OnDeRezObject;
807 event RezRestoreToWorld OnRezRestoreToWorld; 818 event RezRestoreToWorld OnRezRestoreToWorld;
808 event Action<IClientAPI> OnRegionHandShakeReply; 819 event Action<IClientAPI, uint> OnRegionHandShakeReply;
809 event GenericCall1 OnRequestWearables; 820 event GenericCall1 OnRequestWearables;
810 event Action<IClientAPI, bool> OnCompleteMovementToRegion; 821 event Action<IClientAPI, bool> OnCompleteMovementToRegion;
811 822
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 662e5ad..526783e 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
80 public event DeRezObject OnDeRezObject; 80 public event DeRezObject OnDeRezObject;
81 public event RezRestoreToWorld OnRezRestoreToWorld; 81 public event RezRestoreToWorld OnRezRestoreToWorld;
82 public event ModifyTerrain OnModifyTerrain; 82 public event ModifyTerrain OnModifyTerrain;
83 public event Action<IClientAPI> OnRegionHandShakeReply; 83 public event Action<IClientAPI, uint> OnRegionHandShakeReply;
84 public event GenericCall1 OnRequestWearables; 84 public event GenericCall1 OnRequestWearables;
85 public event SetAppearance OnSetAppearance; 85 public event SetAppearance OnSetAppearance;
86 public event AvatarNowWearing OnAvatarNowWearing; 86 public event AvatarNowWearing OnAvatarNowWearing;
@@ -392,6 +392,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
392 392
393 protected IAssetService m_assetService; 393 protected IAssetService m_assetService;
394 394
395 protected bool m_supportViewerCache = false;
395 #endregion Class Members 396 #endregion Class Members
396 397
397 #region Properties 398 #region Properties
@@ -552,6 +553,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
552 string name = string.Format("AsyncInUDP-{0}",m_agentId.ToString()); 553 string name = string.Format("AsyncInUDP-{0}",m_agentId.ToString());
553 m_asyncPacketProcess = new JobEngine(name, name, 10000); 554 m_asyncPacketProcess = new JobEngine(name, name, 10000);
554 IsActive = true; 555 IsActive = true;
556
557 m_supportViewerCache = m_udpServer.SupportViewerObjectsCache;
555 } 558 }
556 559
557 #region Client Methods 560 #region Client Methods
@@ -4777,6 +4780,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4777 13 // ID (high frequency) 4780 13 // ID (high frequency)
4778 }; 4781 };
4779 4782
4783 static private readonly byte[] ObjectUpdateCachedHeader = new byte[] {
4784 Helpers.MSG_RELIABLE,
4785 0, 0, 0, 0, // sequence number
4786 0, // extra
4787 14 // ID (high frequency)
4788 };
4789
4780 private void ProcessEntityUpdates(int maxUpdatesBytes) 4790 private void ProcessEntityUpdates(int maxUpdatesBytes)
4781 { 4791 {
4782 if (!IsActive) 4792 if (!IsActive)
@@ -4786,8 +4796,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4786 if (mysp == null) 4796 if (mysp == null)
4787 return; 4797 return;
4788 4798
4799
4789 List<EntityUpdate> objectUpdates = null; 4800 List<EntityUpdate> objectUpdates = null;
4790 //List<EntityUpdate> compressedUpdates = null; 4801 List<EntityUpdate> objectUpdateProbes = null;
4802 List<EntityUpdate> compressedUpdates = null;
4791 List<EntityUpdate> terseUpdates = null; 4803 List<EntityUpdate> terseUpdates = null;
4792 List<SceneObjectPart> ObjectAnimationUpdates = null; 4804 List<SceneObjectPart> ObjectAnimationUpdates = null;
4793 4805
@@ -4799,6 +4811,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4799 4811
4800 EntityUpdate update; 4812 EntityUpdate update;
4801 4813
4814 bool viewerCache = m_supportViewerCache && (m_viewerHandShakeFlags & 1) != 0 && mysp.IsChildAgent; // only on child agents
4802 bool doCulling = m_scene.ObjectsCullingByDistance; 4815 bool doCulling = m_scene.ObjectsCullingByDistance;
4803 float cullingrange = 64.0f; 4816 float cullingrange = 64.0f;
4804 Vector3 mypos = Vector3.Zero; 4817 Vector3 mypos = Vector3.Zero;
@@ -4807,7 +4820,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4807 bool orderedDequeue = false; // temporary off 4820 bool orderedDequeue = false; // temporary off
4808 4821
4809 HashSet<SceneObjectGroup> GroupsNeedFullUpdate = new HashSet<SceneObjectGroup>(); 4822 HashSet<SceneObjectGroup> GroupsNeedFullUpdate = new HashSet<SceneObjectGroup>();
4810 4823 bool useCompressUpdate = false;
4811 4824
4812 if (doCulling) 4825 if (doCulling)
4813 { 4826 {
@@ -4834,15 +4847,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4834 } 4847 }
4835 } 4848 }
4836 4849
4837 PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags; 4850 PrimUpdateFlags updateFlags = update.Flags;
4838 4851
4839 if(updateFlags.HasFlag(PrimUpdateFlags.Kill)) 4852 if (updateFlags.HasFlag(PrimUpdateFlags.Kill))
4840 { 4853 {
4841 m_killRecord.Add(update.Entity.LocalId); 4854 m_killRecord.Add(update.Entity.LocalId);
4842 maxUpdatesBytes -= 30; 4855 maxUpdatesBytes -= 30;
4843 continue; 4856 continue;
4844 } 4857 }
4845 4858
4859 useCompressUpdate = false;
4860
4846 if (update.Entity is SceneObjectPart) 4861 if (update.Entity is SceneObjectPart)
4847 { 4862 {
4848 SceneObjectPart part = (SceneObjectPart)update.Entity; 4863 SceneObjectPart part = (SceneObjectPart)update.Entity;
@@ -4928,10 +4943,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4928 if (dpos > maxview * maxview) 4943 if (dpos > maxview * maxview)
4929 continue; 4944 continue;
4930 4945
4931 GroupsNeedFullUpdate.Add(grp); 4946 if (!viewerCache || !updateFlags.HasFlag(PrimUpdateFlags.UpdateProbe))
4932 continue; 4947 {
4948 GroupsNeedFullUpdate.Add(grp);
4949 continue;
4950 }
4951 }
4952 }
4953
4954 if (updateFlags.HasFlag(PrimUpdateFlags.UpdateProbe))
4955 {
4956 if (objectUpdateProbes == null)
4957 {
4958 objectUpdateProbes = new List<EntityUpdate>();
4959 maxUpdatesBytes -= 18;
4960 }
4961 objectUpdateProbes.Add(update);
4962 maxUpdatesBytes -= 12;
4963 continue;
4964 }
4965
4966 if (m_SupportObjectAnimations && updateFlags.HasFlag(PrimUpdateFlags.Animations))
4967 {
4968 if (part.Animations != null)
4969 {
4970 if (ObjectAnimationUpdates == null)
4971 ObjectAnimationUpdates = new List<SceneObjectPart>();
4972 ObjectAnimationUpdates.Add(part);
4973 maxUpdatesBytes -= 20 * part.Animations.Count + 24;
4933 } 4974 }
4934 } 4975 }
4976 if(viewerCache)
4977 useCompressUpdate = grp.IsViewerCachable;
4935 } 4978 }
4936 else if (update.Entity is ScenePresence) 4979 else if (update.Entity is ScenePresence)
4937 { 4980 {
@@ -4951,27 +4994,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4951 4994
4952 #region UpdateFlags to packet type conversion 4995 #region UpdateFlags to packet type conversion
4953 4996
4954 // bool canUseCompressed = true;
4955
4956 if (update.Entity is SceneObjectPart)
4957 {
4958 if (m_SupportObjectAnimations && updateFlags.HasFlag(PrimUpdateFlags.Animations))
4959 {
4960 SceneObjectPart sop = (SceneObjectPart)update.Entity;
4961 if ( sop.Animations != null)
4962 {
4963 if(ObjectAnimationUpdates == null)
4964 ObjectAnimationUpdates = new List<SceneObjectPart>();
4965 ObjectAnimationUpdates.Add(sop);
4966 maxUpdatesBytes -= 20 * sop.Animations.Count + 24;
4967 }
4968 }
4969 }
4970 else
4971 {
4972 // canUseCompressed = false;
4973 }
4974
4975 updateFlags &= PrimUpdateFlags.FullUpdate; // clear other control bits already handled 4997 updateFlags &= PrimUpdateFlags.FullUpdate; // clear other control bits already handled
4976 if(updateFlags == PrimUpdateFlags.None) 4998 if(updateFlags == PrimUpdateFlags.None)
4977 continue; 4999 continue;
@@ -5025,34 +5047,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5025 } 5047 }
5026 else 5048 else
5027 { 5049 {
5028 SceneObjectPart part = (SceneObjectPart)update.Entity; 5050 if (useCompressUpdate)
5029 SceneObjectGroup grp = part.ParentGroup;
5030 // minimal compress conditions, not enough ?
5031 //if (grp.UsesPhysics || part.Velocity.LengthSquared() > 1e-8f || part.Acceleration.LengthSquared() > 1e-6f)
5032 { 5051 {
5033 maxUpdatesBytes -= 150; // crude estimation 5052 maxUpdatesBytes -= 150; // crude estimation
5034 5053
5035 if (objectUpdates == null) 5054 if (compressedUpdates == null)
5036 { 5055 {
5037 objectUpdates = new List<EntityUpdate>(); 5056 compressedUpdates = new List<EntityUpdate>();
5038 maxUpdatesBytes -= 18; 5057 maxUpdatesBytes -= 18;
5039 } 5058 }
5040 objectUpdates.Add(update); 5059 compressedUpdates.Add(update);
5041 } 5060 }
5042 //compress still disabled
5043 /*
5044 else 5061 else
5045 { 5062 {
5046 maxUpdatesBytes -= 150; // crude estimation 5063 maxUpdatesBytes -= 150; // crude estimation
5047 5064
5048 if (compressedUpdates == null) 5065 if (objectUpdates == null)
5049 { 5066 {
5050 compressedUpdates = new List<EntityUpdate>(); 5067 objectUpdates = new List<EntityUpdate>();
5051 maxUpdatesBytes -= 18; 5068 maxUpdatesBytes -= 18;
5052 } 5069 }
5053 compressedUpdates.Add(update); 5070 objectUpdates.Add(update);
5054 } 5071 }
5055 */
5056 } 5072 }
5057 } 5073 }
5058 5074
@@ -5147,7 +5163,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5147 delegate (OutgoingPacket oPacket) { ResendPrimUpdates(tau, oPacket); }, false, false); 5163 delegate (OutgoingPacket oPacket) { ResendPrimUpdates(tau, oPacket); }, false, false);
5148 } 5164 }
5149 } 5165 }
5150 /* 5166
5151 if(compressedUpdates != null) 5167 if(compressedUpdates != null)
5152 { 5168 {
5153 List<EntityUpdate> tau = new List<EntityUpdate>(30); 5169 List<EntityUpdate> tau = new List<EntityUpdate>(30);
@@ -5168,8 +5184,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5168 int count = 0; 5184 int count = 0;
5169 foreach (EntityUpdate eu in compressedUpdates) 5185 foreach (EntityUpdate eu in compressedUpdates)
5170 { 5186 {
5187 SceneObjectPart sop = (SceneObjectPart)eu.Entity;
5188 if (sop.ParentGroup == null || sop.ParentGroup.IsDeleted)
5189 continue;
5171 lastpos = pos; 5190 lastpos = pos;
5172 CreateCompressedUpdateBlock((SceneObjectPart)eu.Entity, mysp, data, ref pos); 5191 CreateCompressedUpdateBlock(sop, mysp, data, ref pos);
5173 if (pos < LLUDPServer.MAXPAYLOAD) 5192 if (pos < LLUDPServer.MAXPAYLOAD)
5174 { 5193 {
5175 tau.Add(eu); 5194 tau.Add(eu);
@@ -5207,7 +5226,68 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5207 delegate (OutgoingPacket oPacket) { ResendPrimUpdates(tau, oPacket); }, false, false); 5226 delegate (OutgoingPacket oPacket) { ResendPrimUpdates(tau, oPacket); }, false, false);
5208 } 5227 }
5209 } 5228 }
5210 */ 5229
5230 if (objectUpdateProbes != null)
5231 {
5232 UDPPacketBuffer buf = m_udpServer.GetNewUDPBuffer(m_udpClient.RemoteEndPoint);
5233 byte[] data = buf.Data;
5234
5235 Buffer.BlockCopy(ObjectUpdateCachedHeader, 0, data, 0, 7);
5236
5237 Utils.UInt64ToBytesSafepos(m_scene.RegionInfo.RegionHandle, data, 7); // 15
5238 Utils.UInt16ToBytes(timeDilation, data, 15); // 17
5239
5240 int countposition = 17; // blocks count position
5241 int pos = 18;
5242
5243 int count = 0;
5244 foreach (EntityUpdate eu in objectUpdateProbes)
5245 {
5246 SceneObjectPart sop = (SceneObjectPart)eu.Entity;
5247 if (sop.ParentGroup == null || sop.ParentGroup.IsDeleted)
5248 continue;
5249 uint primflags = m_scene.Permissions.GenerateClientFlags(sop, mysp);
5250 if (mysp.UUID != sop.OwnerID)
5251 primflags &= ~(uint)PrimFlags.CreateSelected;
5252 else
5253 {
5254 if (sop.CreateSelected)
5255 primflags |= (uint)PrimFlags.CreateSelected;
5256 else
5257 primflags &= ~(uint)PrimFlags.CreateSelected;
5258 }
5259
5260 Utils.UIntToBytes(sop.LocalId, data, pos); pos += 4;
5261 Utils.UIntToBytes((uint)sop.ParentGroup.PseudoCRC, data, pos); pos += 4; //WRONG
5262 Utils.UIntToBytes(primflags, data, pos); pos += 4;
5263
5264 if (pos < (LLUDPServer.MAXPAYLOAD - 12))
5265 ++count;
5266 else
5267 {
5268 // we need more packets
5269 UDPPacketBuffer newbuf = m_udpServer.GetNewUDPBuffer(m_udpClient.RemoteEndPoint);
5270 Buffer.BlockCopy(buf.Data, 0, newbuf.Data, 0, countposition); // start is the same
5271
5272 buf.Data[countposition] = (byte)count;
5273 buf.DataLength = pos;
5274 m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task, null, false, false);
5275
5276 buf = newbuf;
5277 data = buf.Data;
5278 pos = 18;
5279 count = 0;
5280 }
5281 }
5282
5283 if (count > 0)
5284 {
5285 buf.Data[countposition] = (byte)count;
5286 buf.DataLength = pos;
5287 m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task, null, false, false);
5288 }
5289 }
5290
5211 if (terseUpdates != null) 5291 if (terseUpdates != null)
5212 { 5292 {
5213 int blocks = terseUpdates.Count; 5293 int blocks = terseUpdates.Count;
@@ -5329,8 +5409,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5329 { 5409 {
5330 lock (GroupsInView) 5410 lock (GroupsInView)
5331 GroupsInView.Add(grp); 5411 GroupsInView.Add(grp);
5412 PrimUpdateFlags flags = PrimUpdateFlags.CancelKill;
5413 if(viewerCache && grp.IsViewerCachable)
5414 flags |= PrimUpdateFlags.UpdateProbe;
5332 foreach (SceneObjectPart p in grp.Parts) 5415 foreach (SceneObjectPart p in grp.Parts)
5333 SendEntityUpdate(p, PrimUpdateFlags.CancelKill); 5416 SendEntityUpdate(p, flags);
5334 } 5417 }
5335 } 5418 }
5336 5419
@@ -5461,10 +5544,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5461 5544
5462 if(GroupsNeedFullUpdate.Count > 0) 5545 if(GroupsNeedFullUpdate.Count > 0)
5463 { 5546 {
5464 foreach(SceneObjectGroup grp in GroupsNeedFullUpdate) 5547 bool viewerCache = m_supportViewerCache && (m_viewerHandShakeFlags & 1) != 0 && mysp.IsChildAgent;
5548 foreach (SceneObjectGroup grp in GroupsNeedFullUpdate)
5465 { 5549 {
5466 foreach(SceneObjectPart p in grp.Parts) 5550 PrimUpdateFlags flags = PrimUpdateFlags.CancelKill;
5467 SendEntityUpdate(p, PrimUpdateFlags.CancelKill); 5551 if (viewerCache && grp.IsViewerCachable)
5552 flags |= PrimUpdateFlags.UpdateProbe;
5553 foreach (SceneObjectPart p in grp.Parts)
5554 SendEntityUpdate(p, flags);
5468 } 5555 }
5469 } 5556 }
5470 5557
@@ -7173,7 +7260,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7173 dest[pos++] = state; 7260 dest[pos++] = state;
7174 7261
7175 ///**** temp hack 7262 ///**** temp hack
7176 Utils.UIntToBytesSafepos((uint)rnd.Next(), dest, pos); pos += 4; //CRC needs fix or things will get crazy for now avoid caching 7263 Utils.UIntToBytesSafepos((uint)part.ParentGroup.PseudoCRC, dest, pos); pos += 4;
7177 dest[pos++] = part.Material; 7264 dest[pos++] = part.Material;
7178 dest[pos++] = part.ClickAction; 7265 dest[pos++] = part.ClickAction;
7179 part.Shape.Scale.ToBytes(dest, pos); pos += 12; 7266 part.Shape.Scale.ToBytes(dest, pos); pos += 12;
@@ -8407,13 +8494,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8407 return true; 8494 return true;
8408 } 8495 }
8409 8496
8497 public uint m_viewerHandShakeFlags = 0;
8498
8410 private bool HandlerRegionHandshakeReply(IClientAPI sender, Packet Pack) 8499 private bool HandlerRegionHandshakeReply(IClientAPI sender, Packet Pack)
8411 { 8500 {
8412 Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply; 8501 Action<IClientAPI, uint> handlerRegionHandShakeReply = OnRegionHandShakeReply;
8413 if (handlerRegionHandShakeReply != null) 8502 if (handlerRegionHandShakeReply == null)
8414 { 8503 return true; // silence the warning
8415 handlerRegionHandShakeReply(this); 8504
8416 } 8505 RegionHandshakeReplyPacket rsrpkt = (RegionHandshakeReplyPacket)Pack;
8506 if(rsrpkt.AgentData.AgentID != m_agentId || rsrpkt.AgentData.SessionID != m_sessionId)
8507 return false;
8508
8509 // regionHandSHake is a protocol message, but it is also seems to be the only way to update terrain textures
8510 // in last case this should be ignored.
8511 OnRegionHandShakeReply = null;
8512 if(m_supportViewerCache)
8513 m_viewerHandShakeFlags = rsrpkt.RegionInfo.Flags;
8514 else
8515 m_viewerHandShakeFlags = 0;
8516
8517 handlerRegionHandShakeReply(this, m_viewerHandShakeFlags);
8417 8518
8418 return true; 8519 return true;
8419 } 8520 }
@@ -8657,19 +8758,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8657 return true; 8758 return true;
8658 } 8759 }
8659 8760
8660 private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack) 8761 private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack)
8661 { 8762 {
8662 m_log.DebugFormat("[LLClientView] HandleCompleteAgentMovement"); 8763 //m_log.DebugFormat("[LLClientView] HandleCompleteAgentMovement");
8663 8764
8664 Action<IClientAPI, bool> handlerCompleteMovementToRegion = OnCompleteMovementToRegion; 8765 Action<IClientAPI, bool> handlerCompleteMovementToRegion = OnCompleteMovementToRegion;
8665 if (handlerCompleteMovementToRegion != null) 8766 if (handlerCompleteMovementToRegion == null)
8666 { 8767 return false;
8667 handlerCompleteMovementToRegion(sender, true); 8768
8668 } 8769 CompleteAgentMovementPacket cmp = (CompleteAgentMovementPacket)Pack;
8669 else 8770 if(cmp.AgentData.AgentID != m_agentId || cmp.AgentData.SessionID != m_sessionId || cmp.AgentData.CircuitCode != m_circuitCode)
8670 m_log.Debug("HandleCompleteAgentMovement NULL handler"); 8771 return false;
8671 8772
8672 handlerCompleteMovementToRegion = null; 8773 handlerCompleteMovementToRegion(sender, true);
8673 8774
8674 return true; 8775 return true;
8675 } 8776 }
@@ -9141,6 +9242,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9141 9242
9142 private bool HandleRequestMultipleObjects(IClientAPI sender, Packet Pack) 9243 private bool HandleRequestMultipleObjects(IClientAPI sender, Packet Pack)
9143 { 9244 {
9245 ObjectRequest handlerObjectRequest = OnObjectRequest;
9246 if (handlerObjectRequest == null)
9247 return false;
9248
9144 RequestMultipleObjectsPacket incomingRequest = (RequestMultipleObjectsPacket)Pack; 9249 RequestMultipleObjectsPacket incomingRequest = (RequestMultipleObjectsPacket)Pack;
9145 9250
9146 #region Packet Session and User Check 9251 #region Packet Session and User Check
@@ -9149,16 +9254,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9149 return true; 9254 return true;
9150 #endregion 9255 #endregion
9151 9256
9152 ObjectRequest handlerObjectRequest = null;
9153
9154 for (int i = 0; i < incomingRequest.ObjectData.Length; i++) 9257 for (int i = 0; i < incomingRequest.ObjectData.Length; i++)
9155 {
9156 handlerObjectRequest = OnObjectRequest;
9157 if (handlerObjectRequest != null)
9158 {
9159 handlerObjectRequest(incomingRequest.ObjectData[i].ID, this); 9258 handlerObjectRequest(incomingRequest.ObjectData[i].ID, this);
9160 }
9161 }
9162 return true; 9259 return true;
9163 } 9260 }
9164 9261
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index a0b3d21..6032681 100755
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -369,6 +369,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
369 /// </summary> 369 /// </summary>
370 public int IncomingOrphanedPacketCount { get; protected set; } 370 public int IncomingOrphanedPacketCount { get; protected set; }
371 371
372 public bool SupportViewerObjectsCache = false;
372 /// <summary> 373 /// <summary>
373 /// Run queue empty processing within a single persistent thread. 374 /// Run queue empty processing within a single persistent thread.
374 /// </summary> 375 /// </summary>
@@ -433,6 +434,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
433 m_disableFacelights = config.GetBoolean("DisableFacelights", false); 434 m_disableFacelights = config.GetBoolean("DisableFacelights", false);
434 m_ackTimeout = 1000 * config.GetInt("AckTimeout", 60); 435 m_ackTimeout = 1000 * config.GetInt("AckTimeout", 60);
435 m_pausedAckTimeout = 1000 * config.GetInt("PausedAckTimeout", 300); 436 m_pausedAckTimeout = 1000 * config.GetInt("PausedAckTimeout", 300);
437 SupportViewerObjectsCache = config.GetBoolean("SupportViewerObjectsCache", SupportViewerObjectsCache);
436 } 438 }
437 else 439 else
438 { 440 {
@@ -1724,14 +1726,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1724 if (client != null) 1726 if (client != null)
1725 { 1727 {
1726 client.SendRegionHandshake(); 1728 client.SendRegionHandshake();
1727
1728 client.CheckViewerCaps(); 1729 client.CheckViewerCaps();
1729
1730 // We only want to send initial data to new clients, not ones which are being converted from child to root.
1731 bool tp = (aCircuit.teleportFlags > 0);
1732 // Let's delay this for TP agents, otherwise the viewer doesn't know where to get resources from
1733 if (!tp)
1734 client.SceneAgent.SendInitialDataToMe();
1735 } 1730 }
1736 } 1731 }
1737 else 1732 else
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index fd08721..936f956 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -574,7 +574,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
574 Scene.RegionInfo.RegionSettings.Save(); 574 Scene.RegionInfo.RegionSettings.Save();
575 TriggerRegionInfoChange(); 575 TriggerRegionInfoChange();
576 sendRegionHandshakeToAll(); 576 sendRegionHandshakeToAll();
577 sendRegionInfoPacketToAll(); 577// sendRegionInfoPacketToAll();
578 } 578 }
579 579
580 private void handleCommitEstateTerrainTextureRequest(IClientAPI remoteClient) 580 private void handleCommitEstateTerrainTextureRequest(IClientAPI remoteClient)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 0c080d2..2995091 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -153,10 +153,23 @@ namespace OpenSim.Region.Framework.Scenes
153 /// <param name="remoteClient"></param> 153 /// <param name="remoteClient"></param>
154 public void RequestPrim(uint primLocalID, IClientAPI remoteClient) 154 public void RequestPrim(uint primLocalID, IClientAPI remoteClient)
155 { 155 {
156 SceneObjectGroup sog = GetGroupByPrim(primLocalID); 156 SceneObjectPart part = GetSceneObjectPart(primLocalID);
157 if (part != null)
158 {
159 SceneObjectGroup sog = part.ParentGroup;
160 if(!sog.IsDeleted)
161 {
162 PrimUpdateFlags update = PrimUpdateFlags.FullUpdate;
163 if (sog.RootPart.Shape.MeshFlagEntry)
164 update = PrimUpdateFlags.FullUpdatewithAnim;
165 part.SendUpdate(remoteClient, update);
166 }
167 }
168
169 //SceneObjectGroup sog = GetGroupByPrim(primLocalID);
157 170
158 if (sog != null) 171 //if (sog != null)
159 sog.SendFullAnimUpdateToClient(remoteClient); 172 //sog.SendFullAnimUpdateToClient(remoteClient);
160 } 173 }
161 174
162 /// <summary> 175 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 7668a87..7d312e9 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -170,8 +170,6 @@ namespace OpenSim.Region.Framework.Scenes
170 } 170 }
171 private bool m_scripts_enabled; 171 private bool m_scripts_enabled;
172 172
173 public SynchronizeSceneHandler SynchronizeScene;
174
175 public bool ClampNegativeZ 173 public bool ClampNegativeZ
176 { 174 {
177 get { return m_clampNegativeZ; } 175 get { return m_clampNegativeZ; }
@@ -1006,11 +1004,9 @@ namespace OpenSim.Region.Framework.Scenes
1006 m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete); 1004 m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete);
1007 m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries); 1005 m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
1008 m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings); 1006 m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);
1009 m_dontPersistBefore = 1007 m_dontPersistBefore = startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE);
1010 startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE);
1011 m_dontPersistBefore *= 10000000; 1008 m_dontPersistBefore *= 10000000;
1012 m_persistAfter = 1009 m_persistAfter = startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE);
1013 startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE);
1014 m_persistAfter *= 10000000; 1010 m_persistAfter *= 10000000;
1015 1011
1016 m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine"); 1012 m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine");
@@ -1695,9 +1691,6 @@ namespace OpenSim.Region.Framework.Scenes
1695 { 1691 {
1696 if (PhysicsEnabled) 1692 if (PhysicsEnabled)
1697 physicsFPS = m_sceneGraph.UpdatePhysics(FrameTime); 1693 physicsFPS = m_sceneGraph.UpdatePhysics(FrameTime);
1698
1699 if (SynchronizeScene != null)
1700 SynchronizeScene(this);
1701 } 1694 }
1702 1695
1703 tmpMS2 = Util.GetTimeStampMS(); 1696 tmpMS2 = Util.GetTimeStampMS();
@@ -1775,30 +1768,6 @@ namespace OpenSim.Region.Framework.Scenes
1775 1768
1776 // Region ready should always be set 1769 // Region ready should always be set
1777 Ready = true; 1770 Ready = true;
1778
1779
1780 IConfig restartConfig = m_config.Configs["RestartModule"];
1781 if (restartConfig != null)
1782 {
1783 string markerPath = restartConfig.GetString("MarkerPath", String.Empty);
1784
1785 if (markerPath != String.Empty)
1786 {
1787 string path = Path.Combine(markerPath, RegionInfo.RegionID.ToString() + ".ready");
1788 try
1789 {
1790 string pidstring = System.Diagnostics.Process.GetCurrentProcess().Id.ToString();
1791 FileStream fs = File.Create(path);
1792 System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
1793 Byte[] buf = enc.GetBytes(pidstring);
1794 fs.Write(buf, 0, buf.Length);
1795 fs.Close();
1796 }
1797 catch (Exception)
1798 {
1799 }
1800 }
1801 }
1802 } 1771 }
1803 else 1772 else
1804 { 1773 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7d5bbbf..0b38179 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -119,6 +119,21 @@ namespace OpenSim.Region.Framework.Scenes
119 119
120 // private PrimCountTaintedDelegate handlerPrimCountTainted = null; 120 // private PrimCountTaintedDelegate handlerPrimCountTainted = null;
121 121
122 public bool IsViewerCachable
123 {
124 get
125 {
126 // needs more exclusion ?
127 return(Backup && !IsTemporary && !inTransit && !IsSelected && !UsesPhysics && !IsAttachmentCheckFull() &&
128 !RootPart.Shape.MeshFlagEntry && // animations are not sent correctly for now
129 RootPart.KeyframeMotion == null &&
130 (DateTime.UtcNow.Ticks - timeLastChanged > 36000000000) && //36000000000 is one hour
131 RootPart.Velocity.LengthSquared() < 1e8f && // should not be needed
132 RootPart.Acceleration.LengthSquared() < 1e4f // should not be needed
133 );
134 }
135 }
136
122 /// <summary> 137 /// <summary>
123 /// Signal whether the non-inventory attributes of any prims in the group have changed 138 /// Signal whether the non-inventory attributes of any prims in the group have changed
124 /// since the group's last persistent backup 139 /// since the group's last persistent backup
@@ -128,7 +143,8 @@ namespace OpenSim.Region.Framework.Scenes
128 private long timeLastChanged = 0; 143 private long timeLastChanged = 0;
129 private long m_maxPersistTime = 0; 144 private long m_maxPersistTime = 0;
130 private long m_minPersistTime = 0; 145 private long m_minPersistTime = 0;
131// private Random m_rand; 146
147 public int PseudoCRC;
132 148
133 /// <summary> 149 /// <summary>
134 /// This indicates whether the object has changed such that it needs to be repersisted to permenant storage 150 /// This indicates whether the object has changed such that it needs to be repersisted to permenant storage
@@ -145,40 +161,26 @@ namespace OpenSim.Region.Framework.Scenes
145 { 161 {
146 if (value) 162 if (value)
147 { 163 {
148
149 if (Backup) 164 if (Backup)
150 {
151 m_scene.SceneGraph.FireChangeBackup(this); 165 m_scene.SceneGraph.FireChangeBackup(this);
152 } 166
167 PseudoCRC = (int)(DateTime.UtcNow.Ticks); ;
153 timeLastChanged = DateTime.UtcNow.Ticks; 168 timeLastChanged = DateTime.UtcNow.Ticks;
154 if (!m_hasGroupChanged) 169 if (!m_hasGroupChanged)
155 timeFirstChanged = DateTime.UtcNow.Ticks; 170 timeFirstChanged = timeLastChanged;
156 if (m_rootPart != null && m_scene != null) 171 if (m_rootPart != null && m_scene != null)
157 { 172 {
158/*
159 if (m_rand == null)
160 {
161 byte[] val = new byte[16];
162 m_rootPart.UUID.ToBytes(val, 0);
163 m_rand = new Random(BitConverter.ToInt32(val, 0));
164 }
165 */
166 if (m_scene.GetRootAgentCount() == 0) 173 if (m_scene.GetRootAgentCount() == 0)
167 { 174 {
168 //If the region is empty, this change has been made by an automated process 175 //If the region is empty, this change has been made by an automated process
169 //and thus we delay the persist time by a random amount between 1.5 and 2.5. 176 //and thus we delay the persist time by a random amount between 1.5 and 2.5.
170 177
171// float factor = 1.5f + (float)(m_rand.NextDouble());
172 float factor = 2.0f; 178 float factor = 2.0f;
173 m_maxPersistTime = (long)((float)m_scene.m_persistAfter * factor); 179 m_maxPersistTime = (long)(m_scene.m_persistAfter * factor);
174 m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * factor); 180 m_minPersistTime = (long)(m_scene.m_dontPersistBefore * factor);
175 } 181 }
176 else 182 else
177 { 183 {
178 //If the region is not empty, we want to obey the minimum and maximum persist times
179 //but add a random factor so we stagger the object persistance a little
180// m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5
181// m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0
182 m_maxPersistTime = m_scene.m_persistAfter; 184 m_maxPersistTime = m_scene.m_persistAfter;
183 m_minPersistTime = m_scene.m_dontPersistBefore; 185 m_minPersistTime = m_scene.m_dontPersistBefore;
184 } 186 }
@@ -1330,6 +1332,7 @@ namespace OpenSim.Region.Framework.Scenes
1330 public SceneObjectGroup() 1332 public SceneObjectGroup()
1331 { 1333 {
1332 m_lastCollisionSoundMS = Util.GetTimeStampMS() + 1000.0; 1334 m_lastCollisionSoundMS = Util.GetTimeStampMS() + 1000.0;
1335 PseudoCRC = (int)(DateTime.UtcNow.Ticks);
1333 } 1336 }
1334 1337
1335 /// <summary> 1338 /// <summary>
@@ -2441,6 +2444,21 @@ namespace OpenSim.Region.Framework.Scenes
2441 } 2444 }
2442 } 2445 }
2443 2446
2447 public void SendUpdateProbes(IClientAPI remoteClient)
2448 {
2449 PrimUpdateFlags update = PrimUpdateFlags.UpdateProbe;
2450
2451 RootPart.SendUpdate(remoteClient, update);
2452
2453 SceneObjectPart[] parts = m_parts.GetArray();
2454 for (int i = 0; i < parts.Length; i++)
2455 {
2456 SceneObjectPart part = parts[i];
2457 if (part != RootPart)
2458 part.SendUpdate(remoteClient, update);
2459 }
2460 }
2461
2444 #region Copying 2462 #region Copying
2445 2463
2446 /// <summary> 2464 /// <summary>
@@ -2516,6 +2534,7 @@ namespace OpenSim.Region.Framework.Scenes
2516 } 2534 }
2517 2535
2518 dupe.InvalidatePartsLinkMaps(); 2536 dupe.InvalidatePartsLinkMaps();
2537 dupe.PseudoCRC = (int)(DateTime.UtcNow.Ticks);
2519 m_dupeInProgress = false; 2538 m_dupeInProgress = false;
2520 return dupe; 2539 return dupe;
2521 } 2540 }
@@ -2769,6 +2788,7 @@ namespace OpenSim.Region.Framework.Scenes
2769 } 2788 }
2770 } 2789 }
2771 2790
2791 PseudoCRC = (int)(DateTime.UtcNow.Ticks);
2772 rpart.ScheduleFullUpdate(); 2792 rpart.ScheduleFullUpdate();
2773 } 2793 }
2774 2794
@@ -2808,6 +2828,7 @@ namespace OpenSim.Region.Framework.Scenes
2808 part.ResetIDs(part.LinkNum); // Don't change link nums 2828 part.ResetIDs(part.LinkNum); // Don't change link nums
2809 m_parts.Add(part.UUID, part); 2829 m_parts.Add(part.UUID, part);
2810 } 2830 }
2831 PseudoCRC = (int)(DateTime.UtcNow.Ticks);
2811 } 2832 }
2812 } 2833 }
2813 2834
@@ -3117,7 +3138,6 @@ namespace OpenSim.Region.Framework.Scenes
3117 } 3138 }
3118 } 3139 }
3119 3140
3120
3121 // 'linkPart' == the root of the group being linked into this group 3141 // 'linkPart' == the root of the group being linked into this group
3122 SceneObjectPart linkPart = objectGroup.m_rootPart; 3142 SceneObjectPart linkPart = objectGroup.m_rootPart;
3123 3143
@@ -3160,7 +3180,6 @@ namespace OpenSim.Region.Framework.Scenes
3160 axPos *= Quaternion.Conjugate(parentRot); 3180 axPos *= Quaternion.Conjugate(parentRot);
3161 linkPart.OffsetPosition = axPos; 3181 linkPart.OffsetPosition = axPos;
3162 3182
3163
3164 // If there is only one SOP in a SOG, the LinkNum is zero. I.e., not a linkset. 3183 // If there is only one SOP in a SOG, the LinkNum is zero. I.e., not a linkset.
3165 // Now that we know this SOG has at least two SOPs in it, the new root 3184 // Now that we know this SOG has at least two SOPs in it, the new root
3166 // SOP becomes the first in the linkset. 3185 // SOP becomes the first in the linkset.
@@ -3193,8 +3212,7 @@ namespace OpenSim.Region.Framework.Scenes
3193 3212
3194 linkPart.CreateSelected = true; 3213 linkPart.CreateSelected = true;
3195 3214
3196 // let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now 3215 linkPart.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (linkPart.Flags & PrimFlags.Phantom) != 0), linkPart.VolumeDetectActive || RootPart.VolumeDetectActive, true);
3197 linkPart.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (linkPart.Flags & PrimFlags.Phantom) != 0), linkPart.VolumeDetectActive, true);
3198 3216
3199 // If the added SOP is physical, also tell the physics engine about the link relationship. 3217 // If the added SOP is physical, also tell the physics engine about the link relationship.
3200 if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical) 3218 if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 5c38bf3..4f3f83a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1179,9 +1179,10 @@ namespace OpenSim.Region.Framework.Scenes
1179 1179
1180 set 1180 set
1181 { 1181 {
1182 string old = m_mediaUrl;
1182 m_mediaUrl = value; 1183 m_mediaUrl = value;
1183 1184
1184 if (ParentGroup != null) 1185 if (ParentGroup != null && old != m_mediaUrl)
1185 ParentGroup.HasGroupChanged = true; 1186 ParentGroup.HasGroupChanged = true;
1186 } 1187 }
1187 } 1188 }
@@ -1385,13 +1386,6 @@ namespace OpenSim.Region.Framework.Scenes
1385 } 1386 }
1386 } 1387 }
1387 1388
1388 [XmlIgnore]
1389 public bool IsOccupied // KF If an av is sittingon this prim
1390 {
1391 get { return m_occupied; }
1392 set { m_occupied = value; }
1393 }
1394
1395 /// <summary> 1389 /// <summary>
1396 /// ID of the avatar that is sat on us if we have a sit target. If there is no such avatar then is UUID.Zero 1390 /// ID of the avatar that is sat on us if we have a sit target. If there is no such avatar then is UUID.Zero
1397 /// </summary> 1391 /// </summary>
@@ -2472,12 +2466,6 @@ namespace OpenSim.Region.Framework.Scenes
2472 2466
2473 public uint GetEffectiveObjectFlags() 2467 public uint GetEffectiveObjectFlags()
2474 { 2468 {
2475 // Commenting this section of code out since it doesn't actually do anything, as enums are handled by
2476 // value rather than reference
2477// PrimFlags f = _flags;
2478// if (m_parentGroup == null || m_parentGroup.RootPart == this)
2479// f &= ~(PrimFlags.Touch | PrimFlags.Money);
2480
2481 uint eff = (uint)Flags | (uint)LocalFlags; 2469 uint eff = (uint)Flags | (uint)LocalFlags;
2482 if(m_inventory == null || m_inventory.Count == 0) 2470 if(m_inventory == null || m_inventory.Count == 0)
2483 eff |= (uint)PrimFlags.InventoryEmpty; 2471 eff |= (uint)PrimFlags.InventoryEmpty;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index f010035..e635841 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1212,7 +1212,9 @@ namespace OpenSim.Region.Framework.Scenes
1212 ControllingClient.OnForceReleaseControls += HandleForceReleaseControls; 1212 ControllingClient.OnForceReleaseControls += HandleForceReleaseControls;
1213 ControllingClient.OnAutoPilotGo += MoveToTargetHandle; 1213 ControllingClient.OnAutoPilotGo += MoveToTargetHandle;
1214 ControllingClient.OnUpdateThrottles += RaiseUpdateThrottles; 1214 ControllingClient.OnUpdateThrottles += RaiseUpdateThrottles;
1215// ControllingClient.OnAgentFOV += HandleAgentFOV; 1215 ControllingClient.OnRegionHandShakeReply += RegionHandShakeReply;
1216
1217 // ControllingClient.OnAgentFOV += HandleAgentFOV;
1216 1218
1217 // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); 1219 // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
1218 // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); 1220 // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
@@ -1232,7 +1234,9 @@ namespace OpenSim.Region.Framework.Scenes
1232 ControllingClient.OnForceReleaseControls -= HandleForceReleaseControls; 1234 ControllingClient.OnForceReleaseControls -= HandleForceReleaseControls;
1233 ControllingClient.OnAutoPilotGo -= MoveToTargetHandle; 1235 ControllingClient.OnAutoPilotGo -= MoveToTargetHandle;
1234 ControllingClient.OnUpdateThrottles -= RaiseUpdateThrottles; 1236 ControllingClient.OnUpdateThrottles -= RaiseUpdateThrottles;
1235// ControllingClient.OnAgentFOV += HandleAgentFOV; 1237 ControllingClient.OnRegionHandShakeReply -= RegionHandShakeReply;
1238
1239 // ControllingClient.OnAgentFOV += HandleAgentFOV;
1236 } 1240 }
1237 1241
1238 private void SetDirectionVectors() 1242 private void SetDirectionVectors()
@@ -2126,56 +2130,54 @@ namespace OpenSim.Region.Framework.Scenes
2126 return; 2130 return;
2127 } 2131 }
2128 2132
2129 2133 if(IsChildAgent)
2134 {
2135 return; // how?
2136 }
2130 //m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2137 //m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2131 2138
2132 if(!haveGroupInformation && !IsChildAgent && !IsNPC) 2139 if (!IsNPC)
2133 { 2140 {
2134 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); 2141 if (!haveGroupInformation && !IsNPC)
2135 if (gm != null) 2142 {
2136 Grouptitle = gm.GetGroupTitle(m_uuid); 2143 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
2144 if (gm != null)
2145 Grouptitle = gm.GetGroupTitle(m_uuid);
2137 2146
2138 //m_log.DebugFormat("[CompleteMovement] Missing Grouptitle: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2147 //m_log.DebugFormat("[CompleteMovement] Missing Grouptitle: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2139 2148
2140 InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (FolderType)46); 2149 InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (FolderType)46);
2141 if (cof == null) 2150 if (cof == null)
2142 COF = UUID.Zero; 2151 COF = UUID.Zero;
2143 else 2152 else
2144 COF = cof.ID; 2153 COF = cof.ID;
2145 2154
2146 m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); 2155 m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF);
2147 } 2156 }
2148 2157
2149 if (!string.IsNullOrEmpty(m_callbackURI)) 2158 if (!string.IsNullOrEmpty(m_callbackURI))
2150 { 2159 {
2151 // We cannot sleep here since this would hold up the inbound packet processing thread, as 2160 // We cannot sleep here since this would hold up the inbound packet processing thread, as
2152 // CompleteMovement() is executed synchronously. However, it might be better to delay the release 2161 // CompleteMovement() is executed synchronously. However, it might be better to delay the release
2153 // here until we know for sure that the agent is active in this region. Sending AgentMovementComplete 2162 // here until we know for sure that the agent is active in this region. Sending AgentMovementComplete
2154 // is not enough for Imprudence clients - there appears to be a small delay (<200ms, <500ms) until they regard this 2163 // is not enough for Imprudence clients - there appears to be a small delay (<200ms, <500ms) until they regard this
2155 // region as the current region, meaning that a close sent before then will fail the teleport. 2164 // region as the current region, meaning that a close sent before then will fail the teleport.
2156 // System.Threading.Thread.Sleep(2000); 2165 // System.Threading.Thread.Sleep(2000);
2157 2166
2158 m_log.DebugFormat( 2167 m_log.DebugFormat(
2159 "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}", 2168 "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}",
2160 client.Name, client.AgentId, m_callbackURI); 2169 client.Name, client.AgentId, m_callbackURI);
2161 2170
2162 UUID originID; 2171 UUID originID;
2163 2172
2164 lock (m_originRegionIDAccessLock) 2173 lock (m_originRegionIDAccessLock)
2165 originID = m_originRegionID; 2174 originID = m_originRegionID;
2166 2175
2167 Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI); 2176 Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI);
2168 m_callbackURI = null; 2177 m_callbackURI = null;
2169 //m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2178 //m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2179 }
2170 } 2180 }
2171// else
2172// {
2173// m_log.DebugFormat(
2174// "[SCENE PRESENCE]: No callback provided on CompleteMovement of {0} {1} to {2}",
2175// client.Name, client.AgentId, m_scene.RegionInfo.RegionName);
2176// }
2177
2178
2179 // Tell the client that we're totally ready 2181 // Tell the client that we're totally ready
2180 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); 2182 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
2181 //m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2183 //m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts));
@@ -2187,32 +2189,29 @@ namespace OpenSim.Region.Framework.Scenes
2187 2189
2188 int delayctnr = Util.EnvironmentTickCount(); 2190 int delayctnr = Util.EnvironmentTickCount();
2189 2191
2190 if (!IsChildAgent) 2192 if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0)
2191 { 2193 {
2192 if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0) 2194 ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient);
2193 { 2195 }
2194 ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient);
2195 }
2196 2196
2197 // verify baked textures and cache 2197 // verify baked textures and cache
2198 bool cachedbaked = false; 2198 bool cachedbaked = false;
2199 2199
2200 if (IsNPC) 2200 if (IsNPC)
2201 cachedbaked = true; 2201 cachedbaked = true;
2202 else 2202 else
2203 { 2203 {
2204 if (m_scene.AvatarFactory != null && !isHGTP) 2204 if (m_scene.AvatarFactory != null && !isHGTP)
2205 cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); 2205 cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this);
2206 2206
2207 // not sure we need this 2207 // not sure we need this
2208 if (!cachedbaked) 2208 if (!cachedbaked)
2209 { 2209 {
2210 if (m_scene.AvatarFactory != null) 2210 if (m_scene.AvatarFactory != null)
2211 m_scene.AvatarFactory.QueueAppearanceSave(UUID); 2211 m_scene.AvatarFactory.QueueAppearanceSave(UUID);
2212 }
2213 } 2212 }
2214 //m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2215 } 2213 }
2214 //m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2216 2215
2217 if(m_teleportFlags > 0) 2216 if(m_teleportFlags > 0)
2218 { 2217 {
@@ -2251,104 +2250,103 @@ namespace OpenSim.Region.Framework.Scenes
2251 landch.sendClientInitialLandInfo(client, !gotCrossUpdate); 2250 landch.sendClientInitialLandInfo(client, !gotCrossUpdate);
2252 } 2251 }
2253 2252
2254 if (!IsChildAgent) 2253 List<ScenePresence> allpresences = m_scene.GetScenePresences();
2255 {
2256 List<ScenePresence> allpresences = m_scene.GetScenePresences();
2257 2254
2258 // send avatar object to all presences including us, so they cross it into region 2255 // send avatar object to all presences including us, so they cross it into region
2259 // then hide if necessary 2256 // then hide if necessary
2260 2257
2261 SendInitialAvatarDataToAllAgents(allpresences); 2258 SendInitialAvatarDataToAllAgents(allpresences);
2262 2259
2263 // send this look 2260 // send this look
2264 SendAppearanceToAgent(this); 2261 SendAppearanceToAgent(this);
2265 2262
2266 // send this animations 2263 // send this animations
2267 2264
2268 UUID[] animIDs = null; 2265 UUID[] animIDs = null;
2269 int[] animseqs = null; 2266 int[] animseqs = null;
2270 UUID[] animsobjs = null; 2267 UUID[] animsobjs = null;
2271 2268
2272 if (Animator != null) 2269 if (Animator != null)
2273 Animator.GetArrays(out animIDs, out animseqs, out animsobjs); 2270 Animator.GetArrays(out animIDs, out animseqs, out animsobjs);
2274 2271
2275 bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null); 2272 bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null);
2276 2273
2277 if (haveAnims) 2274 if (haveAnims)
2278 SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); 2275 SendAnimPackToAgent(this, animIDs, animseqs, animsobjs);
2279 2276
2280 // we should be able to receive updates, etc 2277 // we should be able to receive updates, etc
2281 // so release them 2278 // so release them
2282 m_inTransit = false; 2279 m_inTransit = false;
2283 2280
2284 // send look and animations to others 2281 // send look and animations to others
2285 // if not cached we send greys 2282 // if not cached we send greys
2286 // uncomented if will wait till avatar does baking 2283 // uncomented if will wait till avatar does baking
2287 //if (cachedbaked) 2284 //if (cachedbaked)
2285 {
2286 foreach (ScenePresence p in allpresences)
2288 { 2287 {
2289 foreach (ScenePresence p in allpresences) 2288 if (p == this)
2290 { 2289 continue;
2291 if (p == this)
2292 continue;
2293 2290
2294 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) 2291 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
2295 continue; 2292 continue;
2296 2293
2297 SendAppearanceToAgentNF(p); 2294 SendAppearanceToAgentNF(p);
2298 if (haveAnims) 2295 if (haveAnims)
2299 SendAnimPackToAgentNF(p, animIDs, animseqs, animsobjs); 2296 SendAnimPackToAgentNF(p, animIDs, animseqs, animsobjs);
2300 } 2297 }
2301 } // greys if 2298 } // greys if
2302 2299
2303 //m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2300 //m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2304 2301
2305 // attachments 2302 // attachments
2306 if (IsNPC || IsRealLogin(m_teleportFlags)) 2303 if (IsNPC || IsRealLogin(m_teleportFlags))
2307 { 2304 {
2308 if (Scene.AttachmentsModule != null) 2305 if (Scene.AttachmentsModule != null)
2309 // Util.FireAndForget( 2306 // Util.FireAndForget(
2310 // o => 2307 // o =>
2311 // { 2308 // {
2312 2309
2313 if (!IsNPC) 2310 if (!IsNPC)
2311 Scene.AttachmentsModule.RezAttachments(this);
2312 else
2313 Util.FireAndForget(x =>
2314 {
2314 Scene.AttachmentsModule.RezAttachments(this); 2315 Scene.AttachmentsModule.RezAttachments(this);
2315 else 2316 });
2316 Util.FireAndForget(x =>
2317 {
2318 Scene.AttachmentsModule.RezAttachments(this);
2319 });
2320 2317
2321 // }); 2318 // });
2322 } 2319 }
2323 else 2320 else
2321 {
2322 if (m_attachments.Count > 0)
2324 { 2323 {
2325 if (m_attachments.Count > 0)
2326 {
2327// m_log.DebugFormat( 2324// m_log.DebugFormat(
2328// "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); 2325// "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
2329 2326
2330 foreach (SceneObjectGroup sog in m_attachments) 2327 foreach (SceneObjectGroup sog in m_attachments)
2331 { 2328 {
2332 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); 2329 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
2333 sog.ResumeScripts(); 2330 sog.ResumeScripts();
2334 } 2331 }
2335 2332
2336 foreach (ScenePresence p in allpresences) 2333 foreach (ScenePresence p in allpresences)
2334 {
2335 if (p == this)
2337 { 2336 {
2338 if (p == this) 2337 SendAttachmentsToAgentNF(this);
2339 { 2338 continue;
2340 SendAttachmentsToAgentNF(this); 2339 }
2341 continue;
2342 }
2343 2340
2344 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) 2341 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
2345 continue; 2342 continue;
2346 2343
2347 SendAttachmentsToAgentNF(p); 2344 SendAttachmentsToAgentNF(p);
2348 }
2349 } 2345 }
2350 } 2346 }
2351 2347 }
2348 if(!IsNPC)
2349 {
2352 //m_log.DebugFormat("[CompleteMovement] attachments: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2350 //m_log.DebugFormat("[CompleteMovement] attachments: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2353 if (openChildAgents) 2351 if (openChildAgents)
2354 { 2352 {
@@ -2366,34 +2364,33 @@ namespace OpenSim.Region.Framework.Scenes
2366 2364
2367 m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel; 2365 m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel;
2368 m_childUpdatesBusy = false; // allow them 2366 m_childUpdatesBusy = false; // allow them
2369 }
2370 2367
2371 //m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2368 //m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2372 2369
2373 // send the rest of the world 2370 // send the rest of the world
2374 if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide) 2371 if (m_teleportFlags > 0 | m_currentParcelHide)
2375 SendInitialDataToMe(); 2372 SendInitialDataToMe();
2376 2373
2377 // priority uses avatar position only 2374 // priority uses avatar position only
2378// m_reprioritizationLastPosition = AbsolutePosition; 2375 // m_reprioritizationLastPosition = AbsolutePosition;
2379// m_reprioritizationLastDrawDistance = DrawDistance; 2376 // m_reprioritizationLastDrawDistance = DrawDistance;
2380// m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it 2377 // m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it
2381// m_reprioritizationBusy = false; 2378 // m_reprioritizationBusy = false;
2382 2379
2383 //m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2380 //m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2384 2381
2385 if (!IsChildAgent && openChildAgents) 2382 if (openChildAgents)
2386 {
2387 IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
2388 if (friendsModule != null)
2389 { 2383 {
2390 if(gotCrossUpdate) 2384 IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
2391 friendsModule.IsNowRoot(this); 2385 if (friendsModule != null)
2392 else 2386 {
2393 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); 2387 if(gotCrossUpdate)
2388 friendsModule.IsNowRoot(this);
2389 else
2390 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
2391 }
2392 //m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2394 } 2393 }
2395 //m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2396
2397 } 2394 }
2398 } 2395 }
2399 finally 2396 finally
@@ -4024,10 +4021,100 @@ namespace OpenSim.Region.Framework.Scenes
4024 ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); 4021 ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations);
4025 } 4022 }
4026 4023
4024
4025 public void RegionHandShakeReply (IClientAPI client, uint flags)
4026 {
4027 if(IsNPC)
4028 return;
4029
4030 bool selfappearance = (flags & 4) != 0;
4031 bool cacheCulling = (flags & 1) != 0;
4032 bool cacheEmpty;
4033 if(cacheCulling)
4034 cacheEmpty = (flags & 2) != 0;
4035 else
4036 cacheEmpty = true;
4037
4038 if (m_teleportFlags > 0) // only doing for child for now
4039 return;
4040
4041 lock (m_completeMovementLock)
4042 {
4043 if (SentInitialData)
4044 return;
4045 SentInitialData = true;
4046 }
4047
4048 Util.FireAndForget(delegate
4049 {
4050 Scene.SendLayerData(ControllingClient);
4051
4052 ILandChannel landch = m_scene.LandChannel;
4053 if (landch != null)
4054 landch.sendClientInitialLandInfo(ControllingClient, true);
4055
4056 // recheck to reduce timing issues
4057 ControllingClient.CheckViewerCaps();
4058
4059 SendOtherAgentsAvatarFullToMe();
4060 /*
4061 if (m_scene.ObjectsCullingByDistance && cacheCulling)
4062 {
4063 m_reprioritizationBusy = true;
4064 m_reprioritizationLastPosition = AbsolutePosition;
4065 m_reprioritizationLastDrawDistance = DrawDistance;
4066
4067 ControllingClient.ReprioritizeUpdates();
4068 m_reprioritizationLastTime = Util.EnvironmentTickCount();
4069 m_reprioritizationBusy = false;
4070 return;
4071 }
4072 */
4073
4074 EntityBase[] entities = Scene.Entities.GetEntities();
4075 if(cacheEmpty)
4076 {
4077 foreach (EntityBase e in entities)
4078 {
4079 if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment)
4080 ((SceneObjectGroup)e).SendFullAnimUpdateToClient(ControllingClient);
4081 }
4082 }
4083 else
4084 {
4085 foreach (EntityBase e in entities)
4086 {
4087 if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment)
4088 {
4089 SceneObjectGroup grp = e as SceneObjectGroup;
4090 if(grp.IsViewerCachable)
4091 grp.SendUpdateProbes(ControllingClient);
4092 else
4093 grp.SendFullAnimUpdateToClient(ControllingClient);
4094 }
4095 }
4096 }
4097
4098 m_reprioritizationLastPosition = AbsolutePosition;
4099 m_reprioritizationLastDrawDistance = DrawDistance;
4100 m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it
4101
4102 m_reprioritizationBusy = false;
4103
4104 });
4105
4106 }
4107
4027 public void SendInitialDataToMe() 4108 public void SendInitialDataToMe()
4028 { 4109 {
4029 // Send all scene object to the new client 4110 // Send all scene object to the new client
4030 SentInitialData = true; 4111 lock (m_completeMovementLock)
4112 {
4113 if (SentInitialData)
4114 return;
4115 SentInitialData = true;
4116 }
4117
4031 Util.FireAndForget(delegate 4118 Util.FireAndForget(delegate
4032 { 4119 {
4033 // we created a new ScenePresence (a new child agent) in a fresh region. 4120 // we created a new ScenePresence (a new child agent) in a fresh region.
@@ -4280,7 +4367,13 @@ namespace OpenSim.Region.Framework.Scenes
4280 if(IsDeleted || !ControllingClient.IsActive) 4367 if(IsDeleted || !ControllingClient.IsActive)
4281 return; 4368 return;
4282 4369
4283 if(!SentInitialData) 4370 bool needsendinitial = false;
4371 lock(m_completeMovementLock)
4372 {
4373 needsendinitial = SentInitialData;
4374 }
4375
4376 if(!needsendinitial)
4284 { 4377 {
4285 SendInitialDataToMe(); 4378 SendInitialDataToMe();
4286 return; 4379 return;
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 59ce05a..80baf82 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -699,7 +699,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
699 public event TeleportCancel OnTeleportCancel; 699 public event TeleportCancel OnTeleportCancel;
700 public event DeRezObject OnDeRezObject; 700 public event DeRezObject OnDeRezObject;
701 public event RezRestoreToWorld OnRezRestoreToWorld; 701 public event RezRestoreToWorld OnRezRestoreToWorld;
702 public event Action<IClientAPI> OnRegionHandShakeReply; 702 public event Action<IClientAPI, uint> OnRegionHandShakeReply;
703 public event GenericCall1 OnRequestWearables; 703 public event GenericCall1 OnRequestWearables;
704 public event Action<IClientAPI, bool> OnCompleteMovementToRegion; 704 public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
705 public event UpdateAgent OnPreAgentUpdate; 705 public event UpdateAgent OnPreAgentUpdate;
@@ -938,7 +938,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
938 938
939 if (OnRegionHandShakeReply != null) 939 if (OnRegionHandShakeReply != null)
940 { 940 {
941 OnRegionHandShakeReply(this); 941 OnRegionHandShakeReply(this, 0);
942 } 942 }
943 943
944 if (OnCompleteMovementToRegion != null) 944 if (OnCompleteMovementToRegion != null)
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 09f2a58..a7ed7d1 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -319,7 +319,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
319 319
320 public event DeRezObject OnDeRezObject; 320 public event DeRezObject OnDeRezObject;
321 public event RezRestoreToWorld OnRezRestoreToWorld; 321 public event RezRestoreToWorld OnRezRestoreToWorld;
322 public event Action<IClientAPI> OnRegionHandShakeReply; 322 public event Action<IClientAPI, uint> OnRegionHandShakeReply;
323 public event GenericCall1 OnRequestWearables; 323 public event GenericCall1 OnRequestWearables;
324 public event Action<IClientAPI, bool> OnCompleteMovementToRegion; 324 public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
325 public event UpdateAgent OnPreAgentUpdate; 325 public event UpdateAgent OnPreAgentUpdate;
@@ -928,7 +928,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
928 { 928 {
929 if (OnRegionHandShakeReply != null) 929 if (OnRegionHandShakeReply != null)
930 { 930 {
931 OnRegionHandShakeReply(this); 931 OnRegionHandShakeReply(this, 0);
932 } 932 }
933 } 933 }
934 934
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index bc6cb60..4fe2684 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -119,7 +119,7 @@ namespace OpenSim.Tests.Common
119 119
120 public event DeRezObject OnDeRezObject; 120 public event DeRezObject OnDeRezObject;
121 public event RezRestoreToWorld OnRezRestoreToWorld; 121 public event RezRestoreToWorld OnRezRestoreToWorld;
122 public event Action<IClientAPI> OnRegionHandShakeReply; 122 public event Action<IClientAPI, uint> OnRegionHandShakeReply;
123 public event GenericCall1 OnRequestWearables; 123 public event GenericCall1 OnRequestWearables;
124 public event Action<IClientAPI, bool> OnCompleteMovementToRegion; 124 public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
125 public event UpdateAgent OnPreAgentUpdate; 125 public event UpdateAgent OnPreAgentUpdate;
@@ -880,7 +880,7 @@ namespace OpenSim.Tests.Common
880 { 880 {
881 if (OnRegionHandShakeReply != null) 881 if (OnRegionHandShakeReply != null)
882 { 882 {
883 OnRegionHandShakeReply(this); 883 OnRegionHandShakeReply(this, 0);
884 } 884 }
885 } 885 }
886 886