aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2009-07-01 15:47:52 +0000
committerMelanie Thielker2009-07-01 15:47:52 +0000
commit3564271c2d4f769361e36e2a10acbeb3e5f56bdf (patch)
tree5a9ff9a12a239aef2554b01b69c1094fd27725e9
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/Client/MXP/ClientStack/MXPClientView.cs5
-rw-r--r--OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs5
-rw-r--r--OpenSim/Framework/IClientAPI.cs9
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs5
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs95
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs5
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs5
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs5
10 files changed, 89 insertions, 52 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index 660bb3e..df1b4a3 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -1417,6 +1417,11 @@ namespace OpenSim.Client.MXP.ClientStack
1417 Session.Send(lrm); 1417 Session.Send(lrm);
1418 } 1418 }
1419 1419
1420 public EndPoint GetClientEP()
1421 {
1422 return null;
1423 }
1424
1420 public ClientInfo GetClientInfo() 1425 public ClientInfo GetClientInfo()
1421 { 1426 {
1422 return null; 1427 return null;
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
index 225ef69..c0c7625 100644
--- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
+++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
@@ -942,6 +942,11 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
942 throw new System.NotImplementedException(); 942 throw new System.NotImplementedException();
943 } 943 }
944 944
945 public EndPoint GetClientEP()
946 {
947 return null;
948 }
949
945 public ClientInfo GetClientInfo() 950 public ClientInfo GetClientInfo()
946 { 951 {
947 throw new System.NotImplementedException(); 952 throw new System.NotImplementedException();
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 2a81d5c..7c8b1aa 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1108,9 +1108,16 @@ namespace OpenSim.Framework
1108 void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message); 1108 void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message);
1109 1109
1110 void SendLogoutPacket(); 1110 void SendLogoutPacket();
1111 ClientInfo GetClientInfo(); 1111 EndPoint GetClientEP();
1112 1112
1113 // WARNING WARNING WARNING
1114 //
1115 // The two following methods are EXCLUSIVELY for the load balancer.
1116 // they cause a MASSIVE performance hit!
1117 //
1118 ClientInfo GetClientInfo();
1113 void SetClientInfo(ClientInfo info); 1119 void SetClientInfo(ClientInfo info);
1120
1114 void SetClientOption(string option, string value); 1121 void SetClientOption(string option, string value);
1115 string GetClientOption(string option); 1122 string GetClientOption(string option);
1116 void Terminate(); 1123 void Terminate();
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;
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 64af13d..c76d180 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -888,6 +888,11 @@ namespace OpenSim.Tests.Common.Mock
888 { 888 {
889 } 889 }
890 890
891 public EndPoint GetClientEP()
892 {
893 return null;
894 }
895
891 public ClientInfo GetClientInfo() 896 public ClientInfo GetClientInfo()
892 { 897 {
893 return null; 898 return null;