aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorunknown2009-12-07 18:14:02 +0100
committerunknown2009-12-07 18:14:02 +0100
commitdbd8c400ce9eb9177bb9d0b939405578ad9c3157 (patch)
tree61daf67c74c14ad10147a115f7ef673c73968840 /OpenSim/Region/ClientStack
parentInitial windlight codebase commit (diff)
parentSame for the remote auth connector (diff)
downloadopensim-SC_OLD-dbd8c400ce9eb9177bb9d0b939405578ad9c3157.zip
opensim-SC_OLD-dbd8c400ce9eb9177bb9d0b939405578ad9c3157.tar.gz
opensim-SC_OLD-dbd8c400ce9eb9177bb9d0b939405578ad9c3157.tar.bz2
opensim-SC_OLD-dbd8c400ce9eb9177bb9d0b939405578ad9c3157.tar.xz
Merge branch 'careminster' into windlight
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs124
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs4
2 files changed, 99 insertions, 29 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 6cbf1a6..2b5e632 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -352,6 +352,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
352 private IHyperAssetService m_hyperAssets; 352 private IHyperAssetService m_hyperAssets;
353 private const bool m_checkPackets = true; 353 private const bool m_checkPackets = true;
354 354
355 private Timer m_propertiesPacketTimer;
356 private List<ObjectPropertiesPacket.ObjectDataBlock> m_propertiesBlocks = new List<ObjectPropertiesPacket.ObjectDataBlock>();
357
355 #endregion Class Members 358 #endregion Class Members
356 359
357 #region Properties 360 #region Properties
@@ -433,6 +436,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
433 m_udpClient.OnQueueEmpty += HandleQueueEmpty; 436 m_udpClient.OnQueueEmpty += HandleQueueEmpty;
434 m_udpClient.OnPacketStats += PopulateStats; 437 m_udpClient.OnPacketStats += PopulateStats;
435 438
439 m_propertiesPacketTimer = new Timer(100);
440 m_propertiesPacketTimer.Elapsed += ProcessObjectPropertiesPacket;
441
436 RegisterLocalPacketHandlers(); 442 RegisterLocalPacketHandlers();
437 } 443 }
438 444
@@ -3562,42 +3568,88 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3562 string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, 3568 string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask,
3563 uint BaseMask, byte saleType, int salePrice) 3569 uint BaseMask, byte saleType, int salePrice)
3564 { 3570 {
3565 ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); 3571 //ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
3566 // TODO: don't create new blocks if recycling an old packet 3572 // TODO: don't create new blocks if recycling an old packet
3567 3573
3568 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; 3574 ObjectPropertiesPacket.ObjectDataBlock block =
3569 proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); 3575 new ObjectPropertiesPacket.ObjectDataBlock();
3570 proper.ObjectData[0].ItemID = ItemID; 3576
3571 proper.ObjectData[0].CreationDate = CreationDate; 3577 block.ItemID = ItemID;
3572 proper.ObjectData[0].CreatorID = CreatorUUID; 3578 block.CreationDate = CreationDate;
3573 proper.ObjectData[0].FolderID = FolderUUID; 3579 block.CreatorID = CreatorUUID;
3574 proper.ObjectData[0].FromTaskID = FromTaskUUID; 3580 block.FolderID = FolderUUID;
3575 proper.ObjectData[0].GroupID = GroupUUID; 3581 block.FromTaskID = FromTaskUUID;
3576 proper.ObjectData[0].InventorySerial = InventorySerial; 3582 block.GroupID = GroupUUID;
3577 3583 block.InventorySerial = InventorySerial;
3578 proper.ObjectData[0].LastOwnerID = LastOwnerUUID; 3584
3585 block.LastOwnerID = LastOwnerUUID;
3579 // proper.ObjectData[0].LastOwnerID = UUID.Zero; 3586 // proper.ObjectData[0].LastOwnerID = UUID.Zero;
3580 3587
3581 proper.ObjectData[0].ObjectID = ObjectUUID; 3588 block.ObjectID = ObjectUUID;
3582 if (OwnerUUID == GroupUUID) 3589 if (OwnerUUID == GroupUUID)
3583 proper.ObjectData[0].OwnerID = UUID.Zero; 3590 block.OwnerID = UUID.Zero;
3584 else 3591 else
3585 proper.ObjectData[0].OwnerID = OwnerUUID; 3592 block.OwnerID = OwnerUUID;
3586 proper.ObjectData[0].TouchName = Util.StringToBytes256(TouchTitle); 3593 block.TouchName = Util.StringToBytes256(TouchTitle);
3587 proper.ObjectData[0].TextureID = TextureID; 3594 block.TextureID = TextureID;
3588 proper.ObjectData[0].SitName = Util.StringToBytes256(SitTitle); 3595 block.SitName = Util.StringToBytes256(SitTitle);
3589 proper.ObjectData[0].Name = Util.StringToBytes256(ItemName); 3596 block.Name = Util.StringToBytes256(ItemName);
3590 proper.ObjectData[0].Description = Util.StringToBytes256(ItemDescription); 3597 block.Description = Util.StringToBytes256(ItemDescription);
3591 proper.ObjectData[0].OwnerMask = OwnerMask; 3598 block.OwnerMask = OwnerMask;
3592 proper.ObjectData[0].NextOwnerMask = NextOwnerMask; 3599 block.NextOwnerMask = NextOwnerMask;
3593 proper.ObjectData[0].GroupMask = GroupMask; 3600 block.GroupMask = GroupMask;
3594 proper.ObjectData[0].EveryoneMask = EveryoneMask; 3601 block.EveryoneMask = EveryoneMask;
3595 proper.ObjectData[0].BaseMask = BaseMask; 3602 block.BaseMask = BaseMask;
3596 // proper.ObjectData[0].AggregatePerms = 53; 3603 // proper.ObjectData[0].AggregatePerms = 53;
3597 // proper.ObjectData[0].AggregatePermTextures = 0; 3604 // proper.ObjectData[0].AggregatePermTextures = 0;
3598 // proper.ObjectData[0].AggregatePermTexturesOwner = 0; 3605 // proper.ObjectData[0].AggregatePermTexturesOwner = 0;
3599 proper.ObjectData[0].SaleType = saleType; 3606 block.SaleType = saleType;
3600 proper.ObjectData[0].SalePrice = salePrice; 3607 block.SalePrice = salePrice;
3608
3609 lock (m_propertiesPacketTimer)
3610 {
3611 m_propertiesBlocks.Add(block);
3612
3613 int length = 0;
3614 foreach (ObjectPropertiesPacket.ObjectDataBlock b in m_propertiesBlocks)
3615 {
3616 length += b.Length;
3617 }
3618 if (length > 1100) // FIXME: use real MTU
3619 {
3620 ProcessObjectPropertiesPacket(null, null);
3621 m_propertiesPacketTimer.Stop();
3622 return;
3623 }
3624
3625 m_propertiesPacketTimer.Stop();
3626 m_propertiesPacketTimer.Start();
3627 }
3628
3629 //proper.Header.Zerocoded = true;
3630 //OutPacket(proper, ThrottleOutPacketType.Task);
3631 }
3632
3633 private void ProcessObjectPropertiesPacket(Object sender, ElapsedEventArgs e)
3634 {
3635 ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
3636
3637 lock (m_propertiesPacketTimer)
3638 {
3639 m_propertiesPacketTimer.Stop();
3640
3641 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count];
3642
3643 int index = 0;
3644
3645 foreach (ObjectPropertiesPacket.ObjectDataBlock b in m_propertiesBlocks)
3646 {
3647 proper.ObjectData[index++] = b;
3648 }
3649
3650 m_propertiesBlocks.Clear();
3651 }
3652
3601 proper.Header.Zerocoded = true; 3653 proper.Header.Zerocoded = true;
3602 OutPacket(proper, ThrottleOutPacketType.Task); 3654 OutPacket(proper, ThrottleOutPacketType.Task);
3603 } 3655 }
@@ -5504,6 +5556,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5504 5556
5505 if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId) 5557 if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId)
5506 { 5558 {
5559 // Linden Client limitation..
5560 if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f
5561 || avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f)
5562 {
5563 ScenePresence avatar = null;
5564 if (((Scene)m_scene).TryGetAvatar(AgentId, out avatar))
5565 {
5566 if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f)
5567 {
5568 avSetStartLocationRequestPacket.StartLocationData.LocationPos.X = avatar.AbsolutePosition.X;
5569 }
5570 if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f)
5571 {
5572 avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y = avatar.AbsolutePosition.Y;
5573 }
5574 }
5575
5576 }
5507 TeleportLocationRequest handlerSetStartLocationRequest = OnSetStartLocationRequest; 5577 TeleportLocationRequest handlerSetStartLocationRequest = OnSetStartLocationRequest;
5508 if (handlerSetStartLocationRequest != null) 5578 if (handlerSetStartLocationRequest != null)
5509 { 5579 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index 1e5f15a..55d9c9c 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -430,7 +430,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
430 // Send the packet 430 // Send the packet
431 m_udpServer.SendPacketFinal(nextPacket); 431 m_udpServer.SendPacketFinal(nextPacket);
432 m_nextPackets[i] = null; 432 m_nextPackets[i] = null;
433 packetSent = true; 433 packetSent = true;
434 this.PacketsSent++; 434 this.PacketsSent++;
435 } 435 }
436 } 436 }