Example #1
0
 /**
  * eventList.jsp 상단 이벤트 메시지 출력
  *
  * @param
  * @return List
  * @throws
  */
 public String simpleEventMessage() {
   try {
     m_eventVO = EventService.getInstance().getSimpleEventNoticeList();
   } catch (EventServiceException e) {
     e.printStackTrace();
     m_traceLogger.error(e.getMessage());
     return ERROR;
   }
   return SUCCESS;
 }
Example #2
0
 public String selectEventDetailMessage() {
   String eid = getParameter("eid");
   try {
     m_eventVO = EventService.getInstance().getEventDetail(eid);
   } catch (EventServiceException e) {
     e.printStackTrace();
     m_traceLogger.error(e.getMessage());
     return ERROR;
   }
   return SUCCESS;
 }
Example #3
0
  /**
   * eventList.jsp 상단 이벤트 메시지리스트 출력
   *
   * @param
   * @return List
   * @throws
   */
  public String selectEventMessage() {
    try {
      String pageNum = StringUtils.nvlStr(getParameter("pg"), "1");

      EventParam param = new EventParam();
      param.setStartPos(pageNum);
      param.setReadCount("7");

      m_selectEventMessage = EventService.getInstance().getEventList(param);

      // 이벤트 목록 글씨제한
      DataMap dataMap = getDataMap();
      Integer lcdSizeWrap = (Integer) dataMap.get(DataMap.MAP_LCDSIZE);

      if (m_selectEventMessage != null && m_selectEventMessage.size() > 0) {
        for (int i = 0; i < m_selectEventMessage.size(); i++) {
          if (m_selectEventMessage.get(i) != null) {
            String eventTitle =
                CommUtils.checkNull(((EventVO) m_selectEventMessage.get(i)).getTitle(), "");
            String resultTitle = getTitleCutStringLimit(eventTitle, lcdSizeWrap);
            ((EventVO) m_selectEventMessage.get(i)).setTitle(resultTitle);
          }
        }
      }

      m_eventTotalCount = EventService.getInstance().getEventListTotalCount(param);

      HttpServletRequest request = getRequest();
      request.setAttribute("pg", pageNum);
      request.setAttribute("totalCount", String.valueOf(m_eventTotalCount));
    } catch (EventServiceException e) {
      e.printStackTrace();
      m_traceLogger.error(e.getMessage());
      return ERROR;
    }
    return SUCCESS;
  }
Example #4
0
  /**
   * gameMain.jsp 모두호출
   *
   * @param
   * @return List
   * @throws
   */
  public String gameMain() throws UserServiceException {

    m_traceLogger.info("gameMain() start......");

    // 인기게임 현재 페이지 번호
    String pGameCurPage = CommUtils.checkNull(getParameter("pGamePageNum"), "1");

    // 추천친구맺기에서 선택한 친구 ID
    String friendUserId = CommUtils.checkNull(getParameter("fid"));

    try {
      m_userVo = m_sessionManager.getUser(getRequest());

      DataMap dataMap = getDataMap();

      // 추천네트워크게임 param
      GameParam rGameParam = new GameParam();
      rGameParam.setLcdSize(DataMap.getLcdSizeValue(dataMap)); // LCD SIZE (176,240)
      rGameParam.setTouchSupport((String) dataMap.get(DataMap.MAP_TOUCH_SUPPORT)); // touch 지원여부
      rGameParam.setModel((String) dataMap.get(DataMap.MAP_DEVICE_MODEL)); // 단말 모델명

      // 인기게임 param
      GameParam pGameParam = new GameParam();
      pGameParam.setLcdSize(DataMap.getLcdSizeValue(dataMap)); // LCD SIZE (176,240)
      pGameParam.setTouchSupport((String) dataMap.get(DataMap.MAP_TOUCH_SUPPORT)); // touch 지원여부
      pGameParam.setModel((String) dataMap.get(DataMap.MAP_DEVICE_MODEL)); // 단말 모델명
      pGameParam.setStartPos(pGameCurPage);
      pGameParam.setReadCount(POPULARGAMELIST_READCOUNT); // 보여줄 인기게임목록 갯수

      // 단말기 lcd 사이즈 추출
      int lcdSize = getUserLCDSize(getRequest());

      if (DataMap.LCDSIZE_176 == lcdSize) { // 176size일 경우 추천 게임리스트 4개 노출
        rGameParam.setReadCount("4");
      } else if (DataMap.LCDSIZE_240 == lcdSize) { // 240size일 경우 추천 게임리스트 6개노출
        rGameParam.setReadCount("6");
      }

      // 인기게임리스트 count
      int totPopularGameCount = GameMainService.getInstance().getPopularGameListCount(pGameParam);

      // 인기게임리스트 이전, 다음페이지 구하기
      int popularGameReadCount = Integer.parseInt(POPULARGAMELIST_READCOUNT);
      int popularGameCurPage = Integer.parseInt(pGameCurPage);
      int popularGameTotalPageNum = totPopularGameCount / popularGameReadCount;
      if (totPopularGameCount % popularGameReadCount != 0) popularGameTotalPageNum++;

      // 전체 페이지가 현재 페이지보다 많다면 다음페이지 번호 입력
      if (popularGameTotalPageNum > popularGameCurPage) {
        m_nextPageNum = popularGameCurPage + 1;
      }

      // 현재 페이지가 1보다 크면 이전페이지 번호 입력
      if (popularGameCurPage > 1) {
        m_prevPageNum = popularGameCurPage - 1;
      }

      /* 인기게임리스트  */
      m_selectPopularGameList = GameMainService.getInstance().getPopularGameList(pGameParam);
      /* 추천게임리스트 */
      m_selectRecommandGameList = GameMainService.getInstance().getRecommandGameList(rGameParam);
      /* 이벤트 / 공지 */
      m_eventVO = EventService.getInstance().getSimpleEventNoticeList();
      /* 배너 이미지 */
      m_bannerImg = BannerService.getInstance().getSelectBannerImg();

      // 메인에 표시할 인기게임 제목 길이 제한
      if (m_selectPopularGameList != null) {
        for (int i = 0; i < m_selectPopularGameList.size(); i++) {
          Game gameTemp = (Game) m_selectPopularGameList.get(i);
          String popularGameTitle = CommUtils.checkNull(gameTemp.getTitle(), "");
          int cutStrLength = 0;
          if (dataMap != null) {
            Integer lcdSizeWrap = (Integer) dataMap.get(DataMap.MAP_LCDSIZE);
            if (lcdSizeWrap != null) {
              if (lcdSizeWrap.intValue() == DataMap.LCDSIZE_176) {
                cutStrLength = 6;
              } else if (lcdSizeWrap.intValue() == DataMap.LCDSIZE_240) {
                cutStrLength = 7;
              } else if (lcdSizeWrap.intValue() == DataMap.LCDSIZE_320) {
                cutStrLength = 7;
              }
              ((Game) m_selectPopularGameList.get(i))
                  .setTitle(StringUtils.cutStringLimitLength(popularGameTitle, cutStrLength));
            }
          }
        }
      }

      // 메인에 표시할 이벤트, 공지 제목 길이 제한
      if (m_eventVO != null) {
        String titleEventNotice = CommUtils.checkNull(m_eventVO.getTitle(), "");
        int cutStrLength = 0;
        if (dataMap != null) {
          Integer lcdSizeWrap = (Integer) dataMap.get(DataMap.MAP_LCDSIZE);
          if (lcdSizeWrap != null) {
            if (lcdSizeWrap.intValue() == DataMap.LCDSIZE_176) {
              cutStrLength = 8;
            } else if (lcdSizeWrap.intValue() == DataMap.LCDSIZE_240) {
              cutStrLength = 12;
            } else if (lcdSizeWrap.intValue() == DataMap.LCDSIZE_320) {
              cutStrLength = 12;
            }
            m_eventVO.setTitle(StringUtils.cutStringLimitLength(titleEventNotice, cutStrLength));
          }
        }
      } // end of if

      if (m_userVo != null) {
          /* 추천친구리스트 : 로그인 사용자 */
        Friend friendParam = new Friend();
        friendParam.setMyUserId(m_userVo.getUserId());
        friendParam.setFriendUserId(friendUserId);

        if (friendUserId.equals("")) {
          m_friendList = m_ngcIFController.getRecommandFriendList(m_userVo.getUserId());
        } else {
          // 추천친구리스트에 추가된 친구 추가
          m_friendList = m_ngcIFController.getGameMainFriend(friendParam);
        }

        // 알림이 가입여부 boolean
        if (m_userVo != null) {
          if (NGCConst.USER_NOTIFY_SETTING.equalsIgnoreCase(m_userVo.getNotify())) {
            m_isNotifyJoin = true;
          }
        }

      } else {
          /* 추천친구리스트 : 비로그인 사용자 */
        m_friendList = m_ngcIFController.getRecommandFriendList(null);
      }
    } catch (GameMainServiceException e) {
      m_traceLogger.error(e.getMessage());
      return ERROR;
    } catch (EventServiceException e) {
      m_traceLogger.error(e.getMessage());
      return ERROR;
    } catch (BannerServiceException e) {
      m_traceLogger.error(e.getMessage());
      return ERROR;
    } catch (FriendServiceException e) {
      m_traceLogger.error(e.getMessage());
      return ERROR;
    } catch (Exception e) {
      m_traceLogger.error(e.getMessage(), e);
      return ERROR;
    }

    m_traceLogger.info("gameMain() end......");

    return SUCCESS;
  }