Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
secret-garden-game
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
周君强
secret-garden-game
Commits
c9096bbd
Commit
c9096bbd
authored
Sep 24, 2022
by
周君强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.反馈问题修复
parent
ec0e2815
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
73 additions
and
23 deletions
+73
-23
Constants.java
src/main/java/com/qiwuai/garden/common/Constants.java
+4
-0
TimingAcquisition.java
...main/java/com/qiwuai/garden/common/TimingAcquisition.java
+16
-3
TypeConvertUtil.java
.../java/com/qiwuai/garden/common/utils/TypeConvertUtil.java
+1
-1
CommonController.java
...n/java/com/qiwuai/garden/controller/CommonController.java
+7
-1
BackPackServiceImpl.java
...den/service/backPackService/impl/BackPackServiceImpl.java
+9
-5
PetService.java
...java/com/qiwuai/garden/service/petService/PetService.java
+12
-0
PetServiceImpl.java
...qiwuai/garden/service/petService/impl/PetServiceImpl.java
+0
-0
PlantServiceImpl.java
...ai/garden/service/plantService/impl/PlantServiceImpl.java
+4
-4
SocialServiceImpl.java
.../garden/service/socialService/impl/SocialServiceImpl.java
+0
-0
gardener.yaml
src/main/resources/speech/gardener.yaml
+3
-3
pet.yaml
src/main/resources/speech/pet.yaml
+15
-6
social.yaml
src/main/resources/speech/social.yaml
+2
-0
No files found.
src/main/java/com/qiwuai/garden/common/Constants.java
View file @
c9096bbd
...
...
@@ -209,6 +209,10 @@ public class Constants {
*/
public
static
final
Integer
ADD_FRIEND_CHECK
=
5009
;
/**
* 好友留言
*/
public
static
final
Integer
LEAVE_MESSAGE
=
5011
;
/**
* 查看留言
*/
public
static
final
Integer
READ_MESSAGE
=
5012
;
...
...
src/main/java/com/qiwuai/garden/common/TimingAcquisition.java
View file @
c9096bbd
...
...
@@ -214,6 +214,7 @@ public class TimingAcquisition {
* 通过json文件加载所有用户数据到缓存中
*/
public
static
void
loading
()
{
log
.
info
(
"-----------开始加载玩家数据----------------"
);
//从yml配置文件中取出存放玩家数据的地址
String
userFilePath
=
YamlUtil
.
getValueByKey
(
"userFilePath"
);
File
file
=
new
File
(
userFilePath
);
...
...
@@ -226,13 +227,14 @@ public class TimingAcquisition {
if
(
f
.
isFile
())
{
String
s
=
PersistenceUtil
.
getDataFromFile
(
String
.
valueOf
(
f
));
//JSON转map对象
log
.
info
(
"取出的数据:"
+
s
);
//
log.info("取出的数据:" + s);
Map
<
String
,
GardenerDto
>
gardener
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
GardenerDto
>>(){});
log
.
info
(
"从文件中取出玩家的缓存数据:"
+
gardener
);
//
log.info("从文件中取出玩家的缓存数据:" + gardener);
gardenerMap
.
putAll
(
gardener
);
}
}
log
.
info
(
"内存中所有玩家的缓存数据:"
+
gardenerMap
);
log
.
info
(
"-----------玩家数据加载完成----------------"
);
// log.info("内存中所有玩家的缓存数据:" + gardenerMap );
//加载话术
speechLoading
();
//加载配置文件region.json
...
...
@@ -645,6 +647,17 @@ public class TimingAcquisition {
NurseryPojo
nursery
=
entry
.
getValue
();
if
(
nurseryType
.
equals
(
nursery
.
getName
()))
{
return
nursery
.
getId
();
}
else
{
//在别名里找
//所有该植物的别名
String
alias
=
nursery
.
getAlias
();
if
(!
StringUtils
.
isEmpty
(
alias
))
{
if
(!
Constants
.
NON_STR
.
equals
(
alias
))
{
List
<
String
>
aliasList
=
Arrays
.
asList
(
alias
.
split
(
"\\|"
));
if
(
aliasList
.
contains
(
nurseryType
))
{
return
nursery
.
getId
();
}
}
}
}
}
return
Constants
.
REQ_NON
;
...
...
src/main/java/com/qiwuai/garden/common/utils/TypeConvertUtil.java
View file @
c9096bbd
...
...
@@ -79,7 +79,7 @@ public class TypeConvertUtil {
* @return Integer
*/
public
static
Integer
change2Integer
(
String
param
)
{
String
[]
all
=
new
String
[]{
"都"
,
"统统"
,
"全数"
,
"所有"
,
"全"
,
"全部"
,
"全都"
,
"一起"
};
String
[]
all
=
new
String
[]{
"都"
,
"统统"
,
"全数"
,
"所有"
,
"全"
,
"全部"
,
"全都"
,
"一起"
,
"批量"
};
String
[]
first
=
new
String
[]{
"首个"
,
"首位"
,
"最前面"
,
"开头"
,
"首发"
,
"起首"
};
String
[]
middle
=
new
String
[]{
"中间"
};
String
[]
last
=
new
String
[]{
"最后"
,
"末位"
,
"末尾"
,
"最后面"
};
...
...
src/main/java/com/qiwuai/garden/controller/CommonController.java
View file @
c9096bbd
...
...
@@ -331,6 +331,12 @@ public class CommonController {
case
"发放花圃宠物指令"
:
result
=
petServiceProxy
.
addNurseryPet
(
operationReq
);
break
;
case
"查看新来宠物"
:
result
=
petServiceProxy
.
checkNewPets
(
operationReq
);
break
;
case
"升级宠物"
:
result
=
petServiceProxy
.
updatePet
(
operationReq
);
break
;
case
"购买指令"
:
result
=
marketServiceProxy
.
buyCheck
(
operationReq
);
break
;
...
...
@@ -713,7 +719,7 @@ public class CommonController {
case
"查询货币说明"
:
result
=
helpServiceProxy
.
moneyExplainCheck
(
operationReq
);
break
;
case
"
建议指令
"
:
case
"
询问建议
"
:
result
=
adviseServiceProxy
.
adviseWithout
(
operationReq
);
break
;
case
"种植建议指令"
:
...
...
src/main/java/com/qiwuai/garden/service/backPackService/impl/BackPackServiceImpl.java
View file @
c9096bbd
...
...
@@ -337,16 +337,20 @@ public class BackPackServiceImpl implements BackPackService {
itemBags
.
put
(
itemTypeId
,
itemBag
);
}
ItemDto
item
=
itemBags
.
get
(
itemTypeId
).
getItems
(
itemId
);
String
description
=
""
;
if
(!
StringUtils
.
isEmpty
(
itemConfig
.
getDescription
()))
{
description
=
","
+
itemConfig
.
getDescription
();
}
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"search_item_info"
);
if
(
StringUtils
.
isEmpty
(
item
))
{
if
(!
StringUtils
.
isEmpty
(
plant
))
{
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"search_item_info_fruit_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
(),
itemConfig
.
getDescription
()
,
plant
.
getName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
(),
description
,
plant
.
getName
());
text
+=
SpeechUtil
.
getGardenerSpeech
(
gender
,
"search_item_info_fruit_none"
);
}
else
{
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"search_item_info_item_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
(),
itemConfig
.
getDescription
()
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
(),
description
);
text
+=
SpeechUtil
.
getGardenerSpeech
(
gender
,
"search_item_info_item_none"
);
}
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
...
...
@@ -363,11 +367,11 @@ public class BackPackServiceImpl implements BackPackService {
if
(
item
.
getItemNum
()
==
0
)
{
if
(!
StringUtils
.
isEmpty
(
plant
))
{
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"search_item_info_fruit_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
(),
itemConfig
.
getDescription
()
,
plant
.
getName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
(),
description
,
plant
.
getName
());
text
+=
SpeechUtil
.
getGardenerSpeech
(
gender
,
"search_item_info_fruit_none"
);
}
else
{
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"search_item_info_item_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
(),
itemConfig
.
getDescription
()
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
(),
description
);
text
+=
SpeechUtil
.
getGardenerSpeech
(
gender
,
"search_item_info_item_none"
);
}
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
...
...
@@ -381,7 +385,7 @@ public class BackPackServiceImpl implements BackPackService {
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
(),
itemConfig
.
getDescription
()
,
item
.
getItemNum
().
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
(),
description
,
item
.
getItemNum
().
toString
());
log
.
info
(
uid
+
"检索到物品信息:"
+
itemConfig
.
getName
()
+
"有"
+
item
.
getItemNum
()
+
"个"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
...
...
src/main/java/com/qiwuai/garden/service/petService/PetService.java
View file @
c9096bbd
...
...
@@ -106,4 +106,16 @@ public interface PetService {
* @return CommonResponse
*/
CommonResponse
addNurseryPet
(
OperationRequest
operationReq
);
/**
* 查看新来宠物
* @param operationReq
* @return CommonResponse
*/
CommonResponse
checkNewPets
(
OperationRequest
operationReq
);
/**
* 升级宠物
* @param operationReq
* @return CommonResponse
*/
CommonResponse
updatePet
(
OperationRequest
operationReq
);
}
src/main/java/com/qiwuai/garden/service/petService/impl/PetServiceImpl.java
View file @
c9096bbd
This diff is collapsed.
Click to expand it.
src/main/java/com/qiwuai/garden/service/plantService/impl/PlantServiceImpl.java
View file @
c9096bbd
...
...
@@ -438,7 +438,7 @@ public class PlantServiceImpl implements PlantService {
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_seed_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
TimingAcquisition
.
itemConfigMap
.
get
(
plant
.
getFruitId
()).
getName
());
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_seed
_none
"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_seed"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
...
...
@@ -461,7 +461,7 @@ public class PlantServiceImpl implements PlantService {
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_seed_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
TimingAcquisition
.
itemConfigMap
.
get
(
plant
.
getFruitId
()).
getName
());
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_seed
_none
"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_seed"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
...
...
@@ -1722,7 +1722,7 @@ public class PlantServiceImpl implements PlantService {
List
<
ItemDto
>
dropItems
=
nurseryInfo
.
getDropItems
();
if
(!
StringUtils
.
isEmpty
(
dropItems
))
{
if
(
dropItems
.
size
()
!=
0
){
feedText
.
append
(
",
"
).
append
(
"
额外收获了"
);
feedText
.
append
(
",额外收获了"
);
for
(
ItemDto
item
:
dropItems
)
{
if
(
item
.
getItemNum
()
!=
0
)
{
feedText
.
append
(
item
.
getItemNum
()).
append
(
"个"
).
append
(
itemConfigMap
.
get
(
item
.
getItemId
()).
getName
()).
append
(
"、"
);
...
...
@@ -2097,7 +2097,7 @@ public class PlantServiceImpl implements PlantService {
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
//如果花圃已置空,则直接返回
if
(
!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantId
()))
{
if
(
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantId
()))
{
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
gender
,
"clear_plant_fail_plant"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
...
...
src/main/java/com/qiwuai/garden/service/socialService/impl/SocialServiceImpl.java
View file @
c9096bbd
This diff is collapsed.
Click to expand it.
src/main/resources/speech/gardener.yaml
View file @
c9096bbd
...
...
@@ -107,11 +107,11 @@ aside:
-
【旁白@正常】目前拥有的【1】数量为【2】。
#检索物品
search_item_info
:
-
【旁白@正常】【1】
,
【2】,背包里目前拥有【3】个。
-
【旁白@正常】【1】【2】,背包里目前拥有【3】个。
search_item_info_fruit_none
:
-
【旁白@正常】【1】
,
【2】,目前背包里还没有。可以通过种植【3】在收获果实的时候获得。
-
【旁白@正常】【1】【2】,目前背包里还没有。可以通过种植【3】在收获果实的时候获得。
search_item_info_item_none
:
-
【旁白@正常】【1】
,
【2】,目前背包里还没有。可以在商店购买获得。
-
【旁白@正常】【1】【2】,目前背包里还没有。可以在商店购买获得。
search_item_info_no_exist
:
-
【旁白@正常】该物品不存在。
...
...
src/main/resources/speech/pet.yaml
View file @
c9096bbd
...
...
@@ -2,15 +2,15 @@
aside
:
#宠物查询
pet_view_nursery_one
:
-
【旁白@正常】已为你查询,【1】
,
【2】,目前该宠物正养在【3】号{花圃称呼}中。
-
【旁白@正常】已为你查询,【1】【2】,目前该宠物正养在【3】号{花圃称呼}中。
pet_view_field_one
:
-
【旁白@正常】已为你查询,【1】
,
【2】,目前该宠物正在宠物栏里。
-
【旁白@正常】已为你查询,【1】【2】,目前该宠物正在宠物栏里。
pet_view_nursery_more
:
-
【旁白@正常】已为你查询,【1】
,
【2】,目前有【3】只,该宠物正养在【4】中。
-
【旁白@正常】已为你查询,【1】【2】,目前有【3】只,该宠物正养在【4】中。
pet_view_field_more
:
-
【旁白@正常】已为你查询,【1】
,
【2】,目前有【3】只,该宠物正在宠物栏里。
-
【旁白@正常】已为你查询,【1】【2】,目前有【3】只,该宠物正在宠物栏里。
pet_view_both
:
-
【旁白@正常】已为你查询,【1】
,
【2】,目前有【3】只该宠物正在宠物栏里,有【4】只该宠物正养在【5】中。
-
【旁白@正常】已为你查询,【1】【2】,目前有【3】只该宠物正在宠物栏里,有【4】只该宠物正养在【5】中。
pet_view_no_pet
:
-
【旁白@正常】已为你查询,{花圃称呼}、宠物栏内没有该宠物。我们还没有这个宠物,可以通过种植【1】,以一定几率获得
pet_view_no_exist
:
...
...
@@ -63,6 +63,8 @@ aside:
-
【旁白@正常】对应位置不是该宠物。
pet_delete_fail_no_pet
:
-
【旁白@正常】未查询到该宠物,无法赶走。
pet_delete_fail_nursery_no_pet
:
-
【旁白@正常】{花圃称呼}中还没有宠物,无法赶走。
pet_delete_success
:
-
【旁白@正常】我知道了,现在为你赶走【1】。
-
【旁白@正常】好的,现在为您赶走【1】。
...
...
@@ -111,6 +113,10 @@ aside:
#查看花圃宠物状况
nursery_pet_check
:
-
【旁白@正常】花园目前有宠物的{花圃称呼}一共有【1】块,【2】块{花圃称呼}空闲可放置宠物。
nursery_pet_check_new_pet
:
-
【旁白@正常】你{花圃称呼}中的植物成熟后共吸引来【1】只宠物,【2】。
nursery_pet_check_no_new_pet
:
-
【旁白@正常】当前你的{花圃称呼}这次还没有新来宠物。
#宠物总览查询
pet_overview_both
:
-
【旁白@正常】你当前拥有【1】只宠物。宠物栏中有【2】只宠物,其中【3】。{花圃称呼}中有【4】只宠物,其中【5】。
...
...
@@ -130,9 +136,12 @@ aside:
pet_check_by_num_fail_no_pet
:
-
【旁白@正常】【1】号{花圃称呼}中没有宠物,可以将宠物栏中的宠物放置到这个{花圃称呼}中,或是等待植物成熟后看看有没有宠物被吸引过来。
pet_check_by_num_sure
:
-
【旁白@正常】【1】
、
【2】,【3】属性,生命值【4】,攻击值【5】。
-
【旁白@正常】【1】【2】,【3】属性,生命值【4】,攻击值【5】。
pet_check_by_num_cancel
:
-
【旁白@正常】好的。已为你取消查看【1】号{花圃称呼}的宠物。
#升级宠物
upgrade_pet
:
-
【旁白@正常】宠物不支持升级。可以去看看有哪些宠物。
...
...
src/main/resources/speech/social.yaml
View file @
c9096bbd
...
...
@@ -184,6 +184,8 @@ aside:
-
【旁白@正常】还需冷却【1】秒后可以接着留言。
leave_message_fail_sensitive_words
:
-
【旁白@正常】留言包含敏感词汇,本次留言失败,要继续留言吗?
leave_message_fail_no_pre
:
-
【旁白@正常】你还未说留言信息,暂时无法留言,请先开始留言。
leave_message_success
:
-
【旁白@正常】留言已完成。
leave_message_fail_not_friend
:
...
...
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