From 23a334b9f54a1ef5df3b503c165e7b76b746a2b1 Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Tue, 13 Oct 2009 14:50:03 -0700
Subject: * Rewrote ClientManager to remove Lindenisms from OpenSim core,
improve performance by removing locks, and replace LLUDPClientCollection *
Removed the confusing (and LL-specific) shutdowncircuit parameter from
IClientAPI.Close() * Updated the LLUDP code to only use ClientManager instead
of trying to synchronize ClientManager and m_clients * Remove clients
asynchronously since it is a very slow operation (including a 2000ms sleep)
---
OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Gods')
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index f941728..7855862 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -36,6 +36,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
{
public class GodsModule : IRegionModule, IGodsModule
{
+ /// Special UUID for actions that apply to all agents
+ private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb");
+
protected Scene m_scene;
protected IDialogModule m_dialogModule;
@@ -99,8 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
/// The message to send to the user after it's been turned into a field
public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason)
{
- // For some reason the client sends this seemingly hard coded UUID for kicking everyone. Dun-know.
- UUID kickUserID = new UUID("44e87126e7944ded05b37c42da3d5cdb");
+ UUID kickUserID = ALL_AGENTS;
ScenePresence sp = m_scene.GetScenePresence(agentID);
@@ -110,15 +112,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
{
if (agentID == kickUserID)
{
- m_scene.ClientManager.ForEachClient(
+ string reasonStr = Utils.BytesToString(reason);
+
+ m_scene.ClientManager.ForEach(
delegate(IClientAPI controller)
{
if (controller.AgentId != godID)
- controller.Kick(Utils.BytesToString(reason));
+ controller.Kick(reasonStr);
}
);
- // This is a bit crude. It seems the client will be null before it actually stops the thread
+ // This is a bit crude. It seems the client will be null before it actually stops the thread
// The thread will kill itself eventually :/
// Is there another way to make sure *all* clients get this 'inter region' message?
m_scene.ForEachScenePresence(
@@ -128,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
{
// Possibly this should really be p.Close() though that method doesn't send a close
// to the client
- p.ControllingClient.Close(true);
+ p.ControllingClient.Close();
}
}
);
@@ -138,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent);
sp.ControllingClient.Kick(Utils.BytesToString(reason));
- sp.ControllingClient.Close(true);
+ sp.ControllingClient.Close();
}
}
else
--
cgit v1.1