public static void main(String[] args) {
           
		// default values
		int portNumber;
		String serverAddress;
		String userName;
                String password;
                
               
                if(args.length != 4)
                {
                    System.out.println("Usage: 127.0.0.1 1500 username password");
                }
                
                serverAddress = args[0];
                portNumber = Integer.parseInt(args[1]);
                userName = args[2];
                password = args[3];
                
                
                
		// create the Client object
		Client client = new Client(serverAddress, portNumber, userName, password);
		// test if we can start the connection to the Server
		// if it failed nothing we can do
		if(!client.start())
			return;
		
                
                //The user for this client.
             
                
		// wait for messages from user
		Scanner scan = new Scanner(System.in);
		// loop forever for message from the user
		while(true) {
			System.out.print("> ");
			// read message from user
			String msg = scan.nextLine();
			// logout if message is LOGOUT
			if(msg.equalsIgnoreCase("LOGOUT")) {
				client.sendMessage(new ChatMessage(ChatMessage.LOGOUT, ""));
				// break to do the disconnect
				break;
			}
			// message WhoIsIn
			else if(msg.equalsIgnoreCase("SEETEAM")) {
				client.sendMessage(new ChatMessage(ChatMessage.SEETEAM, ""));				
			}
                      
                        // ADD USER
			else if(msg.equalsIgnoreCase("ADDUSER")) {
                                System.out.print("ADD user: ");
                                String newUser = scan.nextLine();
				client.sendMessage(new ChatMessage(ChatMessage.ADDUSER, newUser));				
			}
                        else if(msg.equalsIgnoreCase("CHANGETYPE")) {
                                System.out.print("Enter username:type ");
                                String line = scan.nextLine();
				client.sendMessage(new ChatMessage(ChatMessage.CHANGETYPE, line));				
			}
                        else if(msg.equalsIgnoreCase("REMOVEUSER")) {
                                System.out.print("Enter username to remove");
                                String line = scan.nextLine();
				client.sendMessage(new ChatMessage(ChatMessage.REMOVEUSER, line));				
			}
                        else if(msg.equalsIgnoreCase("CHANGETEAM")) {
                                System.out.print("Enter team number");
                                String line = scan.nextLine();
				client.sendMessage(new ChatMessage(ChatMessage.CHANGETEAM, line));				
			}
			else {				// default to ordinary message
				client.sendMessage(new ChatMessage(ChatMessage.MESSAGE, msg));
			}
		}
		// done disconnect
		client.disconnect();	
	}