From 0b1726b524934c2020aaf2b1f130219fb87003fd Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Mon, 26 Oct 2009 16:48:43 -0700
Subject: 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
---
OpenSim/Region/Framework/Scenes/Scene.cs | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 91367db..7eafef7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2482,7 +2482,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public override void AddNewClient(IClientAPI client)
{
- ClientManager.Add(client);
+ m_clientManager.Add(client);
CheckHeartbeat();
SubscribeToClientEvents(client);
@@ -3121,7 +3121,7 @@ namespace OpenSim.Region.Framework.Scenes
// Remove the avatar from the scene
m_sceneGraph.RemoveScenePresence(agentID);
- ClientManager.Remove(agentID);
+ m_clientManager.Remove(agentID);
try
{
@@ -4256,10 +4256,25 @@ namespace OpenSim.Region.Framework.Scenes
public void ForEachClient(Action action)
{
- if (m_useAsyncWhenPossible)
- ClientManager.ForEach(action);
+ ForEachClient(action, m_useAsyncWhenPossible);
+ }
+
+ public void ForEachClient(Action action, bool doAsynchronous)
+ {
+ if (doAsynchronous)
+ m_clientManager.ForEach(action);
else
- ClientManager.ForEachSync(action);
+ m_clientManager.ForEachSync(action);
+ }
+
+ public bool TryGetClient(UUID avatarID, out IClientAPI client)
+ {
+ return m_clientManager.TryGetValue(avatarID, out client);
+ }
+
+ public bool TryGetClient(System.Net.IPEndPoint remoteEndPoint, out IClientAPI client)
+ {
+ return m_clientManager.TryGetValue(remoteEndPoint, out client);
}
public void ForEachSOG(Action action)
--
cgit v1.1