diff options
author | Tom | 2011-09-04 07:06:36 -0700 |
---|---|---|
committer | Tom | 2011-09-04 07:06:36 -0700 |
commit | 66dec3b8742eff04fbbcc6e3249fe4ba87986500 (patch) | |
tree | 76cc708a821d35fac5cdbbce2de304b47064e732 /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |
parent | Guard another nullref (diff) | |
parent | Fixed BulletSim config files for Linux *.so libraries. (diff) | |
download | opensim-SC-66dec3b8742eff04fbbcc6e3249fe4ba87986500.zip opensim-SC-66dec3b8742eff04fbbcc6e3249fe4ba87986500.tar.gz opensim-SC-66dec3b8742eff04fbbcc6e3249fe4ba87986500.tar.bz2 opensim-SC-66dec3b8742eff04fbbcc6e3249fe4ba87986500.tar.xz |
Resolve merge commits, stage 1
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 172 |
1 files changed, 108 insertions, 64 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index d5419cc..5c94fba 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -90,7 +90,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
90 | public event ObjectAttach OnObjectAttach; | 90 | public event ObjectAttach OnObjectAttach; |
91 | public event ObjectDeselect OnObjectDetach; | 91 | public event ObjectDeselect OnObjectDetach; |
92 | public event ObjectDrop OnObjectDrop; | 92 | public event ObjectDrop OnObjectDrop; |
93 | public event GenericCall1 OnCompleteMovementToRegion; | 93 | public event Action<IClientAPI, bool> OnCompleteMovementToRegion; |
94 | public event UpdateAgent OnPreAgentUpdate; | 94 | public event UpdateAgent OnPreAgentUpdate; |
95 | public event UpdateAgent OnAgentUpdate; | 95 | public event UpdateAgent OnAgentUpdate; |
96 | public event AgentRequestSit OnAgentRequestSit; | 96 | public event AgentRequestSit OnAgentRequestSit; |
@@ -232,7 +232,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
232 | public event ScriptReset OnScriptReset; | 232 | public event ScriptReset OnScriptReset; |
233 | public event GetScriptRunning OnGetScriptRunning; | 233 | public event GetScriptRunning OnGetScriptRunning; |
234 | public event SetScriptRunning OnSetScriptRunning; | 234 | public event SetScriptRunning OnSetScriptRunning; |
235 | public event UpdateVector OnAutoPilotGo; | 235 | public event Action<Vector3, bool> OnAutoPilotGo; |
236 | public event TerrainUnacked OnUnackedTerrain; | 236 | public event TerrainUnacked OnUnackedTerrain; |
237 | public event ActivateGesture OnActivateGesture; | 237 | public event ActivateGesture OnActivateGesture; |
238 | public event DeactivateGesture OnDeactivateGesture; | 238 | public event DeactivateGesture OnDeactivateGesture; |
@@ -534,7 +534,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
534 | m_udpServer.Flush(m_udpClient); | 534 | m_udpServer.Flush(m_udpClient); |
535 | 535 | ||
536 | // Remove ourselves from the scene | 536 | // Remove ourselves from the scene |
537 | m_scene.RemoveClient(AgentId); | 537 | m_scene.RemoveClient(AgentId, true); |
538 | 538 | ||
539 | // We can't reach into other scenes and close the connection | 539 | // We can't reach into other scenes and close the connection |
540 | // We need to do this over grid communications | 540 | // We need to do this over grid communications |
@@ -596,22 +596,42 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
596 | return result; | 596 | return result; |
597 | } | 597 | } |
598 | 598 | ||
599 | /// <summary> | ||
600 | /// Add a handler for the given packet type. | ||
601 | /// </summary> | ||
602 | /// <remarks>The packet is handled on its own thread. If packets must be handled in the order in which thye | ||
603 | /// are received then please us ethe synchronous version of this method.</remarks> | ||
604 | /// <param name="packetType"></param> | ||
605 | /// <param name="handler"></param> | ||
606 | /// <returns>true if the handler was added. This is currently always the case.</returns> | ||
599 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler) | 607 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler) |
600 | { | 608 | { |
601 | return AddLocalPacketHandler(packetType, handler, true); | 609 | return AddLocalPacketHandler(packetType, handler, true); |
602 | } | 610 | } |
603 | 611 | ||
604 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool async) | 612 | /// <summary> |
613 | /// Add a handler for the given packet type. | ||
614 | /// </summary> | ||
615 | /// <param name="packetType"></param> | ||
616 | /// <param name="handler"></param> | ||
617 | /// <param name="doAsync"> | ||
618 | /// If true, when the packet is received it is handled on its own thread rather than on the main inward bound | ||
619 | /// packet handler thread. This vastly increases respnosiveness but some packets need to be handled | ||
620 | /// synchronously. | ||
621 | /// </param> | ||
622 | /// <returns>true if the handler was added. This is currently always the case.</returns> | ||
623 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync) | ||
605 | { | 624 | { |
606 | bool result = false; | 625 | bool result = false; |
607 | lock (m_packetHandlers) | 626 | lock (m_packetHandlers) |
608 | { | 627 | { |
609 | if (!m_packetHandlers.ContainsKey(packetType)) | 628 | if (!m_packetHandlers.ContainsKey(packetType)) |
610 | { | 629 | { |
611 | m_packetHandlers.Add(packetType, new PacketProcessor() { method = handler, Async = async }); | 630 | m_packetHandlers.Add(packetType, new PacketProcessor() { method = handler, Async = doAsync }); |
612 | result = true; | 631 | result = true; |
613 | } | 632 | } |
614 | } | 633 | } |
634 | |||
615 | return result; | 635 | return result; |
616 | } | 636 | } |
617 | 637 | ||
@@ -694,7 +714,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
694 | 714 | ||
695 | public virtual void Start() | 715 | public virtual void Start() |
696 | { | 716 | { |
697 | m_scene.AddNewClient(this); | 717 | m_scene.AddNewClient(this, PresenceType.User); |
698 | 718 | ||
699 | RefreshGroupMembership(); | 719 | RefreshGroupMembership(); |
700 | } | 720 | } |
@@ -4800,7 +4820,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4800 | { | 4820 | { |
4801 | SceneObjectPart part = (SceneObjectPart)entity; | 4821 | SceneObjectPart part = (SceneObjectPart)entity; |
4802 | 4822 | ||
4803 | attachPoint = part.AttachmentPoint; | 4823 | attachPoint = part.ParentGroup.AttachmentPoint; |
4824 | |||
4825 | // m_log.DebugFormat( | ||
4826 | // "[LLCLIENTVIEW]: Sending attachPoint {0} for {1} {2} to {3}", | ||
4827 | // attachPoint, part.Name, part.LocalId, Name); | ||
4828 | |||
4804 | collisionPlane = Vector4.Zero; | 4829 | collisionPlane = Vector4.Zero; |
4805 | position = part.RelativePosition; | 4830 | position = part.RelativePosition; |
4806 | velocity = part.Velocity; | 4831 | velocity = part.Velocity; |
@@ -4957,17 +4982,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4957 | //update.JointType = 0; | 4982 | //update.JointType = 0; |
4958 | update.Material = data.Material; | 4983 | update.Material = data.Material; |
4959 | update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim | 4984 | update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim |
4960 | if (data.IsAttachment) | 4985 | if (data.ParentGroup.IsAttachment) |
4961 | { | 4986 | { |
4962 | update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.FromItemID); | 4987 | update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.FromItemID); |
4963 | update.State = (byte)((data.AttachmentPoint % 16) * 16 + (data.AttachmentPoint / 16)); | 4988 | update.State = (byte)((data.ParentGroup.AttachmentPoint % 16) * 16 + (data.ParentGroup.AttachmentPoint / 16)); |
4964 | } | 4989 | } |
4965 | else | 4990 | else |
4966 | { | 4991 | { |
4967 | update.NameValue = Utils.EmptyBytes; | 4992 | update.NameValue = Utils.EmptyBytes; |
4968 | update.State = data.Shape.State; | 4993 | |
4994 | // The root part state is the canonical state for all parts of the object. The other part states in the | ||
4995 | // case for attachments may contain conflicting values that can end up crashing the viewer. | ||
4996 | update.State = data.ParentGroup.RootPart.Shape.State; | ||
4969 | } | 4997 | } |
4970 | 4998 | ||
4999 | // m_log.DebugFormat( | ||
5000 | // "[LLCLIENTVIEW]: Sending state {0} for {1} {2} to {3}", | ||
5001 | // update.State, data.Name, data.LocalId, Name); | ||
5002 | |||
4971 | update.ObjectData = objectData; | 5003 | update.ObjectData = objectData; |
4972 | update.ParentID = data.ParentID; | 5004 | update.ParentID = data.ParentID; |
4973 | update.PathBegin = data.Shape.PathBegin; | 5005 | update.PathBegin = data.Shape.PathBegin; |
@@ -5311,6 +5343,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5311 | AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest); | 5343 | AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest); |
5312 | AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes); | 5344 | AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes); |
5313 | AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard); | 5345 | AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard); |
5346 | |||
5347 | AddGenericPacketHandler("autopilot", HandleAutopilot); | ||
5314 | } | 5348 | } |
5315 | 5349 | ||
5316 | #region Packet Handlers | 5350 | #region Packet Handlers |
@@ -5354,7 +5388,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5354 | ); | 5388 | ); |
5355 | } | 5389 | } |
5356 | else | 5390 | else |
5391 | { | ||
5357 | update = true; | 5392 | update = true; |
5393 | } | ||
5358 | 5394 | ||
5359 | // These should be ordered from most-likely to | 5395 | // These should be ordered from most-likely to |
5360 | // least likely to change. I've made an initial | 5396 | // least likely to change. I've made an initial |
@@ -5362,6 +5398,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5362 | 5398 | ||
5363 | if (update) | 5399 | if (update) |
5364 | { | 5400 | { |
5401 | // m_log.DebugFormat("[LLCLIENTVIEW]: Triggered AgentUpdate for {0}", sener.Name); | ||
5402 | |||
5365 | AgentUpdateArgs arg = new AgentUpdateArgs(); | 5403 | AgentUpdateArgs arg = new AgentUpdateArgs(); |
5366 | arg.AgentID = x.AgentID; | 5404 | arg.AgentID = x.AgentID; |
5367 | arg.BodyRotation = x.BodyRotation; | 5405 | arg.BodyRotation = x.BodyRotation; |
@@ -6235,10 +6273,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6235 | 6273 | ||
6236 | private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack) | 6274 | private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack) |
6237 | { | 6275 | { |
6238 | GenericCall1 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; | 6276 | Action<IClientAPI, bool> handlerCompleteMovementToRegion = OnCompleteMovementToRegion; |
6239 | if (handlerCompleteMovementToRegion != null) | 6277 | if (handlerCompleteMovementToRegion != null) |
6240 | { | 6278 | { |
6241 | handlerCompleteMovementToRegion(sender); | 6279 | handlerCompleteMovementToRegion(sender, true); |
6242 | } | 6280 | } |
6243 | handlerCompleteMovementToRegion = null; | 6281 | handlerCompleteMovementToRegion = null; |
6244 | 6282 | ||
@@ -11316,8 +11354,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11316 | protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet) | 11354 | protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet) |
11317 | { | 11355 | { |
11318 | MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; | 11356 | MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; |
11319 | if (multipleupdate.AgentData.SessionID != SessionId) return false; | 11357 | |
11320 | // m_log.Debug("new multi update packet " + multipleupdate.ToString()); | 11358 | if (multipleupdate.AgentData.SessionID != SessionId) |
11359 | return false; | ||
11360 | |||
11361 | // m_log.DebugFormat( | ||
11362 | // "[CLIENT]: Incoming MultipleObjectUpdatePacket contained {0} blocks", multipleupdate.ObjectData.Length); | ||
11363 | |||
11321 | Scene tScene = (Scene)m_scene; | 11364 | Scene tScene = (Scene)m_scene; |
11322 | 11365 | ||
11323 | for (int i = 0; i < multipleupdate.ObjectData.Length; i++) | 11366 | for (int i = 0; i < multipleupdate.ObjectData.Length; i++) |
@@ -11338,7 +11381,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11338 | } | 11381 | } |
11339 | else | 11382 | else |
11340 | { | 11383 | { |
11341 | // UUID partId = part.UUID; | 11384 | // m_log.DebugFormat( |
11385 | // "[CLIENT]: Processing block {0} type {1} for {2} {3}", | ||
11386 | // i, block.Type, part.Name, part.LocalId); | ||
11387 | |||
11388 | // // Do this once since fetch parts creates a new array. | ||
11389 | // SceneObjectPart[] parts = part.ParentGroup.Parts; | ||
11390 | // for (int j = 0; j < parts.Length; j++) | ||
11391 | // { | ||
11392 | // part.StoreUndoState(); | ||
11393 | // parts[j].IgnoreUndoUpdate = true; | ||
11394 | // } | ||
11395 | |||
11342 | UpdatePrimGroupRotation handlerUpdatePrimGroupRotation; | 11396 | UpdatePrimGroupRotation handlerUpdatePrimGroupRotation; |
11343 | 11397 | ||
11344 | switch (block.Type) | 11398 | switch (block.Type) |
@@ -11353,6 +11407,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11353 | handlerUpdatePrimSinglePosition(localId, pos1, this); | 11407 | handlerUpdatePrimSinglePosition(localId, pos1, this); |
11354 | } | 11408 | } |
11355 | break; | 11409 | break; |
11410 | |||
11356 | case 2: | 11411 | case 2: |
11357 | Quaternion rot1 = new Quaternion(block.Data, 0, true); | 11412 | Quaternion rot1 = new Quaternion(block.Data, 0, true); |
11358 | 11413 | ||
@@ -11363,6 +11418,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11363 | handlerUpdatePrimSingleRotation(localId, rot1, this); | 11418 | handlerUpdatePrimSingleRotation(localId, rot1, this); |
11364 | } | 11419 | } |
11365 | break; | 11420 | break; |
11421 | |||
11366 | case 3: | 11422 | case 3: |
11367 | Vector3 rotPos = new Vector3(block.Data, 0); | 11423 | Vector3 rotPos = new Vector3(block.Data, 0); |
11368 | Quaternion rot2 = new Quaternion(block.Data, 12, true); | 11424 | Quaternion rot2 = new Quaternion(block.Data, 12, true); |
@@ -11375,6 +11431,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11375 | handlerUpdatePrimSingleRotationPosition(localId, rot2, rotPos, this); | 11431 | handlerUpdatePrimSingleRotationPosition(localId, rot2, rotPos, this); |
11376 | } | 11432 | } |
11377 | break; | 11433 | break; |
11434 | |||
11378 | case 4: | 11435 | case 4: |
11379 | case 20: | 11436 | case 20: |
11380 | Vector3 scale4 = new Vector3(block.Data, 0); | 11437 | Vector3 scale4 = new Vector3(block.Data, 0); |
@@ -11386,8 +11443,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11386 | handlerUpdatePrimScale(localId, scale4, this); | 11443 | handlerUpdatePrimScale(localId, scale4, this); |
11387 | } | 11444 | } |
11388 | break; | 11445 | break; |
11389 | case 5: | ||
11390 | 11446 | ||
11447 | case 5: | ||
11391 | Vector3 scale1 = new Vector3(block.Data, 12); | 11448 | Vector3 scale1 = new Vector3(block.Data, 12); |
11392 | Vector3 pos11 = new Vector3(block.Data, 0); | 11449 | Vector3 pos11 = new Vector3(block.Data, 0); |
11393 | 11450 | ||
@@ -11404,6 +11461,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11404 | } | 11461 | } |
11405 | } | 11462 | } |
11406 | break; | 11463 | break; |
11464 | |||
11407 | case 9: | 11465 | case 9: |
11408 | Vector3 pos2 = new Vector3(block.Data, 0); | 11466 | Vector3 pos2 = new Vector3(block.Data, 0); |
11409 | 11467 | ||
@@ -11411,10 +11469,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11411 | 11469 | ||
11412 | if (handlerUpdateVector != null) | 11470 | if (handlerUpdateVector != null) |
11413 | { | 11471 | { |
11414 | |||
11415 | handlerUpdateVector(localId, pos2, this); | 11472 | handlerUpdateVector(localId, pos2, this); |
11416 | } | 11473 | } |
11417 | break; | 11474 | break; |
11475 | |||
11418 | case 10: | 11476 | case 10: |
11419 | Quaternion rot3 = new Quaternion(block.Data, 0, true); | 11477 | Quaternion rot3 = new Quaternion(block.Data, 0, true); |
11420 | 11478 | ||
@@ -11425,6 +11483,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11425 | handlerUpdatePrimRotation(localId, rot3, this); | 11483 | handlerUpdatePrimRotation(localId, rot3, this); |
11426 | } | 11484 | } |
11427 | break; | 11485 | break; |
11486 | |||
11428 | case 11: | 11487 | case 11: |
11429 | Vector3 pos3 = new Vector3(block.Data, 0); | 11488 | Vector3 pos3 = new Vector3(block.Data, 0); |
11430 | Quaternion rot4 = new Quaternion(block.Data, 12, true); | 11489 | Quaternion rot4 = new Quaternion(block.Data, 12, true); |
@@ -11448,6 +11507,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11448 | handlerUpdatePrimGroupScale(localId, scale7, this); | 11507 | handlerUpdatePrimGroupScale(localId, scale7, this); |
11449 | } | 11508 | } |
11450 | break; | 11509 | break; |
11510 | |||
11451 | case 13: | 11511 | case 13: |
11452 | Vector3 scale2 = new Vector3(block.Data, 12); | 11512 | Vector3 scale2 = new Vector3(block.Data, 12); |
11453 | Vector3 pos4 = new Vector3(block.Data, 0); | 11513 | Vector3 pos4 = new Vector3(block.Data, 0); |
@@ -11467,6 +11527,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11467 | } | 11527 | } |
11468 | } | 11528 | } |
11469 | break; | 11529 | break; |
11530 | |||
11470 | case 29: | 11531 | case 29: |
11471 | Vector3 scale5 = new Vector3(block.Data, 12); | 11532 | Vector3 scale5 = new Vector3(block.Data, 12); |
11472 | Vector3 pos5 = new Vector3(block.Data, 0); | 11533 | Vector3 pos5 = new Vector3(block.Data, 0); |
@@ -11475,6 +11536,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11475 | if (handlerUpdatePrimGroupScale != null) | 11536 | if (handlerUpdatePrimGroupScale != null) |
11476 | { | 11537 | { |
11477 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 11538 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); |
11539 | part.StoreUndoState(true); | ||
11540 | part.IgnoreUndoUpdate = true; | ||
11478 | handlerUpdatePrimGroupScale(localId, scale5, this); | 11541 | handlerUpdatePrimGroupScale(localId, scale5, this); |
11479 | handlerUpdateVector = OnUpdatePrimGroupPosition; | 11542 | handlerUpdateVector = OnUpdatePrimGroupPosition; |
11480 | 11543 | ||
@@ -11482,8 +11545,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11482 | { | 11545 | { |
11483 | handlerUpdateVector(localId, pos5, this); | 11546 | handlerUpdateVector(localId, pos5, this); |
11484 | } | 11547 | } |
11548 | |||
11549 | part.IgnoreUndoUpdate = false; | ||
11485 | } | 11550 | } |
11551 | |||
11486 | break; | 11552 | break; |
11553 | |||
11487 | case 21: | 11554 | case 21: |
11488 | Vector3 scale6 = new Vector3(block.Data, 12); | 11555 | Vector3 scale6 = new Vector3(block.Data, 12); |
11489 | Vector3 pos6 = new Vector3(block.Data, 0); | 11556 | Vector3 pos6 = new Vector3(block.Data, 0); |
@@ -11491,6 +11558,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11491 | handlerUpdatePrimScale = OnUpdatePrimScale; | 11558 | handlerUpdatePrimScale = OnUpdatePrimScale; |
11492 | if (handlerUpdatePrimScale != null) | 11559 | if (handlerUpdatePrimScale != null) |
11493 | { | 11560 | { |
11561 | part.StoreUndoState(false); | ||
11562 | part.IgnoreUndoUpdate = true; | ||
11563 | |||
11494 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 11564 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); |
11495 | handlerUpdatePrimScale(localId, scale6, this); | 11565 | handlerUpdatePrimScale(localId, scale6, this); |
11496 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; | 11566 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; |
@@ -11498,15 +11568,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11498 | { | 11568 | { |
11499 | handlerUpdatePrimSinglePosition(localId, pos6, this); | 11569 | handlerUpdatePrimSinglePosition(localId, pos6, this); |
11500 | } | 11570 | } |
11571 | |||
11572 | part.IgnoreUndoUpdate = false; | ||
11501 | } | 11573 | } |
11502 | break; | 11574 | break; |
11575 | |||
11503 | default: | 11576 | default: |
11504 | m_log.Debug("[CLIENT] MultipleObjUpdate recieved an unknown packet type: " + (block.Type)); | 11577 | m_log.Debug("[CLIENT]: MultipleObjUpdate recieved an unknown packet type: " + (block.Type)); |
11505 | break; | 11578 | break; |
11506 | } | 11579 | } |
11580 | |||
11581 | // for (int j = 0; j < parts.Length; j++) | ||
11582 | // parts[j].IgnoreUndoUpdate = false; | ||
11507 | } | 11583 | } |
11508 | } | 11584 | } |
11509 | } | 11585 | } |
11586 | |||
11510 | return true; | 11587 | return true; |
11511 | } | 11588 | } |
11512 | 11589 | ||
@@ -11666,55 +11743,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11666 | return false; | 11743 | return false; |
11667 | } | 11744 | } |
11668 | 11745 | ||
11669 | /// <summary> | 11746 | protected void HandleAutopilot(Object sender, string method, List<String> args) |
11670 | /// Breaks down the genericMessagePacket into specific events | ||
11671 | /// </summary> | ||
11672 | /// <param name="gmMethod"></param> | ||
11673 | /// <param name="gmInvoice"></param> | ||
11674 | /// <param name="gmParams"></param> | ||
11675 | public void DecipherGenericMessage(string gmMethod, UUID gmInvoice, GenericMessagePacket.ParamListBlock[] gmParams) | ||
11676 | { | 11747 | { |
11677 | switch (gmMethod) | 11748 | float locx = 0; |
11678 | { | 11749 | float locy = 0; |
11679 | case "autopilot": | 11750 | float locz = 0; |
11680 | float locx; | 11751 | uint regionX = 0; |
11681 | float locy; | 11752 | uint regionY = 0; |
11682 | float locz; | ||
11683 | |||
11684 | try | ||
11685 | { | ||
11686 | uint regionX; | ||
11687 | uint regionY; | ||
11688 | Utils.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY); | ||
11689 | locx = Convert.ToSingle(Utils.BytesToString(gmParams[0].Parameter)) - regionX; | ||
11690 | locy = Convert.ToSingle(Utils.BytesToString(gmParams[1].Parameter)) - regionY; | ||
11691 | locz = Convert.ToSingle(Utils.BytesToString(gmParams[2].Parameter)); | ||
11692 | } | ||
11693 | catch (InvalidCastException) | ||
11694 | { | ||
11695 | m_log.Error("[CLIENT]: Invalid autopilot request"); | ||
11696 | return; | ||
11697 | } | ||
11698 | |||
11699 | UpdateVector handlerAutoPilotGo = OnAutoPilotGo; | ||
11700 | if (handlerAutoPilotGo != null) | ||
11701 | { | ||
11702 | handlerAutoPilotGo(0, new Vector3(locx, locy, locz), this); | ||
11703 | } | ||
11704 | m_log.InfoFormat("[CLIENT]: Client Requests autopilot to position <{0},{1},{2}>", locx, locy, locz); | ||
11705 | 11753 | ||
11754 | Utils.LongToUInts(m_scene.RegionInfo.RegionHandle, out regionX, out regionY); | ||
11755 | locx = Convert.ToSingle(args[0]) - (float)regionX; | ||
11756 | locy = Convert.ToSingle(args[1]) - (float)regionY; | ||
11757 | locz = Convert.ToSingle(args[2]); | ||
11706 | 11758 | ||
11707 | break; | 11759 | Action<Vector3, bool> handlerAutoPilotGo = OnAutoPilotGo; |
11708 | default: | 11760 | if (handlerAutoPilotGo != null) |
11709 | m_log.Debug("[CLIENT]: Unknown Generic Message, Method: " + gmMethod + ". Invoice: " + gmInvoice + ". Dumping Params:"); | 11761 | handlerAutoPilotGo(new Vector3(locx, locy, locz), false); |
11710 | for (int hi = 0; hi < gmParams.Length; hi++) | ||
11711 | { | ||
11712 | Console.WriteLine(gmParams[hi].ToString()); | ||
11713 | } | ||
11714 | //gmpack.MethodData. | ||
11715 | break; | ||
11716 | |||
11717 | } | ||
11718 | } | 11762 | } |
11719 | 11763 | ||
11720 | /// <summary> | 11764 | /// <summary> |