OpenSim.Region.Framework.Scenes.Scene.IncomingCloseAgent C# (CSharp) Method

IncomingCloseAgent() public method

Tell a single agent to disconnect from the region.
public IncomingCloseAgent ( UUID agentID ) : bool
agentID UUID
return bool
        public bool IncomingCloseAgent(UUID agentID)
        {
            //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);

            ScenePresence presence = m_sceneGraph.GetScenePresence(agentID);
            if (presence != null)
            {
                // Nothing is removed here, so down count it as such
                if (presence.IsChildAgent)
                {
                   m_sceneGraph.removeUserCount(false);
                }
                else
                {
                   m_sceneGraph.removeUserCount(true);
                }

                // Don't do this to root agents on logout, it's not nice for the viewer
                if (presence.IsChildAgent)
                {
                    // Tell a single agent to disconnect from the region.
                    IEventQueue eq = RequestModuleInterface<IEventQueue>();
                    if (eq != null)
                    {
                        eq.DisableSimulator(RegionInfo.RegionHandle, agentID);
                    }
                    else
                        presence.ControllingClient.SendShutdownConnectionNotice();
                }

                presence.ControllingClient.Close();
                return true;
            }

            // Agent not here
            return false;
        }

Usage Example

Ejemplo n.º 1
0
        public bool DeleteNPC(UUID agentID, Scene scene)
        {
            lock (m_avatars)
            {
                NPCAvatar av;
                if (m_avatars.TryGetValue(agentID, out av))
                {
                    /*
                    m_log.DebugFormat("[NPC MODULE]: Found {0} {1} to remove",
                            agentID, av.Name);
                    */

                    scene.IncomingCloseAgent(agentID, false);
//                    scene.RemoveClient(agentID, false);
                    m_avatars.Remove(agentID);
                    /*
                    m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}",
                            agentID, av.Name);
                    */
                    return true;
                }
            }
            /*
            m_log.DebugFormat("[NPC MODULE]: Could not find {0} to remove",
                    agentID);
            */
            return false;
        }
All Usage Examples Of OpenSim.Region.Framework.Scenes.Scene::IncomingCloseAgent
Scene