本文整理汇总了C#中IScenePresence.RemoveAllInterfaces方法的典型用法代码示例。如果您正苦于以下问题:C# IScenePresence.RemoveAllInterfaces方法的具体用法?C# IScenePresence.RemoveAllInterfaces怎么用?C# IScenePresence.RemoveAllInterfaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScenePresence
的用法示例。
在下文中一共展示了IScenePresence.RemoveAllInterfaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveAgent
/// <summary>
/// Tell a single agent to disconnect from the region.
/// Does not send the DisableSimulator EQM or close child agents
/// </summary>
/// <param name="?"></param>
/// <param name="presence"></param>
/// <param name="forceClose"></param>
/// <returns></returns>
public bool RemoveAgent(IScenePresence presence, bool forceClose)
{
AddAsyncEvent(delegate
{
presence.ControllingClient.Close(forceClose);
foreach (IClientNetworkServer cns in m_clientServers)
cns.RemoveClient(presence.ControllingClient);
if (presence.ParentID != UUID.Zero)
presence.StandUp();
EventManager.TriggerOnClosingClient(presence.ControllingClient);
EventManager.TriggerOnRemovePresence(presence);
ForEachClient(
delegate(IClientAPI client)
{
if (client.AgentId != presence.UUID)
{
//We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway
try
{
client.SendKillObject(presence.Scene.RegionInfo.RegionHandle,
new IEntity[] {presence});
}
catch (NullReferenceException)
{
}
}
});
// Remove the avatar from the scene
m_sceneGraph.RemoveScenePresence(presence);
m_clientManager.Remove(presence.UUID);
try
{
presence.Close();
}
catch (Exception e)
{
MainConsole.Instance.Error(
"[SCENE] Scene.cs:RemoveClient:Presence.Close exception: " + e);
}
//Remove any interfaces it might have stored
presence.RemoveAllInterfaces();
AuthenticateHandler.RemoveCircuit(presence.UUID);
//MainConsole.Instance.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
//MainConsole.Instance.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
});
return true;
}
示例2: RemoveAgent
/// <summary>
/// Tell a single agent to disconnect from the region.
/// Does not send the DisableSimulator EQM or close child agents
/// </summary>
/// <param name="?"></param>
/// <returns></returns>
public bool RemoveAgent (IScenePresence presence)
{
presence.ControllingClient.Close ();
if (presence.ParentID != UUID.Zero)
{
presence.StandUp ();
}
EventManager.TriggerClientClosed (presence.UUID, this);
EventManager.TriggerOnClosingClient (presence.ControllingClient);
EventManager.TriggerOnRemovePresence (presence);
ForEachClient (
delegate (IClientAPI client)
{
//We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway
try { client.SendKillObject (presence.Scene.RegionInfo.RegionHandle, new IEntity[] { presence }); }
catch (NullReferenceException) { }
});
try
{
presence.Close ();
}
catch (Exception e)
{
m_log.Error ("[SCENE] Scene.cs:RemoveClient:Presence.Close exception: " + e.ToString ());
}
//Remove any interfaces it might have stored
presence.RemoveAllInterfaces ();
// Remove the avatar from the scene
m_sceneGraph.RemoveScenePresence (presence);
m_clientManager.Remove (presence.UUID);
AuthenticateHandler.RemoveCircuit (presence.ControllingClient.CircuitCode);
//m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
//m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
return true;
}