Commit b8c7ebf6 by hxw2303632

add log code

parent 3de0160c
......@@ -72,6 +72,7 @@ public class GetAnswerServlet extends HttpServlet {
UserInfo userinfo = null;
UserInfoController uiController = new UserInfoController();
logWriter.record("query bot config", 0);
userinfo = uiController.userInfoQuery(request.getParameter("bot_name"), context);
......@@ -84,9 +85,14 @@ public class GetAnswerServlet extends HttpServlet {
if (userinfo.varInitialMap.get("botType") != null)
botType = userinfo.varInitialMap.get("botType");
logWriter.record("get chat cache start", 0);
chatCache = ChatCacheController.getChatCache(userKey, randKey, context, userinfo, botType);
logWriter.record("get chat cache complete", 0);
if (chatCache == null) {
throw (new Exception("chatCache初始化失败"));
}
......@@ -110,14 +116,19 @@ public class GetAnswerServlet extends HttpServlet {
break;
}
logWriter.record("form preprocessing", 0);
//针对不同游戏类型对信息点做预处理
debugFlag = botUtil.preprocessing(receiveParamters, context);
logWriter.record("action match start", 0);
//信息点预处理
ActionMatcher matcher = new ActionMatcher(curInfoPoint, logWriter, userinfo, context, botUtil);
logWriter.record("action match complete", 0);
/*得到答案更新信息点&生成答案,,清除超时会话数据, 转成json,输出*/
ansAction = matcher.getBestMatch(userinfo.conditionTable, context, userinfo);
if (state.equals("") && ansAction.getPriority() == -1)
......@@ -157,6 +168,7 @@ public class GetAnswerServlet extends HttpServlet {
matcher.infoTransfer(bestMatch, context, debugFlag);
logWriter.record("update chat cache start", 0);
ChatCacheController.updateChatCache4Insert(curInfoPoint, chatCache, context, userinfo);
//清理超时的用户数据
......@@ -167,6 +179,8 @@ public class GetAnswerServlet extends HttpServlet {
context.setAttribute("cacheUpdateTime", System.currentTimeMillis());
}
logWriter.record("update chat cache complete", 0);
ansJ = SimpleUtil.toJson(bestMatch);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment