Examples of BNetUser


Examples of net.bnubot.core.BNetUser

    assertEquals(u.getFullLogonName(), "testuser#2@USEast");
    assertEquals(u.getFullAccountName(), "testuser@USEast");
  }

  public void testDifferentRealmWithNumber() {
    BNetUser u = new BNetUser("testuser@Azeroth#2", "someone@USEast");
    assertEquals(u.getShortLogonName(), "testuser#2@Azeroth");
    assertEquals(u.getFullLogonName(), "testuser#2@Azeroth");
    assertEquals(u.getFullAccountName(), "testuser@Azeroth");
  }
View Full Code Here

Examples of net.bnubot.core.BNetUser

    assertEquals(u.getFullLogonName(), "testuser#2@Azeroth");
    assertEquals(u.getFullAccountName(), "testuser@Azeroth");
  }

  public void testDifferentRealmWithBothNumbers() {
    BNetUser u = new BNetUser("testuser#2@Azeroth", "someone#2@USEast");
    assertEquals(u.getShortLogonName(), "testuser#2@Azeroth");
    assertEquals(u.getFullLogonName(), "testuser#2@Azeroth");
    assertEquals(u.getFullAccountName(), "testuser@Azeroth");
  }
View Full Code Here

Examples of net.bnubot.core.BNetUser

    assertEquals(u.getFullLogonName(), "testuser#2@Azeroth");
    assertEquals(u.getFullAccountName(), "testuser@Azeroth");
  }

  public void testSameRealmWithBothNumbers() {
    BNetUser u = new BNetUser("testuser#2@USEast", "someone#2@USEast");
    assertEquals(u.getShortLogonName(), "testuser#2");
    assertEquals(u.getFullLogonName(), "testuser#2@USEast");
    assertEquals(u.getFullAccountName(), "testuser@USEast");
  }
View Full Code Here

Examples of net.bnubot.core.BNetUser

    assertEquals(u.getFullLogonName(), "testuser#2@USEast");
    assertEquals(u.getFullAccountName(), "testuser@USEast");
  }

  public void testSameRealmWithNumber2() {
    BNetUser u = new BNetUser("testuser@USEast", "someone#2@USEast");
    assertEquals(u.getShortLogonName(), "testuser");
    assertEquals(u.getFullLogonName(), "testuser@USEast");
    assertEquals(u.getFullAccountName(), "testuser@USEast");
  }
View Full Code Here

Examples of net.bnubot.core.BNetUser

        //  is.readDWord();  // Account number (defunct)
        //  is.readDWord(); // Registration authority (defunct)
          String username = is.readNTString();
          String text = is.readNTString();

          BNetUser user = null;
          switch(eid) {
          case BNCSChatEventIDs.EID_SHOWUSER:
          case BNCSChatEventIDs.EID_USERFLAGS:
          case BNCSChatEventIDs.EID_JOIN:
          case BNCSChatEventIDs.EID_LEAVE:
          case BNCSChatEventIDs.EID_TALK:
          case BNCSChatEventIDs.EID_EMOTE:
          case BNCSChatEventIDs.EID_WHISPERSENT:
          case BNCSChatEventIDs.EID_WHISPER:
            switch(productID) {
            case ProductIDs.PRODUCT_D2DV:
            case ProductIDs.PRODUCT_D2XP:
              int asterisk = username.indexOf('*');
              if(asterisk >= 0)
                username = username.substring(asterisk+1);
              break;
            }
           
            user = BNetUser.getBNetUser(username, cs.myRealm);
            user.setFlags(flags);
            user.setPing(ping);
            break;
          }
         
          switch(eid) {
          case BNCSChatEventIDs.EID_SHOWUSER:
View Full Code Here

Examples of net.bnubot.util.BNetUser

   * @param user "User[#N][@Realm]"
   * @param perspective The BNetUser whose realm to use if none is specified
   * @return A BNetUser representing the user
   */
  public BNetUser getCreateBNetUser(String user, BNetUser perspective) {
    BNetUser x = findUser(user, perspective);
    if(x != null)
      return x;
    return new BNetUser(this, user, perspective);
  }
View Full Code Here

Examples of net.bnubot.util.BNetUser

    Account subjectAccount = Account.get(accountName);
    if(subjectAccount != null)
      return subjectAccount;

    // They don't have an account by that name, check if it's a user
    BNetUser bnSubject = source.getCreateBNetUser(accountName, commander);

    subjectAccount = Account.get(bnSubject);
    if(subjectAccount != null)
      return subjectAccount;
View Full Code Here

Examples of net.bnubot.util.BNetUser

    String reason = params[0];
    if(params.length > 1)
      reason = params[1];

    if(isBan && (params[0].indexOf('*') == -1)) {
      BNetUser bnSubject = source.findUser(params[0], user);
      if(!canKickBan(user, bnSubject))
        throw new CommandFailedWithDetailsException("You may not kick or ban users who outrank you.");

      // Regular ban
      String out = (isBan) ? "/ban " : "/kick ";
      if(bnSubject != null)
        out += bnSubject.getFullLogonName();
      else
        out += params[0];
      out += " " + reason;

      // Send the command
View Full Code Here

Examples of net.bnubot.util.BNetUser

    if(votes.get(source) != null) {
      user.sendChat("There is already a vote in progress!", whisperBack);
      return;
    }

    BNetUser bnSubject = source.findUser(target, user);
    if(bnSubject == null) {
      user.sendChat("User not found", whisperBack);
      return;
    }
View Full Code Here

Examples of net.bnubot.util.BNetUser

    }
  }

  @Override
  public void friendsAdd(BNCSConnection source, FriendEntry friend) {
    BNetUser target = new BNetUser(source, friend.getAccount(), source.getMyUser());
    target.sendChat("You are logged in. You must add me to your friends list.", true);
  }
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.