diff --git a/config.properties b/config.properties index 9f2b97e..36841d8 100644 --- a/config.properties +++ b/config.properties @@ -1,23 +1,23 @@ # ## qa问答地址 -#qa_url=http://192.168.1.78:59000/game +qa_url=http://192.168.1.78:59000/game # ## 中控url -#cc_url=http://localhost:8070/api/update/data +cc_url=http://localhost:8070/api/update/data # ## condition后台url -#condition_backend_url=http://192.168.1.82:6636/api +condition_backend_url=http://192.168.1.82:6636/api # ## action生成指定的后台地址 -#service_url=http://192.168.1.178:8081/bot/dialog +service_url=http://192.168.1.111:8081/bot/dialog -qa_url=http://localhost:59100/game -cc_url=http://localhost:8070/api/update/data -condition_backend_url=http://localhost:6636/api -service_url=http://localhost:8081/bot/dialog +# qa_url=http://localhost:59100/game +# cc_url=http://localhost:8070/api/update/data +# condition_backend_url=http://localhost:6636/api +# service_url=http://localhost:8081/bot/dialog chatcache_time_out=300000 @@ -64,6 +64,8 @@ star_plot_not_exist=开始剧情不存在,请到剧情列表设置 assistant=globalVariable_智能助手 unknown_counter_name=globalVariable_无匹配次数 +plot_random_num=globalVariable_剧情随机数 + # ------------------------助手情绪-------------- assistant_emotion=正常 diff --git a/src/main/java/com/qiwu/chatbotbackend/Config/Config.java b/src/main/java/com/qiwu/chatbotbackend/Config/Config.java index 1d7396a..4a27812 100644 --- a/src/main/java/com/qiwu/chatbotbackend/Config/Config.java +++ b/src/main/java/com/qiwu/chatbotbackend/Config/Config.java @@ -188,7 +188,5 @@ public class Config { public static String SCRIPT_ALL_IN_PLACE = null; //script_item_intro - - - + public static String PLOT_RANDOM_NUM = null; } diff --git a/src/main/java/com/qiwu/chatbotbackend/actiongenerate/utils/ActionUtils.java b/src/main/java/com/qiwu/chatbotbackend/actiongenerate/utils/ActionUtils.java index a343b79..3b97f0a 100644 --- a/src/main/java/com/qiwu/chatbotbackend/actiongenerate/utils/ActionUtils.java +++ b/src/main/java/com/qiwu/chatbotbackend/actiongenerate/utils/ActionUtils.java @@ -290,11 +290,14 @@ public class ActionUtils { String pair[] = null; for(String line:keywordtText.split("\r\n")){ - //System.out.println(line); if(line.startsWith("++")){ pair = line.split("\\|"); - macroMap.put(pair[0], pair[1]); - //System.out.println("put" + pair[0] + pair[1]); + if(pair.length < 2) { + System.out.println("宏定义非法: " + line); + } + else { + macroMap.put(pair[0], pair[1]); + } } } @@ -936,6 +939,7 @@ public class ActionUtils { }catch (SQLException e){ intervalStatus = new IntervalStatus(0, ACTION_TEXT_GENERATE_ERROR); System.out.println(e.getMessage()); + e.printStackTrace(); }finally { platformUtils.destroy(); } diff --git a/src/main/java/com/qiwu/chatbotbackend/entity/ConfigTermText.java b/src/main/java/com/qiwu/chatbotbackend/entity/ConfigTermText.java index 6abebde..d2b2bb7 100644 --- a/src/main/java/com/qiwu/chatbotbackend/entity/ConfigTermText.java +++ b/src/main/java/com/qiwu/chatbotbackend/entity/ConfigTermText.java @@ -183,21 +183,21 @@ public class ConfigTermText implements Cloneable{ Map nameCount = new HashMap(); for (Premise premise : premises){ - //设置初始值 - //System.out.println("nameCount" + nameCount); conditionName = premise.getConditionName(); - + if(conditionName.startsWith("npc_") || + conditionName.startsWith("goods_") || + conditionName.startsWith("globalVariable_") || + conditionName.startsWith("map_")) + {} + else { nameCount.putIfAbsent(conditionName, 0); - //nameCount加一 nameCount.put(conditionName, nameCount.get(conditionName) + 1); - //在conditionName后添加count if(nameCount.get(conditionName) > 1) { premise.setConditionName(conditionName + nameCount.get(conditionName)); } - - + } sb.append(","); sb.append(premise.getConditionName()); diff --git a/src/main/java/com/qiwu/chatbotbackend/gameDesign/PlotConstructor2.java b/src/main/java/com/qiwu/chatbotbackend/gameDesign/PlotConstructor2.java index 8c28468..809e052 100644 --- a/src/main/java/com/qiwu/chatbotbackend/gameDesign/PlotConstructor2.java +++ b/src/main/java/com/qiwu/chatbotbackend/gameDesign/PlotConstructor2.java @@ -282,6 +282,7 @@ public class PlotConstructor2 extends ElementConstructor { nextId = branchNode.getString("nextPlotId"); + //自动寻路 moveWithPlot = branchNode.getBoolean("moveWithPlot"); if(nextId == null || nextId.equals("") || !plotIndex.containsKey(nextId)){ nextId = id + "_end"; @@ -336,6 +337,8 @@ public class PlotConstructor2 extends ElementConstructor { */ //现在暂时放开下一步剧情未发生过的限制条件 + //historyPremise + //currentPremise //extraHP = taskLineName + "::match-Include=" + id + ",site::match-Include=" + location + "," + id + "::number-BiggerOrEqual=" + 1 + "," + nextId + "::match-Include=null"; appendPremise(extraHP, taskLineName, "match", "Include", gameStep); appendPremise(extraHP, "site", "match", "Include", location); diff --git a/src/main/java/com/qiwu/chatbotbackend/task/utils/GameBotUtil.java b/src/main/java/com/qiwu/chatbotbackend/task/utils/GameBotUtil.java index 143a73e..b157301 100644 --- a/src/main/java/com/qiwu/chatbotbackend/task/utils/GameBotUtil.java +++ b/src/main/java/com/qiwu/chatbotbackend/task/utils/GameBotUtil.java @@ -76,8 +76,8 @@ public class GameBotUtil extends BasicBotUtil{ }else { chatCache.getInfoPoint().put("临时变量condition", activeList[activeList.length-1]); } - - + int randomNumber = (int)(Math.random() * 10000); + chatCache.getInfoPoint().put(PLOT_RANDOM_NUM, String.valueOf(randomNumber)); return debugFlag; }