public static void main(String[] args) {
        
        
        
        // parse command line arguments
        for (String arg : args) {
            if ("-s".equals(arg)){ // skip the login
                username = "root";
                permissions = 0;
            }
        }
        
        // temporary!!!
        username = "root";
        permissions = 0;
        // end temp
        
        log.writeLn("\n############################");
        log.writeLn("#       Chat Server        #");
        log.writeLn("#    Version: " + version + "      #");
        log.writeLn("############################\n");
        
        // init class
        ChatServer chat = new ChatServer();
        // set up commands
        
        if (username == null){
            for (int i=1; i<4;i++){
                if (i != 1){
                    log.writeLn("You have " + (4-i) + " chances left.");
                }
                if (chat.login()){
                    i=4;
                }
            }

            // exit program if username is wrong
            if (username == null) {
                log.writeErr("You have run out of chances.");
                System.exit(-1);
            }
        }
        
        // login success!!!
        log.writeLn("----------------------------\n");
        
        // either start set up the server and start that thread
        // or ask the user to type a command to start the server
        chat.startUp();
        
        while (!chat.server.isRunning()){
            log.flush();
        }
        
        chat.looper(); // start the command loop

        //while (chat.server.isRunning()){}
        
        chat.shutDown();
        log.writeLn("");
    }