Examples of BotOperator


Examples of wzhybridbots.security.BotOperator

        map.put( operator.getOperatorName(), operator );
      }
    }
    else {
      // Get the bot operator object in the container
      BotOperator oldOperator = (BotOperator)map.get( operator.getOperatorName() );
      if ( oldOperator == null ) { throw new NullPointerException(); }
     
      // Resolve the conflict
      BotOperator newOperator = resolver.resolveConflict( operator, oldOperator );
     
      // Keep the good bot operator
      remove( oldOperator );
      if ( newOperator != null ) {
        synchronized ( map ) {
          map.put( newOperator.getOperatorName(), newOperator );
        }
      }
    }
   
    return !alreadyIn;
View Full Code Here

Examples of wzhybridbots.security.BotOperator

    if ( resolver == null ) { throw new NullPointerException(); }
   
    // Iterate through one container and add everything to the other
    synchronized ( container ) {
      for ( Iterator iter = container.iterator() ; iter.hasNext() ; ) {
        BotOperator operator = (BotOperator)iter.next();
        add( operator );
      }
    }
  }
View Full Code Here

Examples of wzhybridbots.security.BotOperator

    if ( hmbo.size() != this.size() ) { return false; }
   
    synchronized ( hmbo ) {
      // Checks if every bot operator is the same in the 2 containers
      for ( Iterator iter = hmbo.iterator() ; iter.hasNext() ; ) {
        BotOperator bo = (BotOperator)iter.next();
        BotOperator co = this.get( bo );
     
        if ( !bo.equals( co ) ) { return false; }
      }
    }
   
View Full Code Here

Examples of wzhybridbots.security.BotOperator

   * @return The bot operator if remove successfully, null otherwise.
   */
  public BotOperator remove ( BotOperator operator ) {
    if ( operator == null ) { throw new NullPointerException(); }
   
    BotOperator retval = null;
    synchronized ( map ) {
      retval = (BotOperator)map.remove( operator.getOperatorName() );
    }
    return retval;
  }
View Full Code Here

Examples of wzhybridbots.security.BotOperator

    if ( isEmpty() || container.isEmpty() ) { return; }
   
    // Iterate through one container and remove everything to the other
    synchronized ( container ) {
      for ( Iterator iter = container.iterator() ; iter.hasNext() ; ) {
        BotOperator operator = (BotOperator)iter.next();
        remove( operator );
      }
    }
  }
View Full Code Here

Examples of wzhybridbots.security.BotOperator

   
    // Iterate through one container and check if the other
    // has the bot operator has well.
    synchronized ( container ) {
      for ( Iterator iter = container.iterator() ; iter.hasNext() ; ) {
        BotOperator operator = (BotOperator)iter.next();
        BotOperator oldOperator = get( operator );
     
        // Checks if the bot operator was in both container
        if ( oldOperator != null ) {
          // The operator is in both container
          BotOperator keep = resolver.resolveConflict( operator, oldOperator );
       
          if ( keep != null ) {
            // Add the operator
            map.put( keep.getOperatorName(), keep );
          }
        }
      }
    }
 
View Full Code Here

Examples of wzhybridbots.security.BotOperator

     * @param newOperator The first operator.
     * @param oldOperator The second operator.
     * @return The operator with the highest access level.
     */
    public BotOperator resolveConflict ( BotOperator newOperator, BotOperator oldOperator ) {
      BotOperator retval = oldOperator;
     
      // Keep the highest access level
      if ( newOperator.getAccessLevel() > oldOperator.getAccessLevel() ) {
        retval = newOperator;
      }
View Full Code Here

Examples of wzhybridbots.security.BotOperator

          // There is a bot operator name
          line = line.trim();
         
          if ( line.length() > 0 ) {
            // Create and add the bot operator to the container
            BotOperator op = new BotOperator( line, this.accessLevel );
            set.add( op );
          }
        }
       
        line = rd.readLine();
View Full Code Here

Examples of wzhybridbots.security.BotOperator

   */
  public boolean checkAccess ( String playerName ) {
    boolean hasAccess = false;
   
    // Check if the player has SysOp access
    BotOperator operator = new BotOperator( playerName );
    if ( this.objBotOperators.contains( operator ) ) {
      // The operator is register... let check his access level
      operator = this.objBotOperators.get( operator );
     
      // This isn't suppose to happen often, but still...
      if ( operator != null ) {
        hasAccess = operator.getAccessLevel() >= AccessLevel.SYSOP;
      }
    }
   
    return hasAccess;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.