aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
diff options
context:
space:
mode:
authorMelanie Thielker2009-07-01 15:47:52 +0000
committerMelanie Thielker2009-07-01 15:47:52 +0000
commit3564271c2d4f769361e36e2a10acbeb3e5f56bdf (patch)
tree5a9ff9a12a239aef2554b01b69c1094fd27725e9 /OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
parentUpdate svn properties. (diff)
downloadopensim-SC_OLD-3564271c2d4f769361e36e2a10acbeb3e5f56bdf.zip
opensim-SC_OLD-3564271c2d4f769361e36e2a10acbeb3e5f56bdf.tar.gz
opensim-SC_OLD-3564271c2d4f769361e36e2a10acbeb3e5f56bdf.tar.bz2
opensim-SC_OLD-3564271c2d4f769361e36e2a10acbeb3e5f56bdf.tar.xz
Restore the functionality that was removed in r9928. This lets the load
balancer plugin work again. Create a new method, GetClientEP, to retrieve only the EndPoint for script usage. Marked the purpose of the method in IClientAPI.cs with a warning. Also restored the corresponding SetClientInfo functionality.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs95
1 files changed, 45 insertions, 50 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
index c0fb1c7..4b1a6b7 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
@@ -643,28 +643,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
643 { 643 {
644 ClientInfo info = new ClientInfo(); 644 ClientInfo info = new ClientInfo();
645 645
646 // nobody seems to even look at the following data. since 646 info.pendingAcks = m_PendingAcksMap;
647 // it's a rather expensive operation (lock, serializing 647 info.needAck = new Dictionary<uint, byte[]>();
648 // packets, copying it into dictionary, etc) i've
649 // commented out the expensive (but unwanted?) bits below
650 // (dr scofield, 2009-06-24)
651 648
652 // info.pendingAcks = m_PendingAcks; 649 lock (m_NeedAck)
653 // info.needAck = new Dictionary<uint, byte[]>(); 650 {
654 651 foreach (uint key in m_NeedAck.Keys)
655 // lock (m_NeedAck) 652 info.needAck.Add(key, m_NeedAck[key].Packet.ToBytes());
656 // { 653 }
657 // foreach (uint key in m_NeedAck.Keys)
658 // info.needAck.Add(key, m_NeedAck[key].Packet.ToBytes());
659 // }
660 654
661 // LLQueItem[] queitems = m_PacketQueue.GetQueueArray(); 655 LLQueItem[] queitems = m_PacketQueue.GetQueueArray();
662 656
663 // for (int i = 0; i < queitems.Length; i++) 657 for (int i = 0; i < queitems.Length; i++)
664 // { 658 {
665 // if (queitems[i].Incoming == false) 659 if (queitems[i].Incoming == false)
666 // info.out_packets.Add(queitems[i].Packet.ToBytes()); 660 info.out_packets.Add(queitems[i].Packet.ToBytes());
667 // } 661 }
668 662
669 info.sequence = m_Sequence; 663 info.sequence = m_Sequence;
670 664
@@ -683,37 +677,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP
683 677
684 public void SetClientInfo(ClientInfo info) 678 public void SetClientInfo(ClientInfo info)
685 { 679 {
686 // m_PendingAcks = info.pendingAcks; 680 m_PendingAcksMap = info.pendingAcks;
687 // m_NeedAck = new Dictionary<uint, LLQueItem>(); 681 m_PendingAcks = new List<uint>(m_PendingAcksMap.Keys);
688 682 m_NeedAck = new Dictionary<uint, LLQueItem>();
689 // Packet packet = null; 683
690 // int packetEnd = 0; 684 Packet packet = null;
691 // byte[] zero = new byte[3000]; 685 int packetEnd = 0;
692 686 byte[] zero = new byte[3000];
693 // foreach (uint key in info.needAck.Keys) 687
694 // { 688 foreach (uint key in info.needAck.Keys)
695 // byte[] buff = info.needAck[key]; 689 {
696 // packetEnd = buff.Length - 1; 690 byte[] buff = info.needAck[key];
697 691 packetEnd = buff.Length - 1;
698 // try 692
699 // { 693 try
700 // packet = PacketPool.Instance.GetPacket(buff, ref packetEnd, zero); 694 {
701 // } 695 packet = PacketPool.Instance.GetPacket(buff, ref packetEnd, zero);
702 // catch (Exception) 696 }
703 // { 697 catch (Exception)
704 // } 698 {
705 699 }
706 // LLQueItem item = new LLQueItem(); 700
707 // item.Packet = packet; 701 LLQueItem item = new LLQueItem();
708 // item.Incoming = false; 702 item.Packet = packet;
709 // item.throttleType = 0; 703 item.Incoming = false;
710 // item.TickCount = Environment.TickCount; 704 item.throttleType = 0;
711 // item.Identifier = 0; 705 item.TickCount = Environment.TickCount;
712 // item.Resends = 0; 706 item.Identifier = 0;
713 // item.Length = packet.Length; 707 item.Resends = 0;
714 // item.Sequence = packet.Header.Sequence; 708 item.Length = packet.Length;
715 // m_NeedAck.Add(key, item); 709 item.Sequence = packet.Header.Sequence;
716 // } 710 m_NeedAck.Add(key, item);
711 }
717 712
718 m_Sequence = info.sequence; 713 m_Sequence = info.sequence;
719 714