Package net.cloudcodex.server

Examples of net.cloudcodex.server.Context


  @Override
  public Result<CompleteCharacterDescriptionDTO> getCharacterCompleteDescription(
      long campaignId, long characterId) {

    final Context context = createContext();
   
    final CompleteCharacterDescriptionDTO dto = new CompleteCharacterDescriptionDTO();

    // Get the header.
    final CharacterSDO character = campaignService.getCharacter(context, campaignId, characterId);
View Full Code Here


  public Result<CharacterDescriptionDTO> updateCharacterDescription(
      long campaignId, long characterId, Long byCharacterId,
      String description, String sheet, Boolean dead, Boolean locked,
      List<CharacterNoteDTO> notes, Map<Long, String> aliases) {
   
    final Context context = createContext();
   
    final Map<Long, String> map = new HashMap<Long, String>();
    for(CharacterNoteDTO note : notes) {
      if(note != null) {
        map.put(note.getAuthor(), note.getContent());
View Full Code Here

   */
  @Override
  public Result<List<SceneDTO>> getMessages(long campaignId, long characterId,
      Long lastSceneId, Date timestamp) {
   
    final Context context = createContext();
   
    final List<SceneSDO> scenes = messageService.getMessages(
        context, campaignId, characterId, lastSceneId, timestamp);

    if(scenes == null) {
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Result<Boolean> justForTestsDoSomethingRandomly(long campaignId, long characterId, int action) {
   
    final Context context = createContext();
    final boolean result;
    if(action == 0) {
      return justForTestsDoSomethingRandomly(campaignId, characterId, new Random().nextInt(6) + 1);
    } else if(action == 1) {
      result = messageService.justForTestsCreateSequenceRandomly(context, campaignId, characterId);
View Full Code Here

  public Result<Boolean> playerPostAction(
      long campaignId, long characterId,
      long clientSceneId, Date clientSceneTimestamp,
      MessageAction action, String content) {
   
    final Context context = createContext();
   
    final boolean result = messageService.playerPostAction(
        context, campaignId, characterId,
        clientSceneId, clientSceneTimestamp, action, content);
View Full Code Here

  public Result<Boolean> playerPostOFF(
      long campaignId, long characterId,
      long clientSceneId, Date clientSceneTimestamp,
      String content) {
   
    final Context context = createContext();
   
    final boolean result = messageService.playerPostOFF(
        context, campaignId, characterId,
        clientSceneId, clientSceneTimestamp, content);
View Full Code Here

  public Result<Boolean> playerRollDices(
      long campaignId, long characterId,
      long clientSceneId, Date clientSceneTimestamp,
      Map<Integer, Integer> dices, String content) {
   
    final Context context = createContext();
   
    final boolean result = messageService.playerRollDices(
        context, campaignId, characterId,
        clientSceneId, clientSceneTimestamp,
        dices, content);
View Full Code Here

  @Override
  public Result<Boolean> startScenes(long campaignId,
      SceneToCreateDTO[] scenesDTO) {
   
   
    final Context context = createContext();
 
    final SceneToCreateSDO[] scenes;
    if(scenesDTO == null) {
      scenes = null;
    } else {
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Result<HomeDTO> getHome() {
   
    final Context context = createContext();
    final Data.User user = context.getUser();

    if(user == null || user.getNickname() == null) {
      context.addError(Errors.NOT_REGISTERED);
      return createResult(context, null);
    }
   
    // Build the Home DTO
    final HomeDTO home = new HomeDTO();
View Full Code Here

   
    if(user.getGoogleId() == null) {
      user.setGoogleId(guser.getUserId());
    }
   
    final Context context = new Context(user);

    user = homeService.register(context, nickname);

    return createResult(context, user != null);
  }
View Full Code Here

TOP

Related Classes of net.cloudcodex.server.Context

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.