Commit 98a7786c by 赵国君

快速开始

parent 04bd4be9
package com.qiwu.chatbotbackend.GameEnvironment;
public class Test {
public static void main(String[] args) throws Exception {
GameEnv gameEnv = new GameEnv("7011489633");
// System.out.println(gameEnv.queryNpcAttrByNpcName("武士", "热度"));
System.out.println(gameEnv.queryGlobalAttr("啦啦"));
}
}
......@@ -52,16 +52,17 @@ public class PlotConstructor2 extends ElementConstructor {
}
public void construct(JSONObject jsonObject, UserInfo userinfo) {
Integer startOption = jsonObject.getInteger("startOption");
try {
addGameStartPlot(jsonObject, keywordMap);
if(startOption != null && startOption.equals(2)) {
} else {
addGameStartPlot(jsonObject, keywordMap);
}
JSONArray plots = jsonObject.getJSONArray("plots");
String start = (String) jsonObject.get("start"), startCondition;
JSONObject returnMessage = null;
this.plots = plots;
constructAdjList(plots);
......@@ -737,10 +738,7 @@ public class PlotConstructor2 extends ElementConstructor {
jsonStr = jsonStr.replace("startId", gameElements.getString("start"));
jsonStr = jsonStr.replace("site_list", keywordMap.get("site_list").toString());
//System.out.println("JSONSTR ------------------------------\n" + jsonStr);
JSONObject config = JSONObject.parseObject(jsonStr);
gameElements.getJSONArray("plots").addAll(config.getJSONArray("gameStart"));
gameElements.put("start", "start1");
gameElements.put("firstUnknownText", GAME_START_HINT);
......
......@@ -829,7 +829,7 @@ public class ActionMatcher {
poster.postTerm(curInfoPoint, historyInfoPoint, ans, ansAction, url);
}else if(postType.equals("gameQA")){
System.out.println("提交表单" + gameEnv);
poster.postGameQA(curInfoPoint, historyInfoPoint, ans, gameEnv, worldController, url, userinfo);
poster.postGameQA(curInfoPoint, historyInfoPoint, ans, gameEnv, worldController, url, userinfo);
}
return ans;
......
package com.qiwu.chatbotbackend.servlet;
import com.alibaba.fastjson.JSONObject;
import com.qiwu.chatbotbackend.actiongenerate.DB.EngineUtils;
import com.qiwu.chatbotbackend.entity.Action;
import com.qiwu.chatbotbackend.entity.ChatCache;
import com.qiwu.chatbotbackend.entity.Solution;
......@@ -17,6 +18,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
......@@ -44,11 +46,29 @@ public class GetAnswerServlet extends HttpServlet {
if(tmpStr == null || tmpStr.equals(""))
continue;
tmpStr = tmpStr.replace("qiwu", "我");
//tmpStr = tmpStr.replace("qiwu", "你");
receiveParamters.put(entry.getKey(), tmpStr);
}
}
String botName = receiveParamters.get("bot_name");
/*
EngineUtils engineDBConn = null;
try {
engineDBConn = new EngineUtils();
String nickname = engineDBConn.queryBotNickNameByName(botName);
} catch (SQLException e1) {
e1.printStackTrace();
} finally {
engineDBConn.destroy();
}
Set<Entry<String, String>> entrySet2 = receiveParamters.entrySet();
for(Entry<String, String> entry : entrySet2) {
String value = entry.getValue();
if(value.indexOf("")) {
}
}
*/
Map<String ,String> curInfoPoint = new HashMap<String, String>();
Solution bestMatch = null;
......
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