Package net.bnubot.util

Examples of net.bnubot.util.UnloggedException


  public static final Map<Connection, Vote> votes = new HashMap<Connection, Vote>();

  public CommandEventHandler(Profile profile) {
    super(profile);
    if(DatabaseContext.getContext() == null)
      throw new UnloggedException("Can not enable commands without a database!");
    initializeCommands();
  }
View Full Code Here


*/
public class GameTracker extends EventHandler {
  public GameTracker(Profile profile) {
    super(profile);
    if(DatabaseContext.getContext() == null)
      throw new UnloggedException("Can not enable game tracker without a database!");
    initializeCommands();
  }
View Full Code Here

  public static final long LOCKDOWN_DURATION = 5 * 60 * 1000; // 5 minutes

  public LockdownEventHandler(Profile profile) {
    super(profile);
    if(DatabaseContext.getContext() == null)
      throw new UnloggedException("Can not enable lockdown without a database!");
    initializeCommands();
  }
View Full Code Here

  }

  public TelnetEventHandler(Profile profile) {
    super(profile);
    if(initialized)
      throw new UnloggedException("You may only use the TelnetEventHandler once!");
    initialized = true;

    new Thread(this).start();
  }
View Full Code Here

public class MusicEventHandler extends EventHandler {

  public MusicEventHandler(Profile profile) {
    super(profile);
    if(DatabaseContext.getContext() == null)
      throw new UnloggedException("Can not enable commands without a database!");
    initializeCommands();
  }
View Full Code Here

    requireW3();

    if(inClan) {
      // The user must be in a clan
      if(myClan == null)
        throw new UnloggedException("You are not in a clan");
    } else {
      // The user must not be in a clan
      if(myClan != null)
        throw new UnloggedException("You are already in a clan");
    }
  }
View Full Code Here

  @Override
  public void sendClanInviteMultiple(Object cookie, String clanName, int clanTag, List<String> invitees) throws Exception {
    requireInClan(false);

    if(invitees.size() != 9)
      throw new UnloggedException("You should invite exactly 9 people");

    BNCSPacket p = new BNCSPacket(this, BNCSPacketId.SID_CLANINVITEMULTIPLE);
    p.writeDWord(CookieUtility.createCookie(cookie)); // Cookie
    p.writeNTString(clanName); // Clan name
    p.writeDWord(clanTag); // Clan tag
View Full Code Here

   */
  @Override
  public void sendClanInvitation(Object cookie, String user) throws Exception {
    requireInClan(true);
    if (myClanRank < 3)
      throw new UnloggedException("Must be " + clanRanks[3] + " or "
          + clanRanks[4] + " to invite");

    BNCSPacket p = new BNCSPacket(this, BNCSPacketId.SID_CLANINVITATION);
    p.writeDWord(CookieUtility.createCookie(cookie)); // Cookie
    p.writeNTString(user); // Username
View Full Code Here

  private boolean disposed = false;

  public TriviaEventHandler(Profile profile) {
    super(profile);
    if(DatabaseContext.getContext() == null)
      throw new UnloggedException("Can not enable trivia without a database!");
    initializeCommands();
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public DatabaseEditor(Class<T> clazz) throws Exception {
    context = DatabaseContext.getContext();
    if(context == null)
      throw new UnloggedException("No database is initialized");
    List<T> dataRows = context.performQuery(new SelectQuery(clazz));
    Collections.sort(dataRows);

    editorType = clazz.getSimpleName();
    jf.setTitle(editorType + " Editor");
View Full Code Here

TOP

Related Classes of net.bnubot.util.UnloggedException

Copyright © 2018 www.massapicom. 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.