Package marauroa.server.db

Examples of marauroa.server.db.DBTransaction


   * @return objectid
   * @throws IOException in case of an input/output error
   * @throws SQLException in case of an database error
   */
  public int storeRPObject(RPObject object) throws IOException, SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      int res = storeRPObject(transaction, object);
      return res;
    } finally {
      TransactionPool.get().commit(transaction);
View Full Code Here


   * @param source player name
   * @param event event type
   * @param params parameters
   */
  public void addGameEvent(String source, String event, String... params) {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      addGameEvent(transaction, source, event, params);
      TransactionPool.get().commit(transaction);
    } catch (SQLException e) {
      logger.error("Error adding game event: " + event, e);
View Full Code Here

  public PingRPRuleProcessor() {
    new DatabaseFactory().initializeDatabase();
    transactionPool = TransactionPool.get();
    world = BareRPWorld.get();

    DBTransaction transaction = transactionPool.beginWork();
    try {
      JDBCSQLHelper sql = new JDBCSQLHelper(transaction);
      sql.runDBScript("marauroa/test/clear.sql");
      sql.runDBScript("marauroa/server/marauroa_init.sql");
      transactionPool.commit(transaction);
View Full Code Here

  /**
   * Create an account for a player.
   */
  public AccountResult createAccount(String username, String password, String email) {
    DBTransaction transaction = transactionPool.beginWork();
    try {
      if (DAORegister.get().get(AccountDAO.class).hasPlayer(transaction, username)) {
        logger.warn("Account already exist: " + username);
        transactionPool.commit(transaction);
        return new AccountResult(Result.FAILED_PLAYER_EXISTS, username);
View Full Code Here

  /**
   * Create a character for a player
   */
  public CharacterResult createCharacter(String username, String character, RPObject template) {
    DBTransaction transaction = transactionPool.beginWork();
    try {
      /*
       * We filter too short character names.
       */
      if(character.length()<4) {
View Full Code Here

   * @param player RPObject of the player
   * @throws IOException in case of an input/output error
   * @throws SQLException in case of an database error
   */
  public void addCharacter(String username, String character, RPObject player) throws SQLException, IOException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      addCharacter(transaction, username, character, player);
    } finally {
      TransactionPool.get().commit(transaction);
    }
View Full Code Here

   * @param character name of character
   * @return true, if the character was deleted, false if it did not exist
   * @throws SQLException in case of an database error
   */
  public boolean removeCharacter(String username, String character) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      boolean res = removeCharacter(transaction, username, character);
      return res;
    } finally {
      TransactionPool.get().commit(transaction);
View Full Code Here

   * @param character name of character
   * @return true, if the character exists and belongs to the account; false otherwise
   * @throws SQLException in case of an database error
   */
  public boolean hasCharacter(String character) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      boolean res = hasCharacter(transaction, character);
      return res;
    } finally {
      TransactionPool.get().commit(transaction);
View Full Code Here

   * @param character name of character
   * @return true, if the character exists and belongs to the account; false otherwise
   * @throws SQLException in case of an database error
   */
  public boolean hasCharacter(String username, String character) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      boolean res = hasCharacter(transaction, username, character);
      return res;
    } finally {
      TransactionPool.get().commit(transaction);
View Full Code Here

   * @param character name of character
   * @return true, if the character exists and belongs to the account; false otherwise
   * @throws SQLException in case of an database error
   */
  public boolean hasActiveCharacter(String username, String character) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      boolean res = hasActiveCharacter(transaction, username, character);
      return res;
    } finally {
      TransactionPool.get().commit(transaction);
View Full Code Here

TOP

Related Classes of marauroa.server.db.DBTransaction

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.