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
f5863c5a
Commit
f5863c5a
authored
Apr 08, 2019
by
zhaoguojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加随机数变量
parent
77c0805c
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
22 deletions
+29
-22
config.properties
config.properties
+10
-8
Config.java
src/main/java/com/qiwu/chatbotbackend/Config/Config.java
+1
-3
ActionUtils.java
...qiwu/chatbotbackend/actiongenerate/utils/ActionUtils.java
+6
-2
ConfigTermText.java
...n/java/com/qiwu/chatbotbackend/entity/ConfigTermText.java
+7
-7
PlotConstructor2.java
.../com/qiwu/chatbotbackend/gameDesign/PlotConstructor2.java
+3
-0
GameBotUtil.java
.../java/com/qiwu/chatbotbackend/task/utils/GameBotUtil.java
+2
-2
No files found.
config.properties
View file @
f5863c5a
#
#
## qa问答地址
## qa问答地址
#
qa_url=http://192.168.1.78:59000/game
qa_url
=
http://192.168.1.78:59000/game
#
#
## 中控url
## 中控url
#
cc_url=http://localhost:8070/api/update/data
cc_url
=
http://localhost:8070/api/update/data
#
#
## condition后台url
## condition后台url
#
condition_backend_url=http://192.168.1.82:6636/api
condition_backend_url
=
http://192.168.1.82:6636/api
#
#
## action生成指定的后台地址
## 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
#
qa_url=http://localhost:59100/game
cc_url
=
http://localhost:8070/api/update/data
#
cc_url=http://localhost:8070/api/update/data
condition_backend_url
=
http://localhost:6636/api
#
condition_backend_url=http://localhost:6636/api
service_url
=
http://localhost:8081/bot/dialog
#
service_url=http://localhost:8081/bot/dialog
chatcache_time_out
=
300000
chatcache_time_out
=
300000
...
@@ -64,6 +64,8 @@ star_plot_not_exist=开始剧情不存在,请到剧情列表设置
...
@@ -64,6 +64,8 @@ star_plot_not_exist=开始剧情不存在,请到剧情列表设置
assistant
=
globalVariable_智能助手
assistant
=
globalVariable_智能助手
unknown_counter_name
=
globalVariable_无匹配次数
unknown_counter_name
=
globalVariable_无匹配次数
plot_random_num
=
globalVariable_剧情随机数
# ------------------------助手情绪--------------
# ------------------------助手情绪--------------
assistant_emotion
=
正常
assistant_emotion
=
正常
...
...
src/main/java/com/qiwu/chatbotbackend/Config/Config.java
View file @
f5863c5a
...
@@ -188,7 +188,5 @@ public class Config {
...
@@ -188,7 +188,5 @@ public class Config {
public
static
String
SCRIPT_ALL_IN_PLACE
=
null
;
public
static
String
SCRIPT_ALL_IN_PLACE
=
null
;
//script_item_intro
//script_item_intro
public
static
String
PLOT_RANDOM_NUM
=
null
;
}
}
src/main/java/com/qiwu/chatbotbackend/actiongenerate/utils/ActionUtils.java
View file @
f5863c5a
...
@@ -290,11 +290,14 @@ public class ActionUtils {
...
@@ -290,11 +290,14 @@ public class ActionUtils {
String
pair
[]
=
null
;
String
pair
[]
=
null
;
for
(
String
line:
keywordtText
.
split
(
"\r\n"
)){
for
(
String
line:
keywordtText
.
split
(
"\r\n"
)){
//System.out.println(line);
if
(
line
.
startsWith
(
"++"
)){
if
(
line
.
startsWith
(
"++"
)){
pair
=
line
.
split
(
"\\|"
);
pair
=
line
.
split
(
"\\|"
);
if
(
pair
.
length
<
2
)
{
System
.
out
.
println
(
"宏定义非法: "
+
line
);
}
else
{
macroMap
.
put
(
pair
[
0
],
pair
[
1
]);
macroMap
.
put
(
pair
[
0
],
pair
[
1
]);
//System.out.println("put" + pair[0] + pair[1]);
}
}
}
}
}
...
@@ -936,6 +939,7 @@ public class ActionUtils {
...
@@ -936,6 +939,7 @@ public class ActionUtils {
}
catch
(
SQLException
e
){
}
catch
(
SQLException
e
){
intervalStatus
=
new
IntervalStatus
(
0
,
ACTION_TEXT_GENERATE_ERROR
);
intervalStatus
=
new
IntervalStatus
(
0
,
ACTION_TEXT_GENERATE_ERROR
);
System
.
out
.
println
(
e
.
getMessage
());
System
.
out
.
println
(
e
.
getMessage
());
e
.
printStackTrace
();
}
finally
{
}
finally
{
platformUtils
.
destroy
();
platformUtils
.
destroy
();
}
}
...
...
src/main/java/com/qiwu/chatbotbackend/entity/ConfigTermText.java
View file @
f5863c5a
...
@@ -183,21 +183,21 @@ public class ConfigTermText implements Cloneable{
...
@@ -183,21 +183,21 @@ public class ConfigTermText implements Cloneable{
Map
<
String
,
Integer
>
nameCount
=
new
HashMap
<
String
,
Integer
>();
Map
<
String
,
Integer
>
nameCount
=
new
HashMap
<
String
,
Integer
>();
for
(
Premise
premise
:
premises
){
for
(
Premise
premise
:
premises
){
//设置初始值
//System.out.println("nameCount" + nameCount);
conditionName
=
premise
.
getConditionName
();
conditionName
=
premise
.
getConditionName
();
if
(
conditionName
.
startsWith
(
"npc_"
)
||
conditionName
.
startsWith
(
"goods_"
)
||
conditionName
.
startsWith
(
"globalVariable_"
)
||
conditionName
.
startsWith
(
"map_"
))
{}
else
{
nameCount
.
putIfAbsent
(
conditionName
,
0
);
nameCount
.
putIfAbsent
(
conditionName
,
0
);
//nameCount加一
//nameCount加一
nameCount
.
put
(
conditionName
,
nameCount
.
get
(
conditionName
)
+
1
);
nameCount
.
put
(
conditionName
,
nameCount
.
get
(
conditionName
)
+
1
);
//在conditionName后添加count
//在conditionName后添加count
if
(
nameCount
.
get
(
conditionName
)
>
1
)
{
if
(
nameCount
.
get
(
conditionName
)
>
1
)
{
premise
.
setConditionName
(
conditionName
+
nameCount
.
get
(
conditionName
));
premise
.
setConditionName
(
conditionName
+
nameCount
.
get
(
conditionName
));
}
}
}
sb
.
append
(
","
);
sb
.
append
(
","
);
sb
.
append
(
premise
.
getConditionName
());
sb
.
append
(
premise
.
getConditionName
());
...
...
src/main/java/com/qiwu/chatbotbackend/gameDesign/PlotConstructor2.java
View file @
f5863c5a
...
@@ -282,6 +282,7 @@ public class PlotConstructor2 extends ElementConstructor {
...
@@ -282,6 +282,7 @@ public class PlotConstructor2 extends ElementConstructor {
nextId
=
branchNode
.
getString
(
"nextPlotId"
);
nextId
=
branchNode
.
getString
(
"nextPlotId"
);
//自动寻路
moveWithPlot
=
branchNode
.
getBoolean
(
"moveWithPlot"
);
moveWithPlot
=
branchNode
.
getBoolean
(
"moveWithPlot"
);
if
(
nextId
==
null
||
nextId
.
equals
(
""
)
||
!
plotIndex
.
containsKey
(
nextId
)){
if
(
nextId
==
null
||
nextId
.
equals
(
""
)
||
!
plotIndex
.
containsKey
(
nextId
)){
nextId
=
id
+
"_end"
;
nextId
=
id
+
"_end"
;
...
@@ -336,6 +337,8 @@ public class PlotConstructor2 extends ElementConstructor {
...
@@ -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";
//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
,
taskLineName
,
"match"
,
"Include"
,
gameStep
);
appendPremise
(
extraHP
,
"site"
,
"match"
,
"Include"
,
location
);
appendPremise
(
extraHP
,
"site"
,
"match"
,
"Include"
,
location
);
...
...
src/main/java/com/qiwu/chatbotbackend/task/utils/GameBotUtil.java
View file @
f5863c5a
...
@@ -76,8 +76,8 @@ public class GameBotUtil extends BasicBotUtil{
...
@@ -76,8 +76,8 @@ public class GameBotUtil extends BasicBotUtil{
}
else
{
}
else
{
chatCache
.
getInfoPoint
().
put
(
"临时变量condition"
,
activeList
[
activeList
.
length
-
1
]);
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
;
return
debugFlag
;
}
}
...
...
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