Class MultiUserConsoleInput

  • All Implemented Interfaces:
    java.lang.Runnable

    public class MultiUserConsoleInput
    extends ConsoleInput
    subclass of the ConsoleInput object that is used for multi users. in this particular subclass, we replace some commands with our own versions and disable some commands.
    • Field Detail

      • adminCommands

        private java.util.List adminCommands
      • userCommands

        private java.util.List userCommands
    • Constructor Detail

      • MultiUserConsoleInput

        public MultiUserConsoleInput​(java.lang.String con,
                                     Core core,
                                     java.io.Reader _in,
                                     java.io.PrintStream _out,
                                     java.lang.Boolean _controlling,
                                     UserProfile profile)
        set up the lists of commands that we prohibit, based upon the user type.
        Parameters:
        con -
        core -
        _in -
        _out -
        _controlling -
        profile -
    • Method Detail

      • initialise

        protected void initialise()
        initialize our list of commands that need specific roles
        Overrides:
        initialise in class ConsoleInput
      • registerCommands

        protected void registerCommands()
        add some multi-user specific commands
        Overrides:
        registerCommands in class ConsoleInput
      • registerCommand

        public void registerCommand​(IConsoleCommand command)
        check whether the specified command is one of our banned commands for this particular user type. some commands are able to handle different user types, others are not relevant to anybody but admin
        Overrides:
        registerCommand in class ConsoleInput