diff options
author | John Hurliman | 2009-10-26 16:48:43 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-26 16:48:43 -0700 |
commit | 0b1726b524934c2020aaf2b1f130219fb87003fd (patch) | |
tree | aa65455b68e8b595876f3f54479d96ce749bdedb /OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |
parent | * Switched all operations on the list of clients that could be either sync or... (diff) | |
download | opensim-SC-0b1726b524934c2020aaf2b1f130219fb87003fd.zip opensim-SC-0b1726b524934c2020aaf2b1f130219fb87003fd.tar.gz opensim-SC-0b1726b524934c2020aaf2b1f130219fb87003fd.tar.bz2 opensim-SC-0b1726b524934c2020aaf2b1f130219fb87003fd.tar.xz |
Removing the ClientManager reference from IScene and hiding it entirely inside Scene as an implementation detail. This will reduce programming error and make it easier to refactor the avatar vs client vs presence mess later on
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index dee0a39..e3233da 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -583,10 +583,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
583 | 583 | ||
584 | // Determine which agent this packet came from | 584 | // Determine which agent this packet came from |
585 | IClientAPI client; | 585 | IClientAPI client; |
586 | if (!m_scene.ClientManager.TryGetValue(address, out client) || !(client is LLClientView)) | 586 | if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView)) |
587 | { | 587 | { |
588 | m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + | 588 | m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); |
589 | " in " + m_scene.RegionInfo.RegionName + ", currently tracking " + m_scene.ClientManager.Count + " clients"); | ||
590 | return; | 589 | return; |
591 | } | 590 | } |
592 | 591 | ||
@@ -764,8 +763,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
764 | { | 763 | { |
765 | // Create the LLUDPClient | 764 | // Create the LLUDPClient |
766 | LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint); | 765 | LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint); |
766 | IClientAPI existingClient; | ||
767 | 767 | ||
768 | if (!m_scene.ClientManager.ContainsKey(agentID)) | 768 | if (!m_scene.TryGetClient(agentID, out existingClient)) |
769 | { | 769 | { |
770 | // Create the LLClientView | 770 | // Create the LLClientView |
771 | LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); | 771 | LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); |
@@ -785,7 +785,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
785 | { | 785 | { |
786 | // Remove this client from the scene | 786 | // Remove this client from the scene |
787 | IClientAPI client; | 787 | IClientAPI client; |
788 | if (m_scene.ClientManager.TryGetValue(udpClient.AgentID, out client)) | 788 | if (m_scene.TryGetClient(udpClient.AgentID, out client)) |
789 | client.Close(); | 789 | client.Close(); |
790 | } | 790 | } |
791 | 791 | ||
@@ -877,7 +877,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
877 | 877 | ||
878 | // Handle outgoing packets, resends, acknowledgements, and pings for each | 878 | // Handle outgoing packets, resends, acknowledgements, and pings for each |
879 | // client. m_packetSent will be set to true if a packet is sent | 879 | // client. m_packetSent will be set to true if a packet is sent |
880 | m_scene.ClientManager.ForEachSync(clientPacketHandler); | 880 | m_scene.ForEachClient(clientPacketHandler, false); |
881 | 881 | ||
882 | // If nothing was sent, sleep for the minimum amount of time before a | 882 | // If nothing was sent, sleep for the minimum amount of time before a |
883 | // token bucket could get more tokens | 883 | // token bucket could get more tokens |
@@ -942,7 +942,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
942 | } | 942 | } |
943 | 943 | ||
944 | // Make sure this client is still alive | 944 | // Make sure this client is still alive |
945 | if (m_scene.ClientManager.TryGetValue(udpClient.AgentID, out client)) | 945 | if (m_scene.TryGetClient(udpClient.AgentID, out client)) |
946 | { | 946 | { |
947 | try | 947 | try |
948 | { | 948 | { |