Package marauroa.server.db.command

Examples of marauroa.server.db.command.DBCommand


  public void storeRPObject(RPObject player) throws SQLException, IOException {
    // And update the entry
    object = player;

    // We store the object in the database
    DBCommand command = new StoreCharacterCommand(username, character, player);
    DBCommandQueue.get().enqueue(command);
  }
View Full Code Here


      /*
       * Build player character list and send it to client
       */
      if (sendListOfCharacters) {
        DBCommand command = new LoadAllActiveCharactersCommand(username,
            new SendCharacterListHandler(netMan, protocolVersion), clientid, channel,
            protocolVersion);
        DBCommandQueue.get().enqueue(command);
      }
    } else {
View Full Code Here

   * @param msg MessageC2SChooseCharacter
   * @param clientid clientid
   * @param entry PlayerEntry
   */
  private void loadAndPlaceInWorld(MessageC2SChooseCharacter msg, int clientid, PlayerEntry entry) {
    DBCommand command = new LoadActiveCharacterCommand(entry.username, entry.character, this, clientid, msg.getSocketChannel(), msg.getProtocolVersion());
    DBCommandQueue.get().enqueue(command);
  }
View Full Code Here

      if (!isValidEvent(msg, entry, ClientState.CONNECTION_ACCEPTED)) {
        return;
      }

      SecuredLoginInfo info = fillLoginInfo(msg, entry);
      DBCommand command = new LoginCommand(info,
          this, entry.clientid,
          msg.getSocketChannel(), msg.getProtocolVersion());
      DBCommandQueue.get().enqueue(command);
  }
View Full Code Here

    msgServerInfo.setClientID(clientid);
    msgServerInfo.setProtocolVersion(protocolVersion);
    netMan.sendMessage(msgServerInfo);

    /* Build player character list and send it to client */
    DBCommand command = new LoadAllActiveCharactersCommand(entry.username,
        new SendCharacterListHandler(netMan, protocolVersion),
        clientid, channel, protocolVersion);
    DBCommandQueue.get().enqueue(command);

    entry.state = ClientState.LOGIN_COMPLETE;
View Full Code Here

    } else {
      activateGhostmode(player);
    }

    /* Notify database that the player is in Ghost mode */
    DBCommand command = new SetOnlineStatusCommand(player.getName(), !player.isGhost());
    DBCommandQueue.get().enqueue(command);

    /* Notify players about admin going into ghost mode. */
    StendhalRPRuleProcessor.get().notifyOnlineStatus(!player.isGhost(), player);
   
View Full Code Here

        getOnlinePlayers().add(player);

        if (!player.isGhost()) {
          notifyOnlineStatus(true, player);
          DBCommand command = new SetOnlineStatusCommand(player.getName(), true);
          DBCommandQueue.get().enqueue(command);
        }
        updatePlayerNameListForPlayersOnLogin(player);
        String[] params = {};
View Full Code Here

        updatePlayerNameListForPlayersOnLogout(player);

        Player.destroy(player);
        getOnlinePlayers().remove(player);

        DBCommand command = new SetOnlineStatusCommand(player.getName(), false);
        DBCommandQueue.get().enqueue(command);

        String[] params = {};
        new GameEvent(player.getName(), "logout", params).raise();
        logger.debug("removed player " + player);
View Full Code Here

        supported.notifyWorldAboutChanges();
        SingletonRepository.getRuleProcessor().sendMessageToSupporters(message);
       
      } else {
        // that player is not logged in. Do they exist at all or are they just offline? Try sending a message with postman.
        DBCommand command = new StoreMessageCommand(player.getName(), action.get(TARGET), "In answer to your support question:\n" + reply + " \nIf you wish to reply, use /support.", "S");
        DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
        TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
      }
    }
  }
View Full Code Here

        player.removeBuddy(duplicateName);
        new GameEvent(player.getName(), "buddy", "remove", duplicateName).raise();
      }

      // invoke the check for valid character names
      DBCommand command = new QueryCanonicalCharacterNamesCommand(player, player.getBuddies());
      DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
      TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
    }
  }
View Full Code Here

TOP

Related Classes of marauroa.server.db.command.DBCommand

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.