Esempio n. 1
0
  /**
   * 게임 접속
   *
   * @param param
   */
  public String gameJoin() {

    m_ifLogger.info("gameJoin start.");

    jsonParam.viewParamInfo();

    GameParam param = (GameParam) jsonParam;
    // GameService gameService = GameService.getInstance();
    HashMap<String, Object> map = new HashMap<String, Object>();

    try {

      param.setNgcIfId(StringUtils.decryptTripleDes(param.getNgcIfId()));
      param.setProductId(StringUtils.decryptTripleDes(param.getProductId()));
      param.setMdn(StringUtils.decryptTripleDes(param.getMdn()));

      m_ifLogger.info(
          "gameJoin paramInfo. getNgcIfId : "
              + param.getNgcIfId()
              + " , getProductId : "
              + param.getProductId()
              + " , getMdn : "
              + param.getMdn());

      UserParam userParam = new UserParam();
      userParam.setMdn(param.getMdn());
      UserVO userVo = new UserVO();
      userVo = UserService.getInstance().findUser(userParam);

      if (userVo != null) {
        // gameService.gameJoin(param);

        map.put("ngcIfId", param.getNgcIfId());
        map.put("result", ReturnCode.REQ_SUCCESS);
        map.put("userId", userVo.getUserId());
        map.put("nickname", userVo.getNickName());
        jsonResult = JSONObject.fromObject(map);
      } else {
        jsonResult = super.getResultErrorJSON(param.getNgcIfId(), ReturnCode.USER_NOT_REGISTER);
      }

    } catch (Exception e) {
      m_ifLogger.error(e.getMessage(), e);

      jsonResult = super.getResultErrorJSON(param.getNgcIfId(), ReturnCode.SYSTEM_ERROR);
      super.setMessage(e.getMessage());
    }

    m_ifLogger.info("gameJoin end. jsonResult : " + jsonResult.toString(2));

    return SUCCESS;
  }
Esempio n. 2
0
  /**
   * 게임종료
   *
   * @return
   */
  public String gameOut() {

    m_ifLogger.info("gameOut start.");

    jsonParam.viewParamInfo();

    GameParam param = (GameParam) jsonParam;
    // GameService gameService = GameService.getInstance();
    HashMap<String, Object> map = new HashMap<String, Object>();

    try {
      param.setNgcIfId(StringUtils.decryptTripleDes(param.getNgcIfId()));
      param.setProductId(StringUtils.decryptTripleDes(param.getProductId()));
      param.setMdn(StringUtils.decryptTripleDes(param.getMdn()));

      m_ifLogger.info(
          "gameOut paramInfo. getNgcIfId : "
              + param.getNgcIfId()
              + " , getProductId : "
              + param.getProductId()
              + " , getMdn : "
              + param.getMdn());

      // gameService.gameOut(param);

      map.put("ngcIfId", param.getNgcIfId());
      map.put("result", ReturnCode.REQ_SUCCESS);

      jsonResult = JSONObject.fromObject(map);

    } catch (Exception e) {
      m_ifLogger.error(e.getMessage(), e);

      jsonResult = super.getResultErrorJSON(param.getNgcIfId(), ReturnCode.SYSTEM_ERROR);
      super.setMessage(e.getMessage());
    }

    m_ifLogger.info("gameOut end. jsonResult : " + jsonResult.toString(2));

    return SUCCESS;
  }