@Override public void run(int connID,String[] args){
  if (args.length == 1) {
    server.sendServerChat(connID,"Server Side nova command");
    server.sendServerChat(connID,"/nova print : will print all of your current nova networks and unlinked units.");
    server.sendServerChat(connID,"/nova print id : will print the network status for the Unit with ID id.");
    server.sendServerChat(connID,"/nova link id1 id2 : will link the units with ID id1 and id2.");
    server.sendServerChat(connID,"+++Will Disconnect them from all prior nets.");
    server.sendServerChat(connID,"/nova link id1 id2 id3 : will link the three units with ID id1 id2 and id3.");
    server.sendServerChat(connID,"+++Will Disconnect them from all prior nets.");
    server.sendServerChat(connID,"/nova unlink : will unlink all your novaCEWS units.");
    server.sendServerChat(connID,"/nova unlink id : will unlink unit with ID id from all nova networks.");
  }
  try {
    if (args.length > 1) {
      String cmd=args[1];
      if (cmd.equalsIgnoreCase("print")) {
        if (args.length > 2) {
          int id=Integer.parseInt(args[2]);
          server.sendServerChat(connID,strListNetwork(connID,id,true));
        }
 else {
          server.sendServerChat(connID,strListNetworks(connID,true));
        }
      }
 else       if (cmd.equalsIgnoreCase("printcurrent")) {
        if (args.length > 2) {
          int id=Integer.parseInt(args[2]);
          server.sendServerChat(connID,strListNetwork(connID,id,false));
        }
 else {
          server.sendServerChat(connID,strListNetworks(connID,false));
        }
      }
 else       if (cmd.equalsIgnoreCase("debug")) {
        debug(connID,server);
      }
 else       if (cmd.equalsIgnoreCase("link")) {
        if (args.length > 4) {
          int id1=Integer.parseInt(args[2]);
          int id2=Integer.parseInt(args[3]);
          int id3=Integer.parseInt(args[4]);
          server.sendServerChat(connID,strLink3(connID,id1,id2,id3));
        }
 else         if (args.length > 3) {
          int id1=Integer.parseInt(args[2]);
          int id2=Integer.parseInt(args[3]);
          server.sendServerChat(connID,strLink2(connID,id1,id2));
        }
      }
 else       if (cmd.equalsIgnoreCase("unlink")) {
        if (args.length > 2) {
          int id=Integer.parseInt(args[2]);
          server.sendServerChat(connID,strUnlinkID(connID,id));
        }
 else {
          server.sendServerChat(connID,strUnlinkAll(connID));
        }
      }
 else {
        String failstr=args[0];
        for (int i=1; i < args.length; i++) {
          failstr+=" " + args[i];
        }
        server.sendServerChat(connID,"I do not understand " + failstr + ". /nova for help.\n");
      }
    }
  }
 catch (  NumberFormatException nfe) {
    server.sendServerChat(connID,"Error parsing the command. NFE");
  }
catch (  NullPointerException npe) {
    server.sendServerChat(connID,"Error parsing the command. NPE");
  }
catch (  IndexOutOfBoundsException ioobe) {
    server.sendServerChat(connID,"Error parsing the command. IOOBE");
  }
}

@ Override public void run ( int connID , String [ ] args ) { if ( args . length == 1 ) { server . sendServerChat ( connID , "Server Side nova command" ) ; server . sendServerChat ( connID , "/nova print : will print all of your current nova networks and unlinked units." ) ; server . sendServerChat ( connID , "/nova print id : will print the network status for the Unit with ID id." ) ; server . sendServerChat ( connID , "/nova link id1 id2 : will link the units with ID id1 and id2." ) ; server . sendServerChat ( connID , "+++Will Disconnect them from all prior nets." ) ; server . sendServerChat ( connID , "/nova link id1 id2 id3 : will link the three units with ID id1 id2 and id3." ) ; server . sendServerChat ( connID , "+++Will Disconnect them from all prior nets." ) ; server . sendServerChat ( connID , "/nova unlink : will unlink all your novaCEWS units." ) ; server . sendServerChat ( connID , "/nova unlink id : will unlink unit with ID id from all nova networks." ) ; } try { if ( args . length > 1 ) { String cmd = args [ 1 ] ; if ( cmd . equalsIgnoreCase ( "print" ) ) { if ( args . length > 2 ) { int id = Integer . parseInt ( args [ 2 ] ) ; server . sendServerChat ( connID , strListNetwork ( connID , id , true ) ) ; } else { server . sendServerChat ( connID , strListNetworks ( connID , true ) ) ; } } else if ( cmd . equalsIgnoreCase ( "printcurrent" ) ) { if ( args . length > 2 ) { int id = Integer . parseInt ( args [ 2 ] ) ; server . sendServerChat ( connID , strListNetwork ( connID , id , false ) ) ; } else { server . sendServerChat ( connID , strListNetworks ( connID , false ) ) ; } } else if ( cmd . equalsIgnoreCase ( "debug" ) ) { debug ( connID , server ) ; } else if ( cmd . equalsIgnoreCase ( "link" ) ) { if ( args . length > 4 ) { int id1 = Integer . parseInt ( args [ 2 ] ) ; int id2 = Integer . parseInt ( args [ 3 ] ) ; int id3 = Integer . parseInt ( args [ 4 ] ) ; server . sendServerChat ( connID , strLink3 ( connID , id1 , id2 , id3 ) ) ; } else if ( args . length > 3 ) { int id1 = Integer . parseInt ( args [ 2 ] ) ; int id2 = Integer . parseInt ( args [ 3 ] ) ; server . sendServerChat ( connID , strLink2 ( connID , id1 , id2 ) ) ; } } else if ( cmd . equalsIgnoreCase ( "unlink" ) ) { if ( args . length > 2 ) { int id = Integer . parseInt ( args [ 2 ] ) ; server . sendServerChat ( connID , strUnlinkID ( connID , id ) ) ; } else { server . sendServerChat ( connID , strUnlinkAll ( connID ) ) ; } } else { String failstr = args [ 0 ] ; for ( int i = 1 ; i < args . length ; i ++ ) { failstr += " " + args [ i ] ; } server . sendServerChat ( connID , "I do not understand " + failstr + ". /nova for help.\n" ) ; } } } catch ( NumberFormatException nfe ) { server . sendServerChat ( connID , "Error parsing the command. NFE" ) ; } catch ( NullPointerException npe ) { server . sendServerChat ( connID , "Error parsing the command. NPE" ) ; } catch ( IndexOutOfBoundsException ioobe ) { server . sendServerChat ( connID , "Error parsing the command. IOOBE" ) ; } }
run this command with the arguments supplied
