示例#1
0
  public String offline(String message) {
    RequestReader reader = new RequestReader(message);
    String ticket = reader.getString("Request/Ticket", false);
    Integer kickFlag = reader.getInteger("Request/KickFlag", true);

    OnlineReal onlineReal = onlineManager.getOnlineReal(ticket);
    if (null != onlineReal) {
      if (logger.isDebugEnabled()) {
        logger.debug("Offline Ticket[" + ticket + "]");
      }
      onlineManager.offline(onlineReal, kickFlag);
    }

    Document doc = XmlUtil.generateResponse("Offline", ErrorCode.SUCCESS, "");
    return XmlUtil.xmlToString(doc);
  }
示例#2
0
  public Object loginOut(HttpServletRequest request) {
    SimpleRequestReader reader = new SimpleRequestReader(request);
    Integer kickFlag = reader.getInteger("kickFlag", true);
    String ticket = (String) request.getSession().getAttribute("ticket");
    // kickFlag默认为0正常退出
    if (null == kickFlag) {
      kickFlag = 0;
    }

    OnlineReal onlineReal = onlineManager.getOnlineReal(ticket);
    if (null != onlineReal) {
      if (logger.isDebugEnabled()) {
        logger.debug("Offline Ticket[" + ticket + "]");
      }
      onlineManager.offline(onlineReal, kickFlag);
    }

    BaseDTO dto = new BaseDTO();
    dto.setCode(ErrorCode.SUCCESS);
    dto.setMessage("");
    dto.setMethod("LoginOut");

    return dto;
  }