} catch (Exception ex) { ex.printStackTrace(); }
  protected void processChat(GameEvent ge) {    //this should be in a thread...    if (ge.getType() != GameEvent.GAME_PLAYER_CHAT) return;    if (this.getLocalPlayer() == null) return;    StringTokenizer st = new StringTokenizer(ge.getMessage(), ":");    if (st.hasMoreTokens()) {      String name = st.nextToken().trim();      //who is the message from?      Enumeration e = game.getPlayers();      boolean found = false;      Player p = null;      while (e.hasMoreElements() && !found) {        p = (Player)e.nextElement();        if (name.equalsIgnoreCase(p.getName())) {          found = true;        }      }      if (found) {        if (st.hasMoreTokens() && st.nextToken().trim().equalsIgnoreCase(this.getLocalPlayer().getName())) {          if (!p.isEnemyOf(this.getLocalPlayer())) {            if (st.hasMoreTokens()) {              String command = st.nextToken().trim();              boolean understood = false;              //should create a command factory and a command object...              if (command.equalsIgnoreCase("echo")) {                understood = true;              } if (command.equalsIgnoreCase("calm down")) {                Iterator i = this.getEntitiesOwned().iterator();                while (i.hasNext()) {                  CEntity cen = this.enemies.get((Entity)i.next());                  if (cen.strategy.attack > 1) {                    cen.strategy.attack = 1;                  }                }                understood = true;              } else if (command.equalsIgnoreCase("be aggressive")) {                Iterator i = this.getEntitiesOwned().iterator();                while (i.hasNext()) {                  CEntity cen = this.enemies.get((Entity)i.next());                  cen.strategy.attack = Math.min(cen.strategy.attack*1.2, 1.5);                }                understood = true;              }              if (understood) sendChat("Understood "+p.getName());            }          } else {            sendChat("I can't do that, "+p.getName());          }        }      }    }  }