}
// Check if the command exists
Command rsCommand = Command.get(command);
if(rsCommand == null)
throw new CommandDoesNotExistException(command);
//Reset the command to the case in the database
command = rsCommand.getName();
Account commanderAccount = Account.get(user);
if(!superUser) {
int commanderAccess = 0;
if(commanderAccount != null)
commanderAccess = commanderAccount.getAccess();
int requiredAccess = rsCommand.getAccess();
if(commanderAccess < requiredAccess)
throw new InsufficientAccessException("(" + commanderAccess + "/" + requiredAccess + ")", commanderAccess > 0);
}
CommandRunnable cr = Profile.getCommand(command);
if(cr == null) {
source.dispatchRecieveError("Command " + command + " has no associated runnable");
throw new CommandDoesNotExistException(command);
}
String[] params = null;
if(param != null)
params = param.split(" ");