diff options
author | Melanie Thielker | 2009-07-01 15:47:52 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-07-01 15:47:52 +0000 |
commit | 3564271c2d4f769361e36e2a10acbeb3e5f56bdf (patch) | |
tree | 5a9ff9a12a239aef2554b01b69c1094fd27725e9 /OpenSim/Region | |
parent | Update svn properties. (diff) | |
download | opensim-SC-3564271c2d4f769361e36e2a10acbeb3e5f56bdf.zip opensim-SC-3564271c2d4f769361e36e2a10acbeb3e5f56bdf.tar.gz opensim-SC-3564271c2d4f769361e36e2a10acbeb3e5f56bdf.tar.bz2 opensim-SC-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 'OpenSim/Region')
6 files changed, 66 insertions, 51 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 3813367..74a8874 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -9919,6 +9919,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9919 | return info; | 9919 | return info; |
9920 | } | 9920 | } |
9921 | 9921 | ||
9922 | public EndPoint GetClientEP() | ||
9923 | { | ||
9924 | return m_userEndPoint; | ||
9925 | } | ||
9926 | |||
9922 | public void SetClientInfo(ClientInfo info) | 9927 | public void SetClientInfo(ClientInfo info) |
9923 | { | 9928 | { |
9924 | m_PacketHandler.SetClientInfo(info); | 9929 | m_PacketHandler.SetClientInfo(info); |
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 | ||
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index f797dbc..5e33729 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -843,6 +843,11 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
843 | { | 843 | { |
844 | } | 844 | } |
845 | 845 | ||
846 | public EndPoint GetClientEP() | ||
847 | { | ||
848 | return null; | ||
849 | } | ||
850 | |||
846 | public ClientInfo GetClientInfo() | 851 | public ClientInfo GetClientInfo() |
847 | { | 852 | { |
848 | return null; | 853 | return null; |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 9002a21..8ec1780 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -1396,6 +1396,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1396 | Disconnect(); | 1396 | Disconnect(); |
1397 | } | 1397 | } |
1398 | 1398 | ||
1399 | public EndPoint GetClientEP() | ||
1400 | { | ||
1401 | return null; | ||
1402 | } | ||
1403 | |||
1399 | public ClientInfo GetClientInfo() | 1404 | public ClientInfo GetClientInfo() |
1400 | { | 1405 | { |
1401 | return new ClientInfo(); | 1406 | return new ClientInfo(); |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 0505fe8..228683e 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -855,6 +855,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
855 | { | 855 | { |
856 | } | 856 | } |
857 | 857 | ||
858 | public EndPoint GetClientEP() | ||
859 | { | ||
860 | return null; | ||
861 | } | ||
862 | |||
858 | public ClientInfo GetClientInfo() | 863 | public ClientInfo GetClientInfo() |
859 | { | 864 | { |
860 | return null; | 865 | return null; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 73c3e4c..7c878b8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -666,7 +666,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
666 | if (World.Entities.ContainsKey((UUID)agent) && World.Entities[avatarID] is ScenePresence) | 666 | if (World.Entities.ContainsKey((UUID)agent) && World.Entities[avatarID] is ScenePresence) |
667 | { | 667 | { |
668 | ScenePresence target = (ScenePresence)World.Entities[avatarID]; | 668 | ScenePresence target = (ScenePresence)World.Entities[avatarID]; |
669 | EndPoint ep = target.ControllingClient.GetClientInfo().userEP; | 669 | EndPoint ep = target.ControllingClient.GetClientEP(); |
670 | if (ep is IPEndPoint) | 670 | if (ep is IPEndPoint) |
671 | { | 671 | { |
672 | IPEndPoint ip = (IPEndPoint)ep; | 672 | IPEndPoint ip = (IPEndPoint)ep; |