/// <summary> /// disconnect a client /// </summary> /// <param name="TRemote"></param> /// <param name="ConsoleInput"></param> public static void DisconnectClient(IServerAdminInterface TRemote, String ConsoleInput) { Int16 ClientID; String CantDisconnectReason; try { ClientID = System.Int16.Parse(ConsoleInput); if (TRemote.DisconnectClient(ClientID, out CantDisconnectReason)) { TLogging.Log("Client #" + ClientID.ToString() + ": disconnection will take place shortly."); } else { TLogging.Log("Client #" + ClientID.ToString() + " could not be disconnected on admin request. Reason: " + CantDisconnectReason); } } catch (System.FormatException) { Console.WriteLine(" Entered ClientID is not numeric!"); } catch (Exception exp) { TLogging.Log( Environment.NewLine + "Exception occured while trying to disconnect a Client on admin request:" + Environment.NewLine + exp.ToString()); } }