public void RequestLogout()
{
// No need to run the disconnect timer any more
if (DisconnectTimer != null) DisconnectTimer.Dispose();
// This will catch a Logout when the client is not logged in
if (CurrentSim == null || !connected)
{
Logger.Log("Ignoring RequestLogout(), client is already logged out", Helpers.LogLevel.Warning, Client);
return;
}
Logger.Log("Logging out", Helpers.LogLevel.Info, Client);
// Send a logout request to the current sim
LogoutRequestPacket logout = new LogoutRequestPacket();
logout.AgentData.AgentID = Client.Self.AgentID;
logout.AgentData.SessionID = Client.Self.SessionID;
SendPacket(logout);
}