diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 198 |
1 files changed, 129 insertions, 69 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index ee28914..8e0b72f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -47,6 +47,7 @@ using OpenSim.Region.Framework.Scenes; | |||
47 | using OpenSim.Services.Interfaces; | 47 | using OpenSim.Services.Interfaces; |
48 | using Timer = System.Timers.Timer; | 48 | using Timer = System.Timers.Timer; |
49 | using AssetLandmark = OpenSim.Framework.AssetLandmark; | 49 | using AssetLandmark = OpenSim.Framework.AssetLandmark; |
50 | using RegionFlags = OpenMetaverse.RegionFlags; | ||
50 | using Nini.Config; | 51 | using Nini.Config; |
51 | 52 | ||
52 | using System.IO; | 53 | using System.IO; |
@@ -295,6 +296,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
295 | public event MuteListEntryRemove OnRemoveMuteListEntry; | 296 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
296 | public event GodlikeMessage onGodlikeMessage; | 297 | public event GodlikeMessage onGodlikeMessage; |
297 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; | 298 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
299 | public event GenericCall2 OnUpdateThrottles; | ||
298 | 300 | ||
299 | #endregion Events | 301 | #endregion Events |
300 | 302 | ||
@@ -354,7 +356,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
354 | private bool m_deliverPackets = true; | 356 | private bool m_deliverPackets = true; |
355 | private int m_animationSequenceNumber = 1; | 357 | private int m_animationSequenceNumber = 1; |
356 | private bool m_SendLogoutPacketWhenClosing = true; | 358 | private bool m_SendLogoutPacketWhenClosing = true; |
357 | private AgentUpdateArgs lastarg; | 359 | |
360 | /// <summary> | ||
361 | /// We retain a single AgentUpdateArgs so that we can constantly reuse it rather than construct a new one for | ||
362 | /// every single incoming AgentUpdate. Every client sends 10 AgentUpdate UDP messages per second, even if it | ||
363 | /// is doing absolutely nothing. | ||
364 | /// </summary> | ||
365 | /// <remarks> | ||
366 | /// This does mean that agent updates must be processed synchronously, at least for each client, and called methods | ||
367 | /// cannot retain a reference to it outside of that method. | ||
368 | /// </remarks> | ||
369 | private AgentUpdateArgs m_lastAgentUpdateArgs; | ||
358 | 370 | ||
359 | protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); | 371 | protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); |
360 | protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers | 372 | protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers |
@@ -509,19 +521,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
509 | /// </summary> | 521 | /// </summary> |
510 | public void Close() | 522 | public void Close() |
511 | { | 523 | { |
512 | Close(true); | 524 | Close(true, false); |
513 | } | 525 | } |
514 | 526 | ||
515 | /// <summary> | 527 | public void Close(bool sendStop, bool force) |
516 | /// Shut down the client view | ||
517 | /// </summary> | ||
518 | public void Close(bool sendStop) | ||
519 | { | 528 | { |
520 | // We lock here to prevent race conditions between two threads calling close simultaneously (e.g. | 529 | // We lock here to prevent race conditions between two threads calling close simultaneously (e.g. |
521 | // a simultaneous relog just as a client is being closed out due to no packet ack from the old connection. | 530 | // a simultaneous relog just as a client is being closed out due to no packet ack from the old connection. |
522 | lock (CloseSyncLock) | 531 | lock (CloseSyncLock) |
523 | { | 532 | { |
524 | if (!IsActive) | 533 | // We still perform a force close inside the sync lock since this is intended to attempt close where |
534 | // there is some unidentified connection problem, not where we have issues due to deadlock | ||
535 | if (!IsActive && !force) | ||
525 | return; | 536 | return; |
526 | 537 | ||
527 | IsActive = false; | 538 | IsActive = false; |
@@ -836,8 +847,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
836 | OutPacket(mov, ThrottleOutPacketType.Unknown); | 847 | OutPacket(mov, ThrottleOutPacketType.Unknown); |
837 | } | 848 | } |
838 | 849 | ||
839 | public void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, | 850 | public void SendChatMessage( |
840 | UUID fromAgentID, byte source, byte audible) | 851 | string message, byte type, Vector3 fromPos, string fromName, |
852 | UUID fromAgentID, UUID ownerID, byte source, byte audible) | ||
841 | { | 853 | { |
842 | ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator); | 854 | ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator); |
843 | reply.ChatData.Audible = audible; | 855 | reply.ChatData.Audible = audible; |
@@ -846,7 +858,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
846 | reply.ChatData.SourceType = source; | 858 | reply.ChatData.SourceType = source; |
847 | reply.ChatData.Position = fromPos; | 859 | reply.ChatData.Position = fromPos; |
848 | reply.ChatData.FromName = Util.StringToBytes256(fromName); | 860 | reply.ChatData.FromName = Util.StringToBytes256(fromName); |
849 | reply.ChatData.OwnerID = fromAgentID; | 861 | reply.ChatData.OwnerID = ownerID; |
850 | reply.ChatData.SourceID = fromAgentID; | 862 | reply.ChatData.SourceID = fromAgentID; |
851 | 863 | ||
852 | OutPacket(reply, ThrottleOutPacketType.Unknown); | 864 | OutPacket(reply, ThrottleOutPacketType.Unknown); |
@@ -3984,7 +3996,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3984 | { | 3996 | { |
3985 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; | 3997 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; |
3986 | 3998 | ||
3987 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | 3999 | ImprovedTerseObjectUpdatePacket packet |
4000 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); | ||
3988 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 4001 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
3989 | packet.RegionData.TimeDilation = timeDilation; | 4002 | packet.RegionData.TimeDilation = timeDilation; |
3990 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | 4003 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; |
@@ -4029,7 +4042,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4029 | { | 4042 | { |
4030 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value; | 4043 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value; |
4031 | 4044 | ||
4032 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | 4045 | ImprovedTerseObjectUpdatePacket packet |
4046 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket( | ||
4047 | PacketType.ImprovedTerseObjectUpdate); | ||
4033 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 4048 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
4034 | packet.RegionData.TimeDilation = timeDilation; | 4049 | packet.RegionData.TimeDilation = timeDilation; |
4035 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | 4050 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; |
@@ -4037,7 +4052,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4037 | for (int i = 0; i < blocks.Count; i++) | 4052 | for (int i = 0; i < blocks.Count; i++) |
4038 | packet.ObjectData[i] = blocks[i]; | 4053 | packet.ObjectData[i] = blocks[i]; |
4039 | 4054 | ||
4040 | OutPacket(packet, ThrottleOutPacketType.Task, true); | 4055 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); }); |
4041 | } | 4056 | } |
4042 | 4057 | ||
4043 | #endregion Packet Sending | 4058 | #endregion Packet Sending |
@@ -4534,7 +4549,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4534 | { | 4549 | { |
4535 | returnblock[j] = new EstateOwnerMessagePacket.ParamListBlock(); | 4550 | returnblock[j] = new EstateOwnerMessagePacket.ParamListBlock(); |
4536 | } | 4551 | } |
4537 | j = 0; | 4552 | j = 0; |
4538 | 4553 | ||
4539 | returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++; | 4554 | returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++; |
4540 | returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++; | 4555 | returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++; |
@@ -5038,7 +5053,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5038 | Utils.UInt16ToBytes(Utils.FloatToUInt16(angularVelocity.Y, -64.0f, 64.0f), data, pos); pos += 2; | 5053 | Utils.UInt16ToBytes(Utils.FloatToUInt16(angularVelocity.Y, -64.0f, 64.0f), data, pos); pos += 2; |
5039 | Utils.UInt16ToBytes(Utils.FloatToUInt16(angularVelocity.Z, -64.0f, 64.0f), data, pos); pos += 2; | 5054 | Utils.UInt16ToBytes(Utils.FloatToUInt16(angularVelocity.Z, -64.0f, 64.0f), data, pos); pos += 2; |
5040 | 5055 | ||
5041 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock block = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); | 5056 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock block |
5057 | = PacketPool.Instance.GetDataBlock<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); | ||
5058 | |||
5042 | block.Data = data; | 5059 | block.Data = data; |
5043 | 5060 | ||
5044 | if (textureEntry != null && textureEntry.Length > 0) | 5061 | if (textureEntry != null && textureEntry.Length > 0) |
@@ -5288,14 +5305,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5288 | protected virtual void RegisterLocalPacketHandlers() | 5305 | protected virtual void RegisterLocalPacketHandlers() |
5289 | { | 5306 | { |
5290 | AddLocalPacketHandler(PacketType.LogoutRequest, HandleLogout); | 5307 | AddLocalPacketHandler(PacketType.LogoutRequest, HandleLogout); |
5308 | |||
5309 | // If AgentUpdate is ever handled asynchronously, then we will also need to construct a new AgentUpdateArgs | ||
5310 | // for each AgentUpdate packet. | ||
5291 | AddLocalPacketHandler(PacketType.AgentUpdate, HandleAgentUpdate, false); | 5311 | AddLocalPacketHandler(PacketType.AgentUpdate, HandleAgentUpdate, false); |
5312 | |||
5292 | AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect, false); | 5313 | AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect, false); |
5293 | AddLocalPacketHandler(PacketType.AgentCachedTexture, HandleAgentTextureCached, false); | 5314 | AddLocalPacketHandler(PacketType.AgentCachedTexture, HandleAgentTextureCached, false); |
5294 | AddLocalPacketHandler(PacketType.MultipleObjectUpdate, HandleMultipleObjUpdate, false); | 5315 | AddLocalPacketHandler(PacketType.MultipleObjectUpdate, HandleMultipleObjUpdate, false); |
5295 | AddLocalPacketHandler(PacketType.MoneyTransferRequest, HandleMoneyTransferRequest, false); | 5316 | AddLocalPacketHandler(PacketType.MoneyTransferRequest, HandleMoneyTransferRequest, false); |
5296 | AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest, false); | 5317 | AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest, false); |
5297 | AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest, false); | 5318 | AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest); |
5298 | AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest, false); | 5319 | AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest); |
5299 | AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage); | 5320 | AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage); |
5300 | AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest); | 5321 | AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest); |
5301 | AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 5322 | AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); |
@@ -5395,9 +5416,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5395 | AddLocalPacketHandler(PacketType.RemoveTaskInventory, HandleRemoveTaskInventory); | 5416 | AddLocalPacketHandler(PacketType.RemoveTaskInventory, HandleRemoveTaskInventory); |
5396 | AddLocalPacketHandler(PacketType.MoveTaskInventory, HandleMoveTaskInventory); | 5417 | AddLocalPacketHandler(PacketType.MoveTaskInventory, HandleMoveTaskInventory); |
5397 | AddLocalPacketHandler(PacketType.RezScript, HandleRezScript); | 5418 | AddLocalPacketHandler(PacketType.RezScript, HandleRezScript); |
5398 | AddLocalPacketHandler(PacketType.MapLayerRequest, HandleMapLayerRequest, false); | 5419 | AddLocalPacketHandler(PacketType.MapLayerRequest, HandleMapLayerRequest); |
5399 | AddLocalPacketHandler(PacketType.MapBlockRequest, HandleMapBlockRequest, false); | 5420 | AddLocalPacketHandler(PacketType.MapBlockRequest, HandleMapBlockRequest); |
5400 | AddLocalPacketHandler(PacketType.MapNameRequest, HandleMapNameRequest, false); | 5421 | AddLocalPacketHandler(PacketType.MapNameRequest, HandleMapNameRequest); |
5401 | AddLocalPacketHandler(PacketType.TeleportLandmarkRequest, HandleTeleportLandmarkRequest); | 5422 | AddLocalPacketHandler(PacketType.TeleportLandmarkRequest, HandleTeleportLandmarkRequest); |
5402 | AddLocalPacketHandler(PacketType.TeleportCancel, HandleTeleportCancel); | 5423 | AddLocalPacketHandler(PacketType.TeleportCancel, HandleTeleportCancel); |
5403 | AddLocalPacketHandler(PacketType.TeleportLocationRequest, HandleTeleportLocationRequest); | 5424 | AddLocalPacketHandler(PacketType.TeleportLocationRequest, HandleTeleportLocationRequest); |
@@ -5517,81 +5538,84 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5517 | 5538 | ||
5518 | #region Scene/Avatar | 5539 | #region Scene/Avatar |
5519 | 5540 | ||
5520 | private bool HandleAgentUpdate(IClientAPI sener, Packet Pack) | 5541 | private bool HandleAgentUpdate(IClientAPI sener, Packet packet) |
5521 | { | 5542 | { |
5522 | if (OnAgentUpdate != null) | 5543 | if (OnAgentUpdate != null) |
5523 | { | 5544 | { |
5524 | bool update = false; | 5545 | AgentUpdatePacket agentUpdate = (AgentUpdatePacket)packet; |
5525 | AgentUpdatePacket agenUpdate = (AgentUpdatePacket)Pack; | ||
5526 | 5546 | ||
5527 | #region Packet Session and User Check | 5547 | #region Packet Session and User Check |
5528 | if (agenUpdate.AgentData.SessionID != SessionId || agenUpdate.AgentData.AgentID != AgentId) | 5548 | if (agentUpdate.AgentData.SessionID != SessionId || agentUpdate.AgentData.AgentID != AgentId) |
5549 | { | ||
5550 | PacketPool.Instance.ReturnPacket(packet); | ||
5529 | return false; | 5551 | return false; |
5552 | } | ||
5530 | #endregion | 5553 | #endregion |
5531 | 5554 | ||
5532 | AgentUpdatePacket.AgentDataBlock x = agenUpdate.AgentData; | 5555 | bool update = false; |
5533 | 5556 | AgentUpdatePacket.AgentDataBlock x = agentUpdate.AgentData; | |
5534 | // We can only check when we have something to check | ||
5535 | // against. | ||
5536 | 5557 | ||
5537 | if (lastarg != null) | 5558 | if (m_lastAgentUpdateArgs != null) |
5538 | { | 5559 | { |
5560 | // These should be ordered from most-likely to | ||
5561 | // least likely to change. I've made an initial | ||
5562 | // guess at that. | ||
5539 | update = | 5563 | update = |
5540 | ( | 5564 | ( |
5541 | (x.BodyRotation != lastarg.BodyRotation) || | 5565 | (x.BodyRotation != m_lastAgentUpdateArgs.BodyRotation) || |
5542 | (x.CameraAtAxis != lastarg.CameraAtAxis) || | 5566 | (x.CameraAtAxis != m_lastAgentUpdateArgs.CameraAtAxis) || |
5543 | (x.CameraCenter != lastarg.CameraCenter) || | 5567 | (x.CameraCenter != m_lastAgentUpdateArgs.CameraCenter) || |
5544 | (x.CameraLeftAxis != lastarg.CameraLeftAxis) || | 5568 | (x.CameraLeftAxis != m_lastAgentUpdateArgs.CameraLeftAxis) || |
5545 | (x.CameraUpAxis != lastarg.CameraUpAxis) || | 5569 | (x.CameraUpAxis != m_lastAgentUpdateArgs.CameraUpAxis) || |
5546 | (x.ControlFlags != lastarg.ControlFlags) || | 5570 | (x.ControlFlags != m_lastAgentUpdateArgs.ControlFlags) || |
5547 | (x.ControlFlags != 0) || | 5571 | (x.ControlFlags != 0) || |
5548 | (x.Far != lastarg.Far) || | 5572 | (x.Far != m_lastAgentUpdateArgs.Far) || |
5549 | (x.Flags != lastarg.Flags) || | 5573 | (x.Flags != m_lastAgentUpdateArgs.Flags) || |
5550 | (x.State != lastarg.State) || | 5574 | (x.State != m_lastAgentUpdateArgs.State) || |
5551 | (x.HeadRotation != lastarg.HeadRotation) || | 5575 | (x.HeadRotation != m_lastAgentUpdateArgs.HeadRotation) || |
5552 | (x.SessionID != lastarg.SessionID) || | 5576 | (x.SessionID != m_lastAgentUpdateArgs.SessionID) || |
5553 | (x.AgentID != lastarg.AgentID) | 5577 | (x.AgentID != m_lastAgentUpdateArgs.AgentID) |
5554 | ); | 5578 | ); |
5555 | } | 5579 | } |
5556 | else | 5580 | else |
5557 | { | 5581 | { |
5582 | m_lastAgentUpdateArgs = new AgentUpdateArgs(); | ||
5558 | update = true; | 5583 | update = true; |
5559 | } | 5584 | } |
5560 | 5585 | ||
5561 | // These should be ordered from most-likely to | ||
5562 | // least likely to change. I've made an initial | ||
5563 | // guess at that. | ||
5564 | |||
5565 | if (update) | 5586 | if (update) |
5566 | { | 5587 | { |
5567 | // m_log.DebugFormat("[LLCLIENTVIEW]: Triggered AgentUpdate for {0}", sener.Name); | 5588 | // m_log.DebugFormat("[LLCLIENTVIEW]: Triggered AgentUpdate for {0}", sener.Name); |
5568 | 5589 | ||
5569 | AgentUpdateArgs arg = new AgentUpdateArgs(); | 5590 | m_lastAgentUpdateArgs.AgentID = x.AgentID; |
5570 | arg.AgentID = x.AgentID; | 5591 | m_lastAgentUpdateArgs.BodyRotation = x.BodyRotation; |
5571 | arg.BodyRotation = x.BodyRotation; | 5592 | m_lastAgentUpdateArgs.CameraAtAxis = x.CameraAtAxis; |
5572 | arg.CameraAtAxis = x.CameraAtAxis; | 5593 | m_lastAgentUpdateArgs.CameraCenter = x.CameraCenter; |
5573 | arg.CameraCenter = x.CameraCenter; | 5594 | m_lastAgentUpdateArgs.CameraLeftAxis = x.CameraLeftAxis; |
5574 | arg.CameraLeftAxis = x.CameraLeftAxis; | 5595 | m_lastAgentUpdateArgs.CameraUpAxis = x.CameraUpAxis; |
5575 | arg.CameraUpAxis = x.CameraUpAxis; | 5596 | m_lastAgentUpdateArgs.ControlFlags = x.ControlFlags; |
5576 | arg.ControlFlags = x.ControlFlags; | 5597 | m_lastAgentUpdateArgs.Far = x.Far; |
5577 | arg.Far = x.Far; | 5598 | m_lastAgentUpdateArgs.Flags = x.Flags; |
5578 | arg.Flags = x.Flags; | 5599 | m_lastAgentUpdateArgs.HeadRotation = x.HeadRotation; |
5579 | arg.HeadRotation = x.HeadRotation; | 5600 | m_lastAgentUpdateArgs.SessionID = x.SessionID; |
5580 | arg.SessionID = x.SessionID; | 5601 | m_lastAgentUpdateArgs.State = x.State; |
5581 | arg.State = x.State; | 5602 | |
5582 | UpdateAgent handlerAgentUpdate = OnAgentUpdate; | 5603 | UpdateAgent handlerAgentUpdate = OnAgentUpdate; |
5583 | UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate; | 5604 | UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate; |
5584 | lastarg = arg; // save this set of arguments for nexttime | 5605 | |
5585 | if (handlerPreAgentUpdate != null) | 5606 | if (handlerPreAgentUpdate != null) |
5586 | OnPreAgentUpdate(this, arg); | 5607 | OnPreAgentUpdate(this, m_lastAgentUpdateArgs); |
5608 | |||
5587 | if (handlerAgentUpdate != null) | 5609 | if (handlerAgentUpdate != null) |
5588 | OnAgentUpdate(this, arg); | 5610 | OnAgentUpdate(this, m_lastAgentUpdateArgs); |
5589 | 5611 | ||
5590 | handlerAgentUpdate = null; | 5612 | handlerAgentUpdate = null; |
5591 | handlerPreAgentUpdate = null; | 5613 | handlerPreAgentUpdate = null; |
5592 | } | 5614 | } |
5593 | } | 5615 | } |
5594 | 5616 | ||
5617 | PacketPool.Instance.ReturnPacket(packet); | ||
5618 | |||
5595 | return true; | 5619 | return true; |
5596 | } | 5620 | } |
5597 | 5621 | ||
@@ -5963,7 +5987,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5963 | msgpack.MessageBlock.ID, | 5987 | msgpack.MessageBlock.ID, |
5964 | msgpack.MessageBlock.Offline != 0 ? true : false, | 5988 | msgpack.MessageBlock.Offline != 0 ? true : false, |
5965 | msgpack.MessageBlock.Position, | 5989 | msgpack.MessageBlock.Position, |
5966 | msgpack.MessageBlock.BinaryBucket); | 5990 | msgpack.MessageBlock.BinaryBucket, |
5991 | true); | ||
5967 | 5992 | ||
5968 | handlerInstantMessage(this, im); | 5993 | handlerInstantMessage(this, im); |
5969 | } | 5994 | } |
@@ -6729,6 +6754,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6729 | #endregion | 6754 | #endregion |
6730 | 6755 | ||
6731 | m_udpClient.SetThrottles(atpack.Throttle.Throttles); | 6756 | m_udpClient.SetThrottles(atpack.Throttle.Throttles); |
6757 | GenericCall2 handler = OnUpdateThrottles; | ||
6758 | if (handler != null) | ||
6759 | { | ||
6760 | handler(); | ||
6761 | } | ||
6732 | return true; | 6762 | return true; |
6733 | } | 6763 | } |
6734 | 6764 | ||
@@ -9245,7 +9275,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9245 | } | 9275 | } |
9246 | #endregion | 9276 | #endregion |
9247 | 9277 | ||
9248 | switch (Utils.BytesToString(messagePacket.MethodData.Method)) | 9278 | string method = Utils.BytesToString(messagePacket.MethodData.Method); |
9279 | |||
9280 | switch (method) | ||
9249 | { | 9281 | { |
9250 | case "getinfo": | 9282 | case "getinfo": |
9251 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | 9283 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) |
@@ -9561,7 +9593,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9561 | return true; | 9593 | return true; |
9562 | 9594 | ||
9563 | default: | 9595 | default: |
9564 | m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket); | 9596 | m_log.WarnFormat( |
9597 | "[LLCLIENTVIEW]: EstateOwnerMessage: Unknown method {0} requested for {1} in {2}", | ||
9598 | method, Name, Scene.Name); | ||
9599 | |||
9600 | for (int i = 0; i < messagePacket.ParamList.Length; i++) | ||
9601 | { | ||
9602 | EstateOwnerMessagePacket.ParamListBlock block = messagePacket.ParamList[i]; | ||
9603 | string data = (string)Utils.BytesToString(block.Parameter); | ||
9604 | m_log.DebugFormat("[LLCLIENTVIEW]: Param {0}={1}", i, data); | ||
9605 | } | ||
9606 | |||
9565 | return true; | 9607 | return true; |
9566 | } | 9608 | } |
9567 | 9609 | ||
@@ -11870,8 +11912,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11870 | public void SetChildAgentThrottle(byte[] throttles) | 11912 | public void SetChildAgentThrottle(byte[] throttles) |
11871 | { | 11913 | { |
11872 | m_udpClient.SetThrottles(throttles); | 11914 | m_udpClient.SetThrottles(throttles); |
11915 | GenericCall2 handler = OnUpdateThrottles; | ||
11916 | if (handler != null) | ||
11917 | { | ||
11918 | handler(); | ||
11919 | } | ||
11920 | } | ||
11921 | |||
11922 | /// <summary> | ||
11923 | /// Sets the throttles from values supplied by the client | ||
11924 | /// </summary> | ||
11925 | /// <param name="throttles"></param> | ||
11926 | public void SetAgentThrottleSilent(int throttle, int setting) | ||
11927 | { | ||
11928 | m_udpClient.ForceThrottleSetting(throttle,setting); | ||
11929 | //m_udpClient.SetThrottles(throttles); | ||
11930 | |||
11873 | } | 11931 | } |
11874 | 11932 | ||
11933 | |||
11875 | /// <summary> | 11934 | /// <summary> |
11876 | /// Get the current throttles for this client as a packed byte array | 11935 | /// Get the current throttles for this client as a packed byte array |
11877 | /// </summary> | 11936 | /// </summary> |
@@ -11949,7 +12008,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11949 | logPacket = false; | 12008 | logPacket = false; |
11950 | 12009 | ||
11951 | if (DebugPacketLevel <= 50 | 12010 | if (DebugPacketLevel <= 50 |
11952 | & (packet.Type == PacketType.ImprovedTerseObjectUpdate || packet.Type == PacketType.ObjectUpdate)) | 12011 | && (packet.Type == PacketType.ImprovedTerseObjectUpdate || packet.Type == PacketType.ObjectUpdate)) |
11953 | logPacket = false; | 12012 | logPacket = false; |
11954 | 12013 | ||
11955 | if (DebugPacketLevel <= 25 && packet.Type == PacketType.ObjectPropertiesFamily) | 12014 | if (DebugPacketLevel <= 25 && packet.Type == PacketType.ObjectPropertiesFamily) |
@@ -12023,8 +12082,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12023 | 12082 | ||
12024 | if (!ProcessPacketMethod(packet)) | 12083 | if (!ProcessPacketMethod(packet)) |
12025 | m_log.Warn("[CLIENT]: unhandled packet " + packet.Type); | 12084 | m_log.Warn("[CLIENT]: unhandled packet " + packet.Type); |
12026 | |||
12027 | PacketPool.Instance.ReturnPacket(packet); | ||
12028 | } | 12085 | } |
12029 | 12086 | ||
12030 | private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) | 12087 | private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) |
@@ -12193,7 +12250,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12193 | { | 12250 | { |
12194 | Kick(reason); | 12251 | Kick(reason); |
12195 | Thread.Sleep(1000); | 12252 | Thread.Sleep(1000); |
12196 | Close(); | 12253 | Disconnect(); |
12197 | } | 12254 | } |
12198 | 12255 | ||
12199 | public void Disconnect() | 12256 | public void Disconnect() |
@@ -12481,7 +12538,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12481 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); | 12538 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); |
12482 | 12539 | ||
12483 | 12540 | ||
12484 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | 12541 | ImprovedTerseObjectUpdatePacket packet |
12542 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket( | ||
12543 | PacketType.ImprovedTerseObjectUpdate); | ||
12544 | |||
12485 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 12545 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
12486 | packet.RegionData.TimeDilation = timeDilation; | 12546 | packet.RegionData.TimeDilation = timeDilation; |
12487 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 12547 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |