Пример #1
0
  public void flagAsSaved() {

    WorldDataHolder testSource = getDataSource();
    String source;

    if (testSource == null) {
      source = "GlobalGroups";
    } else {
      source = testSource.getName();
    }

    GroupManager.logger.log(
        Level.FINEST,
        "DataSource: {0} - DataUnit: {1} flagged as saved!",
        new String[] {source, getUUID()});
    changed = false;
  }
Пример #2
0
  /**
   * Use this to deliver a user from one WorldDataHolder to another
   *
   * @param dataSource
   * @return null if given dataSource already contains the same user
   */
  public User clone(WorldDataHolder dataSource) {

    if (dataSource.isUserDeclared(this.getName())) {
      return null;
    }
    User clone = dataSource.createUser(this.getName());
    if (dataSource.getGroup(group) == null) {
      clone.setGroup(dataSource.getDefaultGroup());
    } else {
      clone.setGroup(dataSource.getGroup(this.getGroupName()));
    }
    for (String perm : this.getPermissionList()) {
      clone.addPermission(perm);
    }
    clone.variables = this.variables.clone(this);
    clone.flagAsChanged();
    return clone;
  }
Пример #3
0
  public void flagAsChanged() {

    WorldDataHolder testSource = getDataSource();
    String source;

    if (testSource == null) {
      source = "GlobalGroups";
    } else {
      source = testSource.getName();
    }

    GroupManager.logger.log(
        Level.FINEST,
        "DataSource: {0} - DataUnit: {1} flagged as changed!",
        new String[] {source, getUUID()});
    // for(StackTraceElement st: Thread.currentThread().getStackTrace()){
    // GroupManager.logger.finest(st.toString());
    // }
    sorted = false;
    changed = true;
  }
Пример #4
0
  /** @param name */
  public User(WorldDataHolder source, String name) {

    super(source, name);
    this.group = source.getDefaultGroup().getName();
  }