示例#1
0
文件: CThread.java 项目: eiasy/DouPo
  public void run() {
    long currTime = System.currentTimeMillis();
    while (running) {
      try {
        currTime = System.currentTimeMillis();
        lastHeartbeat = currTime;
        if (heartbeat == null) {
          return;
        }
        heartbeat.run(currTime);
        if (currTime > logTime) {
          logTime = currTime + LOG_OFFSET;
          LogUtil.warn(getName());
        }

      } catch (Exception e) {
        LogUtil.error(getName() + "-事件线程抛出异常", e);
      }
      try {
        synchronized (this) {
          wait(SLEEP_TIME);
        }
      } catch (InterruptedException e) {
        LogUtil.error(getName() + "-sleep抛出异常", e);
      }
    }
    LogUtil.error(getName() + "线程退出");
    running = false;
  }
示例#2
0
 @Override
 public void run() {
   try {
     DALFactory.getInstRankDantaDAL().update(data, 0);
   } catch (Exception e) {
     LogUtil.error("更新当日丹塔排行数据异常", e);
   }
 }
示例#3
0
文件: CThread.java 项目: eiasy/DouPo
 public boolean isOvertime(long currTime) {
   boolean overtime = currTime - lastHeartbeat > OVERTIME;
   if (overtime) {
     LogUtil.error(
         (currTime - lastHeartbeat)
             + " , "
             + OVERTIME
             + " --ThreadOvertime "
             + this
             + ", "
             + getRunningName());
   }
   return overtime;
 }
示例#4
0
文件: ThingEnt.java 项目: eiasy/DouPo
 /**
  * 物品出售
  *
  * @author mp
  * @date 2014-8-4 上午10:04:05
  * @param msgMap
  * @param channelId @Description
  */
 public void sell(HashMap<String, Object> msgMap, String channelId) {
   try {
     HandlerFactory.getThingHandler().sell(msgMap, channelId);
   } catch (Exception e) {
     LogUtil.error(
         "instPlayerId = "
             + PlayerMapUtil.getPlayerIdByChannelId(channelId)
             + ", "
             + DictMap.sysMsgRuleMap.get((int) msgMap.get("header") + "").getName()
             + ",  "
             + msgMap,
         e);
     e.printStackTrace();
     MessageUtil.sendFailMsg(channelId, msgMap, errorHint(msgMap));
   }
 }