Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qwgame
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵国君
qwgame
Commits
8d68a55a
Commit
8d68a55a
authored
Apr 01, 2019
by
hxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复生成action的bug
parent
1d6c0138
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
165 additions
and
39 deletions
+165
-39
config.properties
config.properties
+9
-0
keywords.txt
keywords.txt
+37
-19
Config.java
src/main/java/com/qiwu/chatbotbackend/Config/Config.java
+9
-0
RecoveryServlet.java
...hatbotbackend/actiongenerate/servlet/RecoveryServlet.java
+1
-1
ActionUtils.java
...qiwu/chatbotbackend/actiongenerate/utils/ActionUtils.java
+96
-12
CharacterConstructor.java
.../qiwu/chatbotbackend/gameDesign/CharacterConstructor.java
+3
-0
ItemConstructor.java
...a/com/qiwu/chatbotbackend/gameDesign/ItemConstructor.java
+1
-0
MapConstructor.java
...va/com/qiwu/chatbotbackend/gameDesign/MapConstructor.java
+2
-1
WorldController.java
...a/com/qiwu/chatbotbackend/processing/WorldController.java
+0
-0
GetAnswerServlet.java
...ava/com/qiwu/chatbotbackend/servlet/GetAnswerServlet.java
+1
-0
log4j.properties
src/main/resources/dev/log4j.properties
+6
-6
No files found.
config.properties
View file @
8d68a55a
...
@@ -179,3 +179,12 @@ sql_connection_error=数据库连接获取失败
...
@@ -179,3 +179,12 @@ sql_connection_error=数据库连接获取失败
# -------------------------备份--------------------------------------
# -------------------------备份--------------------------------------
backup_error
=
备份失败
backup_error
=
备份失败
# --------------------------话术----------------------------------------
script_npc_intro
=
[人名]:[属性值]
script_item_intro
=
[物品名]:[属性值]
script_npc_in_place
=
[地点名]上有[人物列表]
script_item_in_place
=
[地点名]上有[物品列表]
script_all_in_place
=
[地点名]上有[人物物品列表]
keywords.txt
View file @
8d68a55a
...
@@ -23,15 +23,16 @@ WHERE_CAN_I_GO|choose_gowhere_33|+qiwu:哪+qiwu:哪儿+qiwu:哪里
...
@@ -23,15 +23,16 @@ WHERE_CAN_I_GO|choose_gowhere_33|+qiwu:哪+qiwu:哪儿+qiwu:哪里
# 周围有什么
# 周围有什么
AROUND_THINGS|havewhat_thing|+旁边:吗+旁边:呢+这里:呢+这里:吗+附近:吗+周围:吗+地方:啊+地点:啊+周围:呀
AROUND_THINGS|havewhat_thing|+旁边:吗+旁边:呢+这里:呢+这里:吗+附近:吗+周围:吗+地方:啊+地点:啊+周围:呀
AROUND_THINGS|havewhat_vv|+这:有
AROUND_THINGS|place_have_something|+这里:什么
AROUND_THINGS|place_have_something|+这里:什么
# 周围有什么人
# 周围有什么人
AROUND_NPC|place_have_something|+这里:谁+里面:人+里面:谁+附近:人+附近:谁+qiwu:附近+周围:谁+周围:人+旁边:人+旁边:谁+qiwu:周围+谁:那
AROUND_NPC|place_have_something|+这里:谁+里面:人+里面:谁+附近:人+附近:谁+qiwu:附近+周围:谁+周围:人+旁边:人+旁边:谁+qiwu:周围+谁:那
+这:谁+这:人
# 周围有什么物品
# 周围有什么物品
AROUND_ITEM|place_have_something|+周围:物品+旁边:物品+旁边:东西+周围:东西+附近:物品+附近:东西+这里:物品+这里:东西+qiwu:物品+里面:物品+里面:东西+里面:什么
AROUND_ITEM|place_have_something|+周围:物品+旁边:物品+旁边:东西+周围:东西+附近:物品+附近:东西+这里:物品+这里:东西+qiwu:物品+里面:物品+里面:东西+里面:什么
AROUND_ITEM|havewhat_thing|+周围:物品+旁边:物品+旁边:东西+周围:东西+附近:物品+附近:东西+这里:物品+这里:东西+qiwu:物品+里面:物品+里面:东西+里面:什么
AROUND_ITEM|havewhat_thing|+周围:物品+旁边:物品+旁边:东西+周围:东西+附近:物品+附近:东西+这里:物品+这里:东西+qiwu:物品+里面:物品+里面:东西+里面:什么
+这:物品+这:东西
# 周围有什么地方
# 周围有什么地方
...
@@ -44,14 +45,12 @@ AROUND_NPC_CLASS|havewhat_thing|+周围:name+附近:name+旁边:name
...
@@ -44,14 +45,12 @@ AROUND_NPC_CLASS|havewhat_thing|+周围:name+附近:name+旁边:name
# 周围有什么物品类别
# 周围有什么物品类别
AROUND_ITEM_CLASS|havewhat_thing|+周围:name+附近:name+旁边:name
AROUND_ITEM_CLASS|havewhat_thing|+周围:name+附近:name+旁边:name
# 我有什么
# 我有什么
WHAT_ITEM_I_HAVE|place_have_something|+qiwu:什么+qiwu:东西+qiwu:物品+qiwu:装备+qiwu:补给
WHAT_ITEM_I_HAVE|place_have_something|+qiwu:什么+qiwu:东西+qiwu:物品+qiwu:装备+qiwu:补给
# 去xx
# 去xx
GO_TO|do_what_vn|+去:name+到:name
GO_TO|do_what_vn|+去:name+到:name
+回:name
# npc在哪里
# npc在哪里
...
@@ -62,43 +61,62 @@ ITEM_LOCATION|something_where|+哪里:name+哪:name+地方:name+地点:name+位
...
@@ -62,43 +61,62 @@ ITEM_LOCATION|something_where|+哪里:name+哪:name+地方:name+地点:name+位
# 怎么找到npc
# 怎么找到npc
HOW_FIND_NPC|want_known_zenmezuo_vn|+找到:name
HOW_FIND_NPC|want_known_zenmezuo_vn|+找到:name
+找回:name+拿到:name
#怎么找到物品
#怎么找到物品
HOW_FIND_ITEM|want_known_zenmezuo_vn|+找到:name
HOW_FIND_ITEM|want_known_zenmezuo_vn|+找到:name
+找回:name+拿到:name
# 怎么去XXX
# 怎么去XXX
HOW_TO_THERE|want_known_zenmezuo_vn|默认
HOW_TO_THERE|want_known_zenmezuo_vn|默认
# 你是谁
WHO_YOU_ARE|people_shishui|+botname:谁+botname:干嘛+那个人:谁+人:谁+botname:是+人:是+谁:说话+谁:人
# 任务是什么
TASK_IS_WHAT|something_iswhat|+什么:任务
TASK_IS_WHAT|shenme_shi_shenme|+qiwu:任务
# npc的属性是多少
NPC_ATTR|shuliang_1|+name:attrName
# 物品的属性是多少
ITEM_ATTR|shuliang_1|+name:attrName
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
# 沙滩上有什么人
# 沙滩上有什么人
WHAT_NPC_IN_LOCATION|havewhat_thing|+name:人
WHAT_NPC_IN_LOCATION|havewhat_thing|+name:人
WHAT_NPC_IN_LOCATION|place_have_something|+name:谁+name:人
WHAT_NPC_IN_LOCATION|place_have_something|+name:谁+name:人
# xx上有什么东西
# xx上有什么东西
WAHT_ITEM_IN_LOCATION|havewhat_thing|+name:物品+name:东西+name:地方+name:位置
WAHT_ITEM_IN_LOCATION|havewhat_thing|+name:物品+name:东西+name:地方+name:位置
+name:地点
# 地点上有什么
WHAT_THINGS_IN_LOCATION|have_what_thing|地点
# xx上有什么
WHAT_THINGS_IN_LOCATION|havewhat_vv|+name:有
# 物品是什么
ITEM_INTRO|something_iswhat|+什么:name+name:东西
# 你是谁
WHO_YOU_ARE|zhiwen|+botname:谁+botname:干嘛+那个人:谁+人:谁+botname:是+人:是
# 任务是什么
# npc有什么
TASK_IS_WHAT|something_iswhat|+什么:任务
WHAT_NPC_HAVE|havewhat_vv|+name:有+name:拥有+name:带有+name:带
TASK_IS_WHAT|shenme_shi_shenme|+qiwu:任务
# npc的属性是多少
# 我是谁
NPC_ATTR|shuliang_1|+name:attrName
WHO_I_AM|people_shishui|+谁:qiwu
# npc是谁
NPC_INTRO|people_shishui|+谁:name
# 物品的属性是多少
ITEM_ATTR|shuliang_1|+name:attrName
# tcq new add--------------------------------------
# 物品的作用
ITEM_INTRO|shishenme_1|+干嘛:用+干什么:用
src/main/java/com/qiwu/chatbotbackend/Config/Config.java
View file @
8d68a55a
...
@@ -180,6 +180,15 @@ public class Config {
...
@@ -180,6 +180,15 @@ public class Config {
public
static
long
CHATCACHE_TIME_OUT
;
public
static
long
CHATCACHE_TIME_OUT
;
//-----------------话术----------------
public
static
String
SCRIPT_ITEM_INTRO
=
null
;
public
static
String
SCRIPT_NPC_INTRO
=
null
;
public
static
String
SCRIPT_ITEM_IN_PLACE
=
null
;
public
static
String
SCRIPT_NPC_IN_PLACE
=
null
;
public
static
String
SCRIPT_ALL_IN_PLACE
=
null
;
//script_item_intro
}
}
src/main/java/com/qiwu/chatbotbackend/actiongenerate/servlet/RecoveryServlet.java
View file @
8d68a55a
...
@@ -169,7 +169,7 @@ public class RecoveryServlet extends HttpServlet {
...
@@ -169,7 +169,7 @@ public class RecoveryServlet extends HttpServlet {
batchUpdate
(
botAccount
,
completeConfigText
.
toString
(),
context
,
true
);
batchUpdate
(
botAccount
,
completeConfigText
.
toString
(),
context
,
true
);
ape
=
new
ActionPostElem
(
botId
,
botName
,
actionUtils
.
generateCompleteActionText
(
receiveParameters
,
actionTextList
),
auth
,
GAME_BOT_CATEGORY
,
conditionIdPair
);
ape
=
new
ActionPostElem
(
botId
,
botName
,
actionUtils
.
generateCompleteActionText
(
receiveParameters
,
actionTextList
),
auth
,
GAME_BOT_CATEGORY
,
conditionIdPair
);
actionUtils
.
postAction
(
ape
);
actionUtils
.
postAction
(
ape
,
null
);
intervalStatus
=
actionUtils
.
intervalStatus
;
intervalStatus
=
actionUtils
.
intervalStatus
;
...
...
src/main/java/com/qiwu/chatbotbackend/actiongenerate/utils/ActionUtils.java
View file @
8d68a55a
...
@@ -146,8 +146,9 @@ public class ActionUtils {
...
@@ -146,8 +146,9 @@ public class ActionUtils {
Integer
botId
=
parameters
.
getInteger
(
"botId"
);
Integer
botId
=
parameters
.
getInteger
(
"botId"
);
BotInfo
botInfo
=
helper
.
queryBotInfo
(
botId
);
BotInfo
botInfo
=
helper
.
queryBotInfo
(
botId
);
Boolean
bothValue
=
true
;
Boolean
bothValue
=
true
;
String
styleText
=
""
,
serviceURL
=
""
,
elements
[],
conditionName
;
String
styleText
=
""
,
serviceURL
=
""
,
elements
[],
conditionName
,
finalText
;
Set
<
String
>
conditionNameSet
=
new
HashSet
<
String
>();
Set
<
String
>
conditionNameSet
=
new
HashSet
<
String
>();
Map
<
String
,
String
>
macroMap
=
null
;
StringBuffer
postActionText
=
null
,
processText
=
new
StringBuffer
(),
fullActionText
=
new
StringBuffer
();
StringBuffer
postActionText
=
null
,
processText
=
new
StringBuffer
(),
fullActionText
=
new
StringBuffer
();
if
(
botInfo
==
null
){
if
(
botInfo
==
null
){
...
@@ -201,9 +202,23 @@ public class ActionUtils {
...
@@ -201,9 +202,23 @@ public class ActionUtils {
postActionText
.
append
(
actionText
);
postActionText
.
append
(
actionText
);
}
}
postActionText
.
append
(
"\r\n\r\n"
);
postActionText
.
append
(
"\r\n\r\n"
);
return
postActionText
.
toString
();
macroMap
=
getKeywordMacroMap
(
botId
);
finalText
=
postActionText
.
toString
();
//System.out.println(finalText);
for
(
String
macro:
macroMap
.
keySet
()){
//专门替换三元组前面
System
.
out
.
println
(
macro
+
":替换"
);
finalText
=
finalText
.
replace
(
macro
+
","
,
macroMap
.
get
(
macro
)
+
","
);
}
return
finalText
;
}
}
...
@@ -265,6 +280,28 @@ public class ActionUtils {
...
@@ -265,6 +280,28 @@ public class ActionUtils {
}
}
/**
* 从关键词单元获取宏定义
* @return
*/
public
Map
<
String
,
String
>
getKeywordMacroMap
(
Integer
botId
){
String
keywordtText
=
engine
.
queryKeywordUnitText
(
botId
);
Map
<
String
,
String
>
macroMap
=
new
HashMap
<
String
,
String
>();
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]);
}
}
return
macroMap
;
}
public
void
queryCategory
(
JSONObject
parameters
){
public
void
queryCategory
(
JSONObject
parameters
){
int
botId
=
parameters
.
getInteger
(
"botId"
);
int
botId
=
parameters
.
getInteger
(
"botId"
);
String
[]
categoryChain
;
String
[]
categoryChain
;
...
@@ -322,7 +359,7 @@ public class ActionUtils {
...
@@ -322,7 +359,7 @@ public class ActionUtils {
finalText
=
generateCompleteActionText
(
parameters
,
conditionTextList
);
finalText
=
generateCompleteActionText
(
parameters
,
conditionTextList
);
ape
.
setActionText
(
finalText
);
ape
.
setActionText
(
finalText
);
postAction
(
ape
);
postAction
(
ape
,
null
);
}
}
...
@@ -551,6 +588,12 @@ public class ActionUtils {
...
@@ -551,6 +588,12 @@ public class ActionUtils {
if
(
line
.
startsWith
(
"options|"
)
||
line
.
trim
().
equals
(
""
)
||
line
.
startsWith
(
"idlelimit"
))
if
(
line
.
startsWith
(
"options|"
)
||
line
.
trim
().
equals
(
""
)
||
line
.
startsWith
(
"idlelimit"
))
continue
;
continue
;
//修改关键词单元时应该修改version
if
(
line
.
startsWith
(
"$version"
))
{
newKeywords
.
append
(
"$version|"
).
append
(
System
.
currentTimeMillis
()).
append
(
"\r\n"
);
continue
;
}
newKeywords
.
append
(
line
);
newKeywords
.
append
(
line
);
if
(
line
.
startsWith
(
"++"
)){
if
(
line
.
startsWith
(
"++"
)){
keywordPair
=
line
.
split
(
"\\|"
);
keywordPair
=
line
.
split
(
"\\|"
);
...
@@ -596,7 +639,7 @@ public class ActionUtils {
...
@@ -596,7 +639,7 @@ public class ActionUtils {
ActionPostElem
ape
=
new
ActionPostElem
(
""
,
-
1
,
data
.
getString
(
"botName_yhm"
),
data
.
getString
(
"catName"
),
authorization
,
data
.
getString
(
"botType"
));
ActionPostElem
ape
=
new
ActionPostElem
(
""
,
-
1
,
data
.
getString
(
"botName_yhm"
),
data
.
getString
(
"catName"
),
authorization
,
data
.
getString
(
"botType"
));
postAction
(
ape
);
postAction
(
ape
,
null
);
if
(
intervalStatus
.
getStatus
()
==
1
){
if
(
intervalStatus
.
getStatus
()
==
1
){
((
JSONObject
)
intervalStatus
.
getExtraData
()).
put
(
"botId"
,
ape
.
getBotId
());
((
JSONObject
)
intervalStatus
.
getExtraData
()).
put
(
"botId"
,
ape
.
getBotId
());
...
@@ -703,7 +746,7 @@ public class ActionUtils {
...
@@ -703,7 +746,7 @@ public class ActionUtils {
* @param ape
* @param ape
* @return
* @return
*/
*/
public
void
postAction
(
ActionPostElem
ape
){
public
void
postAction
(
ActionPostElem
ape
,
String
gameEditorSessionId
){
String
url
=
CONDITION_BACKEND_URL
+
"/post/actions"
;
String
url
=
CONDITION_BACKEND_URL
+
"/post/actions"
;
JSONObject
retData
=
null
;
JSONObject
retData
=
null
;
Integer
statusCode
=
0
;
Integer
statusCode
=
0
;
...
@@ -724,6 +767,10 @@ public class ActionUtils {
...
@@ -724,6 +767,10 @@ public class ActionUtils {
if
(!
ape
.
getBotType
().
equals
(
""
))
if
(!
ape
.
getBotType
().
equals
(
""
))
postData
.
put
(
"project"
,
ape
.
getBotType
());
postData
.
put
(
"project"
,
ape
.
getBotType
());
if
(
gameEditorSessionId
!=
null
){
postData
.
put
(
"gameEditorSessionId"
,
gameEditorSessionId
);
}
try
{
try
{
retData
=
SimpleUtil
.
postJSON
(
url
,
postData
,
ape
.
getAuthorization
());
retData
=
SimpleUtil
.
postJSON
(
url
,
postData
,
ape
.
getAuthorization
());
...
@@ -844,15 +891,38 @@ public class ActionUtils {
...
@@ -844,15 +891,38 @@ public class ActionUtils {
}
}
}
}
parameters
.
put
(
"conditionData"
,
conditionData
);
parameters
.
put
(
"conditionData"
,
conditionData
);
finalText
=
generateCompleteActionText
(
parameters
,
actionTextList
);
ape
=
new
ActionPostElem
(
botId
,
botName
,
finalText
,
auth
,
""
,
conditionPostPair
);
postAction
(
ape
);
//第一次提交,获取关键词单元的数据
ape
=
new
ActionPostElem
(
botId
,
botName
,
""
,
auth
,
""
,
conditionPostPair
);
postAction
(
ape
,
parameters
.
getString
(
"gameEditorSessionId"
));
if
(
intervalStatus
.
getStatus
()
==
1
)
{
if
(
intervalStatus
.
getStatus
()
==
1
)
{
helper
.
batchInsertCondition
(
conditionList
);
helper
.
batchInsertCondition
(
conditionList
);
//insertCondition(parameters);
//insertCondition(parameters);
if
(
intervalStatus
.
getStatus
()
==
1
)
{
engine
.
updateWelcomeText
(
botId
,
parameters
.
getString
(
"welcome"
));
updateKnowledgeUnit
(
botId
,
new
HashMap
<
String
,
String
>()
{{
put
(
"options"
,
OPTIONS
);
put
(
"idlelimit"
,
IDLE_LIMIT
);
}},
macroAppendMap
,
parameters
.
getString
(
"POS"
));
}
}
if
(
intervalStatus
.
getStatus
()
==
1
)
{
finalText
=
generateCompleteActionText
(
parameters
,
actionTextList
);
//替换宏定义后生成完整的action文本再提交一次
ape
=
new
ActionPostElem
(
botId
,
botName
,
finalText
,
auth
,
""
,
conditionPostPair
);
postAction
(
ape
,
parameters
.
getString
(
"gameEditorSessionId"
));
if
(
intervalStatus
.
getStatus
()
==
1
)
{
if
(
intervalStatus
.
getStatus
()
==
1
)
{
engine
.
updateWelcomeText
(
botId
,
parameters
.
getString
(
"welcome"
));
engine
.
updateWelcomeText
(
botId
,
parameters
.
getString
(
"welcome"
));
updateKnowledgeUnit
(
botId
,
new
HashMap
<
String
,
String
>()
{{
updateKnowledgeUnit
(
botId
,
new
HashMap
<
String
,
String
>()
{{
...
@@ -903,25 +973,39 @@ public class ActionUtils {
...
@@ -903,25 +973,39 @@ public class ActionUtils {
String
repeatKeywords
=
conditionJson
.
getJSONArray
(
"repeatList"
).
getJSONObject
(
0
).
getString
(
"repeatKeywords"
).
split
(
"-"
)[
0
];
String
repeatKeywords
=
conditionJson
.
getJSONArray
(
"repeatList"
).
getJSONObject
(
0
).
getString
(
"repeatKeywords"
).
split
(
"-"
)[
0
];
String
extraKeywords
=
Joiner
.
on
(
"+"
).
join
(
conditionExtraKeywords
.
get
(
conditionName
+
"_head"
));
String
extraKeywords
=
Joiner
.
on
(
"+"
).
join
(
conditionExtraKeywords
.
get
(
conditionName
+
"_head"
));
//condition原来的值域是一个宏定义
if
(
relationHead
.
startsWith
(
"++"
)){
if
(
relationHead
.
startsWith
(
"++"
)){
if
(
macroAppendMap
.
containsKey
(
relationHead
)){
//要添加的关键词不为空
if
(!
extraKeywords
.
equals
(
""
))
{
if
(
macroAppendMap
.
containsKey
(
relationHead
))
{
macroAppendMap
.
get
(
relationHead
).
append
(
extraKeywords
);
macroAppendMap
.
get
(
relationHead
).
append
(
extraKeywords
);
}
else
{
}
else
{
macroAppendMap
.
put
(
relationHead
,
new
StringBuffer
(
extraKeywords
));
macroAppendMap
.
put
(
relationHead
,
new
StringBuffer
(
extraKeywords
));
}
}
}
}
}
else
{
conditionJson
.
put
(
"relationHead"
,
extraKeywords
);
conditionJson
.
put
(
"relationHead"
,
extraKeywords
);
}
//将三元组头部的限定词替换为游戏中使用的关键词,如果为*,则不替换
//if(!conditionJson.getString("relationHead").equals("*"))
extraKeywords
=
Joiner
.
on
(
"+"
).
join
(
conditionExtraKeywords
.
get
(
conditionName
+
"_tail"
));
extraKeywords
=
Joiner
.
on
(
"+"
).
join
(
conditionExtraKeywords
.
get
(
conditionName
+
"_tail"
));
if
(
repeatKeywords
.
startsWith
(
"++"
)){
if
(
repeatKeywords
.
startsWith
(
"++"
)){
if
(
macroAppendMap
.
containsKey
(
repeatKeywords
)){
//要添加的关键词不为空
if
(!
repeatKeywords
.
equals
(
""
))
{
if
(
macroAppendMap
.
containsKey
(
repeatKeywords
))
{
macroAppendMap
.
get
(
repeatKeywords
).
append
(
extraKeywords
);
macroAppendMap
.
get
(
repeatKeywords
).
append
(
extraKeywords
);
}
else
{
}
else
{
macroAppendMap
.
put
(
repeatKeywords
,
new
StringBuffer
(
extraKeywords
));
macroAppendMap
.
put
(
repeatKeywords
,
new
StringBuffer
(
extraKeywords
));
}
}
}
}
}
else
{
conditionJson
.
getJSONArray
(
"repeatList"
).
getJSONObject
(
0
).
put
(
"repeatKeywords"
,
extraKeywords
);
conditionJson
.
getJSONArray
(
"repeatList"
).
getJSONObject
(
0
).
put
(
"repeatKeywords"
,
extraKeywords
);
}
return
true
;
return
true
;
...
...
src/main/java/com/qiwu/chatbotbackend/gameDesign/CharacterConstructor.java
View file @
8d68a55a
...
@@ -158,6 +158,9 @@ public class CharacterConstructor extends ElementConstructor {
...
@@ -158,6 +158,9 @@ public class CharacterConstructor extends ElementConstructor {
//WHO_YOU_ARE
//WHO_YOU_ARE
queryTypeConfigTermGenerate
(
keywordMap
,
"WHO_YOU_ARE"
,
"npc"
,
"queryLastTalker"
);
queryTypeConfigTermGenerate
(
keywordMap
,
"WHO_YOU_ARE"
,
"npc"
,
"queryLastTalker"
);
//查询xx是谁,输出介绍语
queryTypeConfigTermGenerate
(
keywordMap
,
"NPC_INTRO"
,
"npc"
,
"queryNpcIntro"
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
operationStatus
=
0
;
operationStatus
=
0
;
message
=
"NPC接口处理出现异常"
;
message
=
"NPC接口处理出现异常"
;
...
...
src/main/java/com/qiwu/chatbotbackend/gameDesign/ItemConstructor.java
View file @
8d68a55a
...
@@ -118,6 +118,7 @@ public class ItemConstructor extends ElementConstructor {
...
@@ -118,6 +118,7 @@ public class ItemConstructor extends ElementConstructor {
queryTypeConfigTermGenerate
(
keywordMap
,
"WHAT_ITEM_I_HAVE"
,
"goods"
,
"queryPlayerItems"
);
queryTypeConfigTermGenerate
(
keywordMap
,
"WHAT_ITEM_I_HAVE"
,
"goods"
,
"queryPlayerItems"
);
queryTypeConfigTermGenerate
(
keywordMap
,
"HOW_FIND_ITEM"
,
"goods"
,
"queryFindItemWay"
);
queryTypeConfigTermGenerate
(
keywordMap
,
"HOW_FIND_ITEM"
,
"goods"
,
"queryFindItemWay"
);
queryTypeConfigTermGenerate
(
keywordMap
,
"ITEM_INTRO"
,
"goods"
,
"queryItemIntro"
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
operationStatus
=
0
;
operationStatus
=
0
;
...
...
src/main/java/com/qiwu/chatbotbackend/gameDesign/MapConstructor.java
View file @
8d68a55a
...
@@ -144,7 +144,8 @@ public class MapConstructor extends ElementConstructor {
...
@@ -144,7 +144,8 @@ public class MapConstructor extends ElementConstructor {
// queryTypeConfigTermGenerate(keywordMap, "WHO_IN_THERE", "map", "queryInnerNpcBySite");
// queryTypeConfigTermGenerate(keywordMap, "WHO_IN_THERE", "map", "queryInnerNpcBySite");
queryTypeConfigTermGenerate
(
keywordMap
,
"TASK_IS_WHAT"
,
"map"
,
"queryTaskDescription"
);
queryTypeConfigTermGenerate
(
keywordMap
,
"TASK_IS_WHAT"
,
"map"
,
"queryTaskDescription"
);
queryTypeConfigTermGenerate
(
keywordMap
,
"WHAT_THINGS_IN_LOCATION"
,
"map"
,
"queryItemsInPlace"
);
queryTypeConfigTermGenerate
(
keywordMap
,
"WHAT_THINGS_IN_LOCATION"
,
"map"
,
"queryItemsInPlace"
);
queryTypeConfigTermGenerate
(
keywordMap
,
"WHAT_NPC_IN_LOCATION"
,
"map"
,
"queryNpcInPlace"
);
queryTypeConfigTermGenerate
(
keywordMap
,
"WHAT_THINGS_IN_LOCATION"
,
"map"
,
"queryAllInPlace"
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
src/main/java/com/qiwu/chatbotbackend/processing/WorldController.java
View file @
8d68a55a
This diff is collapsed.
Click to expand it.
src/main/java/com/qiwu/chatbotbackend/servlet/GetAnswerServlet.java
View file @
8d68a55a
...
@@ -75,6 +75,7 @@ public class GetAnswerServlet extends HttpServlet {
...
@@ -75,6 +75,7 @@ public class GetAnswerServlet extends HttpServlet {
userinfo
=
uiController
.
userInfoQuery
(
request
.
getParameter
(
"bot_name"
),
context
);
userinfo
=
uiController
.
userInfoQuery
(
request
.
getParameter
(
"bot_name"
),
context
);
if
(
userinfo
!=
null
)
{
if
(
userinfo
!=
null
)
{
//获得用户历史信息
//获得用户历史信息
ChatCache
chatCache
=
null
;
ChatCache
chatCache
=
null
;
...
...
src/main/resources/dev/log4j.properties
View file @
8d68a55a
...
@@ -7,12 +7,12 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
...
@@ -7,12 +7,12 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.Threshold
=
INFO
log4j.appender.stdout.Threshold
=
INFO
log4j.appender.stdout.layout.ConversionPattern
=
[%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
log4j.appender.stdout.layout.ConversionPattern
=
[%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
### 输出DEBUG 级别以上的日志文件设置 ###
### 输出DEBUG 级别以上的日志文件设置 ###
log4j.appender.D
=
org.apache.log4j.DailyRollingFileAppender
#
log4j.appender.D=org.apache.log4j.DailyRollingFileAppender
log4j.appender.D.File
=
vincent_player_debug.log
#
log4j.appender.D.File=vincent_player_debug.log
log4j.appender.D.Append
=
true
#
log4j.appender.D.Append=true
log4j.appender.D.Threshold
=
DEBUG
#log4j.appender.D.Threshold=DEBUG
log4j.appender.D.layout
=
org.apache.log4j.PatternLayout
#
log4j.appender.D.layout=org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
#
log4j.appender.D.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
### 输出ERROR 级别以上的日志文件设置 ###
### 输出ERROR 级别以上的日志文件设置 ###
log4j.appender.E
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.E
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.E.File
=
vincent_player_error.log
log4j.appender.E.File
=
vincent_player_error.log
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment