private void processCommand(ActionEvent e) {
        synchronized (playerPawns) {
            String actionCmd = e.getActionCommand();
            int id = Character.getNumericValue(actionCmd.charAt(0));
            int cmd = Character.getNumericValue(actionCmd.charAt(1)); //get the command

            logEvent("RECEIVED CMD <" + actionCmd + "> id = " + id + "|| cmd = " + cmd);
            if (id < 0) { // add a new player .. when id is less than zero means id is not yet assigned
                try {
                    String playerIP = actionCmd.substring(3);
                    InetAddress ipAddr = InetAddress.getByName(playerIP);
                    PlayerPawn newPawn = new PlayerPawn(playerPawns.size(), ipAddr, mapModel);
                    Logger.writeLogFile("++++New player:" + newPawn.getId() + " @" + playerIP + " +++");
                    com.sendID(newPawn);
                    playerPawns.add(newPawn);
                    id = newPawn.getId();

                } catch (UnknownHostException ex) {
                    System.err.println(ex);
                    return;
                }
            } else if (cmd == 6) { // disconnect command
            	
            	try{	
	            	synchronized (playerPawns){
	            		
	            		playerPawns.get(id).setDeath();
	            		//playerPawns.get(id).
		                //playerPawns.remove(id);
		               // System.out.println("\tPlayer Left: " + id + "\n");
                                logEvent("---Player Left: " + id + " ---");        
	            	}
            	}catch(Exception z){
            		System.out.println("Couldn't disconnect player");
            	}
            	
            } else if (cmd == 7) { // list current players
                System.out.println(playerPawns.toArray());
            } else if (cmd == 5) { //do an action with the player
            	synchronized (playerPawns){
            		if (playerPawns.get(id).isDead()) {
                        logEvent("Player: " + id + " died");
                    } else {
                        playerPawns.get(id).action(cmd);
                    }
            	}
            } else {
            	synchronized (playerPawns){
            		 if (id >= playerPawns.size()) {
                         // TODO log it using logger
                         logEvent("***ID ERROR: " + id + " ***");
                         return;
                     }
                     playerPawns.get(id).action(cmd);
                     System.out.println("\n--RECEIVED CMD--\nPlayer: " + id + "\tCMD: " + cmd);
            	}     
            }
            com.send(findPlayerPawnById(id), 1, "8");  // send ACK

            //Currently there's an issue where if you move over to where someone died, you also die
            //this is due to the players x and y remaining on the board even after death, need to
            //change these to something like -1,-1, but this causes out of bounds errors

            //Code that checks for AI, player, interactions
            checkInteractions();
            updateAllPlayers();       
            checkDisconnections();
         
        }
    }