Search in sources :

Example 1 with MultiUserConsoleInput

use of com.biglybt.ui.console.multiuser.MultiUserConsoleInput in project BiglyBT by BiglySoftware.

the class UI method createNewConsoleInput.

/**
 * creates a new console input using the specified input/output streams.
 * we create the new input in non-controlling mode because we don't want the 'quit'
 * command to shut down the whole interface - simply this clients connection.
 * @param consoleName
 * @param inputStream
 * @param outputStream
 * @param profile
 */
public void createNewConsoleInput(String consoleName, InputStream inputStream, PrintStream outputStream, UserProfile profile) {
    ConsoleInput console;
    if (userManager != null) {
        MultiUserConsoleInput muc = new MultiUserConsoleInput(consoleName, core, new InputStreamReader(inputStream), outputStream, Boolean.FALSE, profile);
        muc.registerCommand(new UserCommand(userManager));
        console = muc;
    } else {
        console = new ConsoleInput(consoleName, core, new InputStreamReader(inputStream), outputStream, Boolean.FALSE, profile);
        System.out.println("TelnetUI: console input instantiated");
    }
    console.printwelcome();
    console.printconsolehelp();
}
Also used : UserCommand(com.biglybt.ui.console.multiuser.commands.UserCommand) InputStreamReader(java.io.InputStreamReader) MultiUserConsoleInput(com.biglybt.ui.console.multiuser.MultiUserConsoleInput) ConsoleInput(com.biglybt.ui.console.ConsoleInput) MultiUserConsoleInput(com.biglybt.ui.console.multiuser.MultiUserConsoleInput)

Aggregations

ConsoleInput (com.biglybt.ui.console.ConsoleInput)1 MultiUserConsoleInput (com.biglybt.ui.console.multiuser.MultiUserConsoleInput)1 UserCommand (com.biglybt.ui.console.multiuser.commands.UserCommand)1 InputStreamReader (java.io.InputStreamReader)1