Package net.cloudcodex.server

Examples of net.cloudcodex.server.Context


          ok = true;
        }
      }
    }
   
    return playerRollDices(new Context(context, rollerOwner), roller.getKey(),
      sceneKey, scene.getTimestamp(),
      dices, "A random dice roll !");
  }
View Full Code Here


      if(master == null){
        logger.severe("Master not found " + masterKey);
        context.addError(Errors.NOT_FOUND_USER, masterKey);
        return false;
      }
      context = new Context(context, master);
    }
   
    return deleteMessage(context, campaignId, sceneKey.getId(), messageId);
  }
View Full Code Here

      if(master == null){
        logger.severe("Master not found " + masterKey);
        context.addError(Errors.NOT_FOUND_USER, masterKey);
        return false;
      }
      context = new Context(context, master);
    }
   
    return insertMessage(context, campaignId, sceneKey.getId(), messageId,
        "This is a generated randomly inserted message");
  }
View Full Code Here

   * @return the context or null.
   */
  protected Context createContext() {
   
    final Data.User user = findCurrentUser();
    return new Context(user);
  }
View Full Code Here

   */
  @Override
  public Result<CampaignSummaryDTO> createCampaign(String name, String game,
      String description, String icon) {

    final Context context = createContext();
   
    final Data.Campaign campaign =
      campaignService.createCampaign(context, name, game,
          description, icon, context.getUser());

    final CampaignSummary summary = new CampaignSummary();
    summary.setCampaign(campaign);
    summary.setMaster(context.getUser());
    summary.setNotifications(null);
    summary.setCharacters(null);
   
    return createResult(context, DTOUtil.mapCampaignSummary(summary));
  }
View Full Code Here

  @Override
  public Result<CampaignSummaryDTO> updateCampaign(long campaignId,
      String name, String game,
      String description, String icon) {

    final Context context = createContext();
   
    final Data.Campaign campaign =
      campaignService.updateCampaign(context, campaignId, name, game,
          description, icon, context.getUser());

    final CampaignSummary summary = new CampaignSummary();
    summary.setCampaign(campaign);
    summary.setMaster(context.getUser());
    summary.setNotifications(null);
    summary.setCharacters(null);
   
    return createResult(context, DTOUtil.mapCampaignSummary(summary));
  }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Result<CharacterHeaderDTO> inviteToCampaign(long campaignId, String email, String name) {

    final Context context = createContext();
   
    final CharacterSDO character =
      campaignService.inviteToCampaign(context, campaignId, email, name);

    return createResult(context, DTOUtil.mapCharacterSDOToHeader(character, null));
View Full Code Here

   */
  @Override
  public Result<CharacterHeaderDTO> addNPC(long campaignId, String name,
      String description, String icon, boolean profile) {
   
    final Context context = createContext();
   
    final CharacterSDO character = campaignService.createNPC(
        context, campaignId, name, icon, description, profile);

    return createResult(context, DTOUtil.mapCharacterSDOToHeader(character, null));
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public Result<List<CharacterHeaderDTO>> getCampaignCharacters(long campaignId) {
    final Context context = createContext();
   
    final List<CharacterSDO> characters =
      campaignService.getCampaignCharacters(context, campaignId);
   
    if(characters == null) {
View Full Code Here

  @Override
  public Result<CharacterDescriptionDTO> getCharacterDescription(
      long campaignId, long characterId,
      Long byCharacterId, Date timestamp) {
   
    final Context context = createContext();

    final CharacterDescriptionSDO sdo = campaignService.getCharacterDescription(
        context, campaignId, characterId, byCharacterId, timestamp);
   
    final CharacterDescriptionDTO dto = DTOUtil.mapCharacterDescription(sdo);
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.