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
473b78fa
Commit
473b78fa
authored
Aug 23, 2022
by
周君强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.市场和宠物模块新意图实现;
2.玩家称呼替换
parent
8a61ded5
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
1298 additions
and
375 deletions
+1298
-375
Constants.java
src/main/java/com/qiwuai/garden/common/Constants.java
+14
-4
InitSysServlet.java
src/main/java/com/qiwuai/garden/common/InitSysServlet.java
+16
-0
TimingAcquisition.java
...main/java/com/qiwuai/garden/common/TimingAcquisition.java
+243
-5
HttpUtil.java
src/main/java/com/qiwuai/garden/common/utils/HttpUtil.java
+3
-3
RandomDropUtil.java
...n/java/com/qiwuai/garden/common/utils/RandomDropUtil.java
+3
-3
RequestConversionUtil.java
...com/qiwuai/garden/common/utils/RequestConversionUtil.java
+29
-0
CommonController.java
...n/java/com/qiwuai/garden/controller/CommonController.java
+7
-1
CallNameMapper.java
src/main/java/com/qiwuai/garden/dao/CallNameMapper.java
+13
-0
GardenerInfoDto.java
src/main/java/com/qiwuai/garden/dto/GardenerInfoDto.java
+4
-0
ResultResponse.java
src/main/java/com/qiwuai/garden/dto/base/ResultResponse.java
+8
-0
CallRequest.java
src/main/java/com/qiwuai/garden/dto/request/CallRequest.java
+12
-0
OperationRequest.java
.../java/com/qiwuai/garden/dto/request/OperationRequest.java
+16
-0
CallNamePojo.java
src/main/java/com/qiwuai/garden/pojo/CallNamePojo.java
+23
-0
ItemPojo.java
src/main/java/com/qiwuai/garden/pojo/ItemPojo.java
+4
-0
BackPackServiceImpl.java
...den/service/backPackService/impl/BackPackServiceImpl.java
+13
-6
GardenerService.java
...iwuai/garden/service/gardenerService/GardenerService.java
+6
-0
GardenerServiceImpl.java
...den/service/gardenerService/impl/GardenerServiceImpl.java
+102
-4
HelpService.java
...va/com/qiwuai/garden/service/helpService/HelpService.java
+1
-1
HelpServiceImpl.java
...wuai/garden/service/helpService/impl/HelpServiceImpl.java
+5
-1
MarketServiceImpl.java
.../garden/service/marketService/impl/MarketServiceImpl.java
+219
-174
NurseryServiceImpl.java
...arden/service/nurseryService/impl/NurseryServiceImpl.java
+23
-9
PetService.java
...java/com/qiwuai/garden/service/petService/PetService.java
+7
-1
PetServiceImpl.java
...qiwuai/garden/service/petService/impl/PetServiceImpl.java
+256
-77
PlantServiceImpl.java
...ai/garden/service/plantService/impl/PlantServiceImpl.java
+45
-18
SocialServiceImpl.java
.../garden/service/socialService/impl/SocialServiceImpl.java
+90
-18
application-dev.yml
src/main/resources/application-dev.yml
+4
-2
application-uat.yml
src/main/resources/application-uat.yml
+4
-2
CallNameMapper.xml
src/main/resources/com/qiwuai/garden/dao/CallNameMapper.xml
+14
-0
ItemMapper.xml
src/main/resources/com/qiwuai/garden/dao/ItemMapper.xml
+1
-1
gardener.yaml
src/main/resources/speech/gardener.yaml
+11
-0
help.yaml
src/main/resources/speech/help.yaml
+1
-1
market.yaml
src/main/resources/speech/market.yaml
+18
-14
pet.yaml
src/main/resources/speech/pet.yaml
+13
-3
plant.yaml
src/main/resources/speech/plant.yaml
+63
-26
social.yaml
src/main/resources/speech/social.yaml
+7
-1
No files found.
src/main/java/com/qiwuai/garden/common/Constants.java
View file @
473b78fa
...
@@ -161,6 +161,14 @@ public class Constants {
...
@@ -161,6 +161,14 @@ public class Constants {
*/
*/
public
static
final
Integer
PET_DELETE
=
3004
;
public
static
final
Integer
PET_DELETE
=
3004
;
/**
/**
* 查看商品
*/
public
static
final
Integer
CHECK_GOODS
=
4003
;
/**
* 根据条件查看商品
*/
public
static
final
Integer
CHECK_GOODS_CONDITION
=
4004
;
/**
* 拜访陌生人
* 拜访陌生人
*/
*/
public
static
final
Integer
VISIT_STRANGER
=
5001
;
public
static
final
Integer
VISIT_STRANGER
=
5001
;
...
@@ -192,10 +200,6 @@ public class Constants {
...
@@ -192,10 +200,6 @@ public class Constants {
* 查看偷菜简报
* 查看偷菜简报
*/
*/
public
static
final
Integer
CHECK_STEAL_REPORT
=
5014
;
public
static
final
Integer
CHECK_STEAL_REPORT
=
5014
;
/**
* 查看商品
*/
public
static
final
Integer
CHECK_GOODS
=
4003
;
/**
/**
...
@@ -354,6 +358,12 @@ public class Constants {
...
@@ -354,6 +358,12 @@ public class Constants {
/**
/**
* 翻页查看,每页3个
*/
public
static
final
Integer
PAGE_NUM
=
3
;
/**
* 数据存放地址
* 数据存放地址
*/
*/
public
static
final
String
userFilePath
=
"/home/qwyf14/dataBackup/"
;
public
static
final
String
userFilePath
=
"/home/qwyf14/dataBackup/"
;
...
...
src/main/java/com/qiwuai/garden/common/InitSysServlet.java
View file @
473b78fa
...
@@ -47,6 +47,7 @@ public class InitSysServlet implements InitializingBean {
...
@@ -47,6 +47,7 @@ public class InitSysServlet implements InitializingBean {
private
RegionMapper
regionMapper
;
private
RegionMapper
regionMapper
;
private
RarityMapper
rarityMapper
;
private
RarityMapper
rarityMapper
;
private
TaskTypeMapper
taskTypeMapper
;
private
TaskTypeMapper
taskTypeMapper
;
private
CallNameMapper
callNameMapper
;
@Autowired
@Autowired
public
void
setNurseryMapper
(
NurseryMapper
nurseryMapper
)
{
public
void
setNurseryMapper
(
NurseryMapper
nurseryMapper
)
{
...
@@ -159,6 +160,11 @@ public class InitSysServlet implements InitializingBean {
...
@@ -159,6 +160,11 @@ public class InitSysServlet implements InitializingBean {
this
.
taskTypeMapper
=
taskTypeMapper
;
this
.
taskTypeMapper
=
taskTypeMapper
;
}
}
@Autowired
public
void
setCallNameMapper
(
CallNameMapper
callNameMapper
)
{
this
.
callNameMapper
=
callNameMapper
;
}
/**
/**
* 保存配置信息到缓存
* 保存配置信息到缓存
*/
*/
...
@@ -415,6 +421,16 @@ public class InitSysServlet implements InitializingBean {
...
@@ -415,6 +421,16 @@ public class InitSysServlet implements InitializingBean {
log
.
info
(
"缓存中任务类型对应信息"
+
TimingAcquisition
.
taskTypeMap
);
log
.
info
(
"缓存中任务类型对应信息"
+
TimingAcquisition
.
taskTypeMap
);
log
.
info
(
"任务类型对应信息缓存完成"
);
log
.
info
(
"任务类型对应信息缓存完成"
);
//----------------------缓存玩家称呼对应信息--------------------------
Map
<
Integer
,
CallNamePojo
>
callNameMap
=
new
ConcurrentHashMap
<>();
List
<
CallNamePojo
>
callNameList
=
callNameMapper
.
findAll
();
for
(
CallNamePojo
callName
:
callNameList
)
{
callNameMap
.
put
(
callName
.
getId
(),
callName
);
}
TimingAcquisition
.
callNameMap
.
putAll
(
callNameMap
);
log
.
info
(
"缓存中玩家称呼对应信息"
+
TimingAcquisition
.
callNameMap
);
log
.
info
(
"玩家称呼对应信息缓存完成"
);
//----------------------缓存玩家地址对应的地区信息----------------------------
//----------------------缓存玩家地址对应的地区信息----------------------------
Map
<
String
,
Map
<
String
,
RegionDto
>>
addressMap
=
new
ConcurrentHashMap
<>();
Map
<
String
,
Map
<
String
,
RegionDto
>>
addressMap
=
new
ConcurrentHashMap
<>();
Map
<
String
,
RegionPojo
>
regionPojoMap
=
TimingAcquisition
.
regionIPMap
;
Map
<
String
,
RegionPojo
>
regionPojoMap
=
TimingAcquisition
.
regionIPMap
;
...
...
src/main/java/com/qiwuai/garden/common/TimingAcquisition.java
View file @
473b78fa
...
@@ -2,9 +2,14 @@ package com.qiwuai.garden.common;
...
@@ -2,9 +2,14 @@ package com.qiwuai.garden.common;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
import
com.qiwuai.garden.common.cache.CacheUtil
;
import
com.qiwuai.garden.common.utils.*
;
import
com.qiwuai.garden.common.utils.*
;
import
com.qiwuai.garden.dto.*
;
import
com.qiwuai.garden.dto.*
;
import
com.qiwuai.garden.dto.ItemBagDto
;
import
com.qiwuai.garden.dto.ItemBagDto
;
import
com.qiwuai.garden.dto.base.CommonResponse
;
import
com.qiwuai.garden.dto.base.ResultResponse
;
import
com.qiwuai.garden.dto.base.ResultVarsResponse
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.pojo.*
;
import
com.qiwuai.garden.pojo.*
;
import
com.qiwuai.garden.service.plantService.PlantService
;
import
com.qiwuai.garden.service.plantService.PlantService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -17,6 +22,7 @@ import org.springframework.util.StringUtils;
...
@@ -17,6 +22,7 @@ import org.springframework.util.StringUtils;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.io.File
;
import
java.io.File
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -151,6 +157,10 @@ public class TimingAcquisition {
...
@@ -151,6 +157,10 @@ public class TimingAcquisition {
* 数量范围配置信息
* 数量范围配置信息
*/
*/
public
volatile
static
Map
<
Integer
,
QuantityRangePojo
>
quantityRangeMap
=
new
ConcurrentHashMap
<>();
public
volatile
static
Map
<
Integer
,
QuantityRangePojo
>
quantityRangeMap
=
new
ConcurrentHashMap
<>();
/**
* 玩家称呼配置信息
*/
public
volatile
static
Map
<
Integer
,
CallNamePojo
>
callNameMap
=
new
ConcurrentHashMap
<>();
/**
/**
...
@@ -337,8 +347,7 @@ public class TimingAcquisition {
...
@@ -337,8 +347,7 @@ public class TimingAcquisition {
//所有玩家地址
//所有玩家地址
List
<
String
>
playerList
=
new
ArrayList
<>();
List
<
String
>
playerList
=
new
ArrayList
<>();
for
(
String
region
:
addressMap
.
keySet
())
{
for
(
String
region
:
addressMap
.
keySet
())
{
List
<
String
>
regionPlayerList
=
new
ArrayList
<>();
List
<
String
>
regionPlayerList
=
new
ArrayList
<>(
addressMap
.
get
(
region
).
keySet
());
regionPlayerList
=
new
ArrayList
<>(
addressMap
.
get
(
region
).
keySet
());
playerList
.
addAll
(
regionPlayerList
);
playerList
.
addAll
(
regionPlayerList
);
}
}
String
address
=
String
.
join
(
"+"
,
playerList
);
String
address
=
String
.
join
(
"+"
,
playerList
);
...
@@ -406,6 +415,13 @@ public class TimingAcquisition {
...
@@ -406,6 +415,13 @@ public class TimingAcquisition {
String
skillNames
=
String
.
join
(
"+"
,
skillNameList
);
String
skillNames
=
String
.
join
(
"+"
,
skillNameList
);
HttpUtil
.
doPut
(
"技能名称"
,
skillNames
);
HttpUtil
.
doPut
(
"技能名称"
,
skillNames
);
}
}
//更新玩家称呼的动态词组
if
(
gardenerSkillMap
.
size
()
!=
0
)
{
//所有玩家称呼
List
<
String
>
callNameList
=
callNameMap
.
values
().
stream
().
map
(
CallNamePojo:
:
getName
).
collect
(
Collectors
.
toList
());
String
callNames
=
String
.
join
(
"+"
,
callNameList
);
HttpUtil
.
doPut
(
"玩家称呼"
,
callNames
);
}
// //更新园丁名称的动态词组
// //更新园丁名称的动态词组
// if (gardenerSkillMap.size() != 0) {
// if (gardenerSkillMap.size() != 0) {
// //所有园丁名称
// //所有园丁名称
...
@@ -586,6 +602,186 @@ public class TimingAcquisition {
...
@@ -586,6 +602,186 @@ public class TimingAcquisition {
}
}
/**
/**
* 根据物品属性获取物品属性id
* @param itemAttribute
* @return Integer
*/
public
static
Integer
getItemAttributeIdByName
(
String
itemAttribute
)
{
Iterator
<
Map
.
Entry
<
Integer
,
AttributePojo
>>
iterator
=
attributeMap
.
entrySet
().
iterator
();
while
(
iterator
.
hasNext
())
{
Map
.
Entry
<
Integer
,
AttributePojo
>
entry
=
iterator
.
next
();
AttributePojo
attribute
=
entry
.
getValue
();
if
(
itemAttribute
.
equals
(
attribute
.
getAttribute
()))
{
return
attribute
.
getId
();
}
}
return
Constants
.
REQ_NON
;
}
/**
* 根据物品种类、物品属性、物品等级中的一个及以上去查找物品
* @param uid
* @param itemTypeId
* @param itemAttributeId
* @param itemLevel
* @return Integer
*/
public
static
CommonResponse
getItemInfoByCondition
(
String
uid
,
Map
<
Integer
,
GoodsPojo
>
goodsLevelMap
,
Integer
itemTypeId
,
Integer
itemAttributeId
,
Integer
itemLevel
,
String
expireTime
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
//深拷贝一份可选择商品进行操作
Map
<
Integer
,
GoodsPojo
>
goodsMap
=
new
ConcurrentHashMap
<>(
goodsLevelMap
);
//园丁性别
String
gender
=
getGardenerGender
(
uid
);
//保存根据查找条件找到的物品id集合,用于下一步的翻页操作
List
<
Integer
>
itemIdList
=
new
ArrayList
<>();
//1.玩家提供了花圃类型
if
(!
StringUtils
.
isEmpty
(
itemTypeId
))
{
//物品种类不存在
if
(
itemTypeId
==
Constants
.
REQ_NON
)
{
log
.
info
(
uid
+
"提供的物品种类不存在"
);
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_type_no_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈
ID
(
400304
);
resultResponse
.
set
后台附加返回
(
"查看商品回复1"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//找出商品的物品类型是itemTypeId的物品,即删除不等于指定物品种类的商品
goodsMap
.
entrySet
().
removeIf
(
entry
->
!
itemTypeId
.
equals
(
itemConfigMap
.
get
(
entry
.
getValue
().
getItemId
()).
getItemTypeId
()));
}
//2.玩家提供了物品属性
if
(!
StringUtils
.
isEmpty
(
itemAttributeId
))
{
//所有属性
StringBuilder
attributeText
=
new
StringBuilder
();
for
(
Map
.
Entry
<
Integer
,
AttributePojo
>
entry
:
attributeMap
.
entrySet
())
{
AttributePojo
attribute
=
entry
.
getValue
();
attributeText
.
append
(
attribute
.
getAttribute
()).
append
(
"、"
);
}
attributeText
.
deleteCharAt
(
attributeText
.
length
()
-
1
);
if
(
itemAttributeId
==
Constants
.
REQ_NON
)
{
log
.
info
(
uid
+
"提供的物品属性不存在"
);
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_attribute_no_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
attributeText
.
toString
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈
ID
(
400307
);
resultResponse
.
set
后台附加返回
(
"查看商品回复1"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//找出商品的物品类型是itemAttributeId的物品,即删除不等于指定物品属性的商品
goodsMap
.
entrySet
().
removeIf
(
entry
->
!
itemAttributeId
.
equals
(
itemConfigMap
.
get
(
entry
.
getValue
().
getItemId
()).
getAttributeId
()));
}
//3.玩家提供了物品等级
if
(!
StringUtils
.
isEmpty
(
itemLevel
))
{
if
(
itemLevel
==
Constants
.
REQ_NON
)
{
log
.
info
(
uid
+
"提供的物品等级不存在"
);
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_level_no_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈
ID
(
400308
);
resultResponse
.
set
后台附加返回
(
"查看商品回复1"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//找出商品的物品类型是itemAttributeId的物品,即删除不等于指定物品属性的商品
goodsMap
.
entrySet
().
removeIf
(
entry
->
!
itemLevel
.
equals
(
entry
.
getValue
().
getLevel
()));
}
//没有找到指定条件的商品
if
(
goodsMap
.
size
()
==
0
)
{
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_type_no_goods"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemTypeMap
.
get
(
itemTypeId
).
getDescription
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_fail_type_no_goods"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400305
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看商品回复1"
);
}
//所有物品id
itemIdList
=
goodsMap
.
values
().
stream
().
map
(
GoodsPojo:
:
getItemId
).
collect
(
Collectors
.
toList
());
//保存玩家这轮的请求信息,用于下一步的操作
OperationRequest
operationReq
=
new
OperationRequest
();
operationReq
.
setItemLevel
(
itemLevel
);
operationReq
.
setItemAttributeId
(
itemAttributeId
);
operationReq
.
setItemTypeId
(
itemTypeId
);
operationReq
.
setList
(
itemIdList
);
operationReq
.
setOperationLabel
(
Constants
.
CHECK_GOODS_CONDITION
);
operationReq
.
setPage
(
2
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//按翻页查看,每页3个物品
StringBuilder
feedText
=
new
StringBuilder
();
//货币配置信息
Integer
moneyId
=
Integer
.
parseInt
(
systemConfigMap
.
get
(
"money"
).
getValue
());
ItemPojo
moneyConfig
=
itemConfigMap
.
get
(
moneyId
);
int
size
=
goodsMap
.
size
();
if
(
size
>=
Constants
.
PAGE_NUM
)
{
size
=
Constants
.
PAGE_NUM
;
}
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
GoodsPojo
goods
;
//通过物品id找到商品
for
(
Map
.
Entry
<
Integer
,
GoodsPojo
>
entry
:
goodsMap
.
entrySet
())
{
goods
=
entry
.
getValue
();
if
(
itemIdList
.
get
(
i
).
equals
(
goods
.
getItemId
()))
{
String
price
=
(
goods
.
getDiscount
().
multiply
(
new
BigDecimal
(
goods
.
getPrice
()))).
stripTrailingZeros
().
toPlainString
();
feedText
.
append
(
itemConfigMap
.
get
(
itemIdList
.
get
(
i
)).
getName
()).
append
(
"售价为"
).
append
(
price
).
append
(
moneyConfig
.
getName
()).
append
(
"/个"
);
if
(
goods
.
getDiscount
().
compareTo
(
new
BigDecimal
(
1
))
<
0
)
{
feedText
.
append
(
"(该商品已打折)"
);
}
feedText
.
append
(
"、"
);
break
;
}
}
}
String
itemLevelName
=
StringUtils
.
isEmpty
(
itemLevel
)
?
""
:
(
"等级"
+
itemLevel
+
"的"
);
String
itemType
=
""
;
String
itemAttribute
=
""
;
if
(!
StringUtils
.
isEmpty
(
itemTypeId
))
{
itemType
=
TimingAcquisition
.
itemTypeMap
.
get
(
itemTypeId
).
getDescription
();
}
if
(!
StringUtils
.
isEmpty
(
itemAttributeId
))
{
itemAttribute
=
TimingAcquisition
.
attributeMap
.
get
(
itemAttributeId
).
getAttribute
()
+
"属性"
;
}
String
text
=
""
;
if
(
feedText
.
length
()
==
0
)
{
//获取对应话术
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_type_no_exist"
);
}
else
{
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
//获取对应话术
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_type_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemLevelName
,
itemAttribute
,
itemType
,
feedText
.
toString
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_type_success"
);
}
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400302
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看商品回复2"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
/**
* 根据宠物名称获取物宠物id
* 根据宠物名称获取物宠物id
* @param petName
* @param petName
* @return Integer
* @return Integer
...
@@ -1133,6 +1329,8 @@ public class TimingAcquisition {
...
@@ -1133,6 +1329,8 @@ public class TimingAcquisition {
//该地区所有玩家地址
//该地区所有玩家地址
Map
<
String
,
RegionDto
>
regionMap
=
addressMap
.
get
(
place
);
Map
<
String
,
RegionDto
>
regionMap
=
addressMap
.
get
(
place
);
List
<
String
>
addressList
=
new
ArrayList
<>(
regionMap
.
keySet
());
List
<
String
>
addressList
=
new
ArrayList
<>(
regionMap
.
keySet
());
//去除玩家本人
addressList
.
removeIf
(
location:
:
contains
);
addressList
.
sort
(
new
Comparator
<
String
>()
{
addressList
.
sort
(
new
Comparator
<
String
>()
{
@Override
@Override
public
int
compare
(
String
s
,
String
t1
)
{
public
int
compare
(
String
s
,
String
t1
)
{
...
@@ -1155,16 +1353,20 @@ public class TimingAcquisition {
...
@@ -1155,16 +1353,20 @@ public class TimingAcquisition {
/**
/**
* 找到指定地址上一家的玩家地址
* 找到指定地址上一家的玩家地址
* @param uid
* @param address
* @param address
* @return String
* @return String
*/
*/
public
static
String
findLastAddress
(
String
address
)
{
public
static
String
findLastAddress
(
String
uid
,
String
address
)
{
//该玩家的地址
String
location
=
gardenerMap
.
get
(
uid
).
getLocation
();
String
result
=
null
;
String
result
=
null
;
String
place
=
TypeConvertUtil
.
extractChinese
(
address
);
String
place
=
TypeConvertUtil
.
extractChinese
(
address
);
String
num
=
address
.
replace
(
place
,
""
);
//该地区所有玩家地址
//该地区所有玩家地址
Map
<
String
,
RegionDto
>
regionMap
=
addressMap
.
get
(
place
);
Map
<
String
,
RegionDto
>
regionMap
=
addressMap
.
get
(
place
);
List
<
String
>
addressList
=
new
ArrayList
<>(
regionMap
.
keySet
());
List
<
String
>
addressList
=
new
ArrayList
<>(
regionMap
.
keySet
());
//去除玩家本人
addressList
.
removeIf
(
location:
:
contains
);
addressList
.
sort
(
new
Comparator
<
String
>()
{
addressList
.
sort
(
new
Comparator
<
String
>()
{
@Override
@Override
public
int
compare
(
String
s
,
String
t1
)
{
public
int
compare
(
String
s
,
String
t1
)
{
...
@@ -1189,13 +1391,17 @@ public class TimingAcquisition {
...
@@ -1189,13 +1391,17 @@ public class TimingAcquisition {
* @param address
* @param address
* @return String
* @return String
*/
*/
public
static
String
findNextAddress
(
String
address
)
{
public
static
String
findNextAddress
(
String
uid
,
String
address
)
{
//该玩家的地址
String
location
=
gardenerMap
.
get
(
uid
).
getLocation
();
String
result
=
null
;
String
result
=
null
;
String
place
=
TypeConvertUtil
.
extractChinese
(
address
);
String
place
=
TypeConvertUtil
.
extractChinese
(
address
);
String
num
=
address
.
replace
(
place
,
""
);
String
num
=
address
.
replace
(
place
,
""
);
//该地区所有玩家地址
//该地区所有玩家地址
Map
<
String
,
RegionDto
>
regionMap
=
addressMap
.
get
(
place
);
Map
<
String
,
RegionDto
>
regionMap
=
addressMap
.
get
(
place
);
List
<
String
>
addressList
=
new
ArrayList
<>(
regionMap
.
keySet
());
List
<
String
>
addressList
=
new
ArrayList
<>(
regionMap
.
keySet
());
//去除玩家本人
addressList
.
removeIf
(
location:
:
contains
);
addressList
.
sort
(
new
Comparator
<
String
>()
{
addressList
.
sort
(
new
Comparator
<
String
>()
{
@Override
@Override
public
int
compare
(
String
s
,
String
t1
)
{
public
int
compare
(
String
s
,
String
t1
)
{
...
@@ -1257,4 +1463,36 @@ public class TimingAcquisition {
...
@@ -1257,4 +1463,36 @@ public class TimingAcquisition {
}
}
}
}
}
}
/**
* 根据玩家称呼和性别获取到玩家称呼id
* @param uid
* @param callName
* @return Integer
*/
public
static
Integer
getCallNameId
(
String
uid
,
String
callName
)
{
//园丁性别
Integer
gender
=
gardenerMap
.
get
(
uid
).
getGardenerInfo
().
getGender
();
//找到对应的称呼id
for
(
Map
.
Entry
<
Integer
,
CallNamePojo
>
entry
:
callNameMap
.
entrySet
())
{
CallNamePojo
callNamePojo
=
entry
.
getValue
();
if
(
callName
.
equals
(
callNamePojo
.
getName
())
&&
gender
.
equals
(
callNamePojo
.
getGender
()))
{
return
entry
.
getKey
();
}
}
//没找到对应称呼
return
Constants
.
REQ_NON
;
}
/**
* 根据玩家称呼id和性别获取到玩家称呼
* @param uid
* @return CallNamePojo
*/
public
static
CallNamePojo
getCallNameByUid
(
String
uid
)
{
//园丁性别
Integer
callNameId
=
gardenerMap
.
get
(
uid
).
getGardenerInfo
().
getCallNameId
();
//找到对应的称呼id
return
callNameMap
.
get
(
callNameId
);
}
}
}
src/main/java/com/qiwuai/garden/common/utils/HttpUtil.java
View file @
473b78fa
...
@@ -16,11 +16,11 @@ public class HttpUtil {
...
@@ -16,11 +16,11 @@ public class HttpUtil {
static
Logger
log
=
LoggerFactory
.
getLogger
(
HttpUtil
.
class
);
static
Logger
log
=
LoggerFactory
.
getLogger
(
HttpUtil
.
class
);
//动态词组更新秘钥
//动态词组更新秘钥
public
static
String
appSecret
=
YamlUtil
.
getValueByKey
(
"appSecret"
);
public
static
String
appSecret
=
YamlUtil
.
getValueByKey
(
"appSecret"
);
//动态词组更新秘钥
public
static
String
updatePhraseUrl
=
YamlUtil
.
getValueByKey
(
"updatePhraseUrl"
);
public
static
void
doPut
(
String
phraseName
,
String
phraseContent
)
{
public
static
void
doPut
(
String
phraseName
,
String
phraseContent
)
{
RestTemplate
template
=
new
RestTemplate
();
RestTemplate
template
=
new
RestTemplate
();
String
url
=
"http://hw-gz24.heyqiwu.cn:8082/out/phrase"
;
// url = "fake";
//获取时间戳
//获取时间戳
long
timestamp
=
System
.
currentTimeMillis
();
long
timestamp
=
System
.
currentTimeMillis
();
//签名
//签名
...
@@ -41,7 +41,7 @@ public class HttpUtil {
...
@@ -41,7 +41,7 @@ public class HttpUtil {
httpHeaders
.
set
(
"Timestamp"
,
String
.
valueOf
(
timestamp
));
httpHeaders
.
set
(
"Timestamp"
,
String
.
valueOf
(
timestamp
));
httpHeaders
.
set
(
"Authorization"
,
authorization
);
httpHeaders
.
set
(
"Authorization"
,
authorization
);
HttpEntity
<
JSONObject
>
request
=
new
HttpEntity
<>(
object
,
httpHeaders
);
HttpEntity
<
JSONObject
>
request
=
new
HttpEntity
<>(
object
,
httpHeaders
);
ResponseEntity
<
PhraseResponse
>
forObject
=
template
.
exchange
(
url
,
HttpMethod
.
PUT
,
request
,
PhraseResponse
.
class
);
ResponseEntity
<
PhraseResponse
>
forObject
=
template
.
exchange
(
u
pdatePhraseU
rl
,
HttpMethod
.
PUT
,
request
,
PhraseResponse
.
class
);
System
.
out
.
println
(
"动态词组更新后的返回结果"
+
forObject
);
System
.
out
.
println
(
"动态词组更新后的返回结果"
+
forObject
);
log
.
info
(
phraseName
+
"的动态词组更新结果:"
+
forObject
.
getBody
());
log
.
info
(
phraseName
+
"的动态词组更新结果:"
+
forObject
.
getBody
());
}
}
...
...
src/main/java/com/qiwuai/garden/common/utils/RandomDropUtil.java
View file @
473b78fa
...
@@ -272,13 +272,13 @@ public class RandomDropUtil {
...
@@ -272,13 +272,13 @@ public class RandomDropUtil {
String
firstPetId
=
TimingAcquisition
.
systemConfigMap
.
get
(
"first_pet_id"
).
getValue
();
String
firstPetId
=
TimingAcquisition
.
systemConfigMap
.
get
(
"first_pet_id"
).
getValue
();
String
firstPetProb
=
TimingAcquisition
.
systemConfigMap
.
get
(
"first_pet_prob"
).
getValue
();
String
firstPetProb
=
TimingAcquisition
.
systemConfigMap
.
get
(
"first_pet_prob"
).
getValue
();
GardenerDto
gardener
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
);
GardenerDto
gardener
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
);
Integer
harvestTime
=
gardener
.
getTaskCountMap
().
get
(
Constants
.
HARVES
T_EVENT
);
Integer
getPetTime
=
gardener
.
getTaskCountMap
().
get
(
Constants
.
GET_PE
T_EVENT
);
//玩家第一次收获时给指定宠物
//玩家第一次收获时给指定宠物
if
(
harves
tTime
==
0
)
{
if
(
getPe
tTime
==
0
)
{
//统计有概率出现的宠物
//统计有概率出现的宠物
Random
random
=
new
Random
();
Random
random
=
new
Random
();
double
randomProb
=
random
.
nextDouble
();
double
randomProb
=
random
.
nextDouble
();
if
(
randomProb
<
Double
.
parseDouble
(
firstPetProb
))
{
if
(
randomProb
<
=
Double
.
parseDouble
(
firstPetProb
))
{
petList
.
add
(
Integer
.
valueOf
(
firstPetId
));
petList
.
add
(
Integer
.
valueOf
(
firstPetId
));
}
}
}
else
{
}
else
{
...
...
src/main/java/com/qiwuai/garden/common/utils/RequestConversionUtil.java
View file @
473b78fa
...
@@ -187,6 +187,12 @@ public class RequestConversionUtil {
...
@@ -187,6 +187,12 @@ public class RequestConversionUtil {
}
}
operationRequest
.
setLevel
(
number
);
operationRequest
.
setLevel
(
number
);
}
}
//---------------存在玩家称呼-----------------
String
callName
=
callRequest
.
get
玩家称呼
();
if
(!
StringUtils
.
isEmpty
(
callName
))
{
Integer
callNameId
=
TimingAcquisition
.
getCallNameId
(
commonRequest
.
getUid
(),
callName
);
operationRequest
.
setCallNameId
(
callNameId
);
}
//-----------------存在所属地区--------------------
//-----------------存在所属地区--------------------
String
region
=
callRequest
.
get
所属地区
();
String
region
=
callRequest
.
get
所属地区
();
if
(!
StringUtils
.
isEmpty
(
region
))
{
if
(!
StringUtils
.
isEmpty
(
region
))
{
...
@@ -229,6 +235,29 @@ public class RequestConversionUtil {
...
@@ -229,6 +235,29 @@ public class RequestConversionUtil {
operationRequest
.
setItemTypeId
(
itemTypeId
);
operationRequest
.
setItemTypeId
(
itemTypeId
);
}
}
}
}
//-----------------存在物品属性------------------
String
itemAttribute
=
callRequest
.
get
物品属性
();
if
(!
StringUtils
.
isEmpty
(
itemAttribute
))
{
Integer
itemAttributeId
=
TimingAcquisition
.
getItemAttributeIdByName
(
itemAttribute
);
if
(!
StringUtils
.
isEmpty
(
itemAttributeId
))
{
operationRequest
.
setItemAttributeId
(
itemAttributeId
);
}
}
//-----------------存在物品等级------------------
String
itemLevel
=
callRequest
.
get
物品等级
();
if
(!
StringUtils
.
isEmpty
(
itemLevel
))
{
//找到中文数字对应的阿拉伯数字
Integer
number
=
TypeConvertUtil
.
change2Integer
(
itemLevel
);
//中文中不包含中文数字时,提取阿拉伯数字
if
(
number
==
0
)
{
number
=
TypeConvertUtil
.
extractNum
(
itemLevel
);
}
if
(
itemLevel
.
length
()
>
10
)
{
operationRequest
.
setNumber
(
Constants
.
REQ_NON
);
}
else
{
operationRequest
.
setItemLevel
(
number
);
}
}
//-----------------存在数量--------------------
//-----------------存在数量--------------------
String
num
=
callRequest
.
get
数量
();
String
num
=
callRequest
.
get
数量
();
if
(!
StringUtils
.
isEmpty
(
num
))
{
if
(!
StringUtils
.
isEmpty
(
num
))
{
...
...
src/main/java/com/qiwuai/garden/controller/CommonController.java
View file @
473b78fa
...
@@ -103,6 +103,9 @@ public class CommonController {
...
@@ -103,6 +103,9 @@ public class CommonController {
case
"更改园丁性别"
:
case
"更改园丁性别"
:
result
=
gardenerServiceProxy
.
changeGender
(
operationReq
);
result
=
gardenerServiceProxy
.
changeGender
(
operationReq
);
break
;
break
;
case
"更改玩家称呼"
:
result
=
gardenerServiceProxy
.
changeCallName
(
operationReq
);
break
;
case
"种植"
:
case
"种植"
:
result
=
plantServiceProxy
.
seedCheck
(
operationReq
);
result
=
plantServiceProxy
.
seedCheck
(
operationReq
);
break
;
break
;
...
@@ -241,7 +244,7 @@ public class CommonController {
...
@@ -241,7 +244,7 @@ public class CommonController {
case
"宠物移至花圃指令"
:
case
"宠物移至花圃指令"
:
result
=
petServiceProxy
.
petMoveToNursery
(
operationReq
);
result
=
petServiceProxy
.
petMoveToNursery
(
operationReq
);
break
;
break
;
case
"宠物移至宠物栏指令"
:
case
"
花圃
宠物移至宠物栏指令"
:
result
=
petServiceProxy
.
petMoveToField
(
operationReq
);
result
=
petServiceProxy
.
petMoveToField
(
operationReq
);
break
;
break
;
case
"花圃宠物移动指令"
:
case
"花圃宠物移动指令"
:
...
@@ -280,6 +283,9 @@ public class CommonController {
...
@@ -280,6 +283,9 @@ public class CommonController {
case
"取消查看花圃宠物指令"
:
case
"取消查看花圃宠物指令"
:
result
=
petServiceProxy
.
nurseryPetCheckCancel
(
operationReq
);
result
=
petServiceProxy
.
nurseryPetCheckCancel
(
operationReq
);
break
;
break
;
case
"花圃宠物调换指令"
:
result
=
petServiceProxy
.
nurseryPetSwitch
(
operationReq
);
break
;
case
"购买指令"
:
case
"购买指令"
:
result
=
marketServiceProxy
.
buyCheck
(
operationReq
);
result
=
marketServiceProxy
.
buyCheck
(
operationReq
);
break
;
break
;
...
...
src/main/java/com/qiwuai/garden/dao/CallNameMapper.java
0 → 100644
View file @
473b78fa
package
com
.
qiwuai
.
garden
.
dao
;
import
com.qiwuai.garden.pojo.CallNamePojo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Mapper
@Repository
public
interface
CallNameMapper
{
List
<
CallNamePojo
>
findAll
();
}
src/main/java/com/qiwuai/garden/dto/GardenerInfoDto.java
View file @
473b78fa
...
@@ -19,6 +19,10 @@ public class GardenerInfoDto implements Serializable {
...
@@ -19,6 +19,10 @@ public class GardenerInfoDto implements Serializable {
* */
* */
private
String
name
;
private
String
name
;
/**
/**
* 称呼id
* */
private
Integer
callNameId
;
/**
* 性别:1-男,2-女
* 性别:1-男,2-女
* */
* */
private
Integer
gender
;
private
Integer
gender
;
...
...
src/main/java/com/qiwuai/garden/dto/base/ResultResponse.java
View file @
473b78fa
...
@@ -40,6 +40,14 @@ public class ResultResponse {
...
@@ -40,6 +40,14 @@ public class ResultResponse {
* 玩家金币数量,bot话题模块需要该变量
* 玩家金币数量,bot话题模块需要该变量
*/
*/
private
Integer
玩家金币数量
;
private
Integer
玩家金币数量
;
/**
* 玩家称呼,bot话题模块需要该变量
*/
private
String
玩家称呼
;
/**
* 玩家第二人称称呼,bot话题模块需要该变量
*/
private
String
玩家第二人称称呼
;
/***************************用于清空bot端保留的变量***********************************/
/***************************用于清空bot端保留的变量***********************************/
/**
/**
...
...
src/main/java/com/qiwuai/garden/dto/request/CallRequest.java
View file @
473b78fa
...
@@ -56,6 +56,10 @@ public class CallRequest {
...
@@ -56,6 +56,10 @@ public class CallRequest {
*/
*/
private
String
园丁等级
;
private
String
园丁等级
;
/**
/**
* 玩家称呼
*/
private
String
玩家称呼
;
/**
* 所属地区
* 所属地区
*/
*/
private
String
所属地区
;
private
String
所属地区
;
...
@@ -72,6 +76,14 @@ public class CallRequest {
...
@@ -72,6 +76,14 @@ public class CallRequest {
*/
*/
private
String
物品种类
;
private
String
物品种类
;
/**
/**
* 物品属性
*/
private
String
物品属性
;
/**
* 物品等级
*/
private
String
物品等级
;
/**
* 物品数量
* 物品数量
*/
*/
private
String
数量
;
private
String
数量
;
...
...
src/main/java/com/qiwuai/garden/dto/request/OperationRequest.java
View file @
473b78fa
...
@@ -35,6 +35,10 @@ public class OperationRequest {
...
@@ -35,6 +35,10 @@ public class OperationRequest {
*/
*/
private
Integer
level
;
private
Integer
level
;
/**
/**
* 玩家称呼id
*/
private
Integer
callNameId
;
/**
* 物品id
* 物品id
*/
*/
private
Integer
itemId
;
private
Integer
itemId
;
...
@@ -47,6 +51,14 @@ public class OperationRequest {
...
@@ -47,6 +51,14 @@ public class OperationRequest {
*/
*/
private
Integer
itemTypeId
;
private
Integer
itemTypeId
;
/**
/**
* 物品属性id
*/
private
Integer
itemAttributeId
;
/**
* 物品等级id
*/
private
Integer
itemLevel
;
/**
* 当前花圃编号,花圃信息保存时的key值
* 当前花圃编号,花圃信息保存时的key值
*/
*/
private
Integer
nurseryNum
;
private
Integer
nurseryNum
;
...
@@ -174,5 +186,9 @@ public class OperationRequest {
...
@@ -174,5 +186,9 @@ public class OperationRequest {
* 本轮反馈id
* 本轮反馈id
*/
*/
private
Integer
operation
;
private
Integer
operation
;
/**
* 下个页数
*/
private
Integer
page
;
}
}
src/main/java/com/qiwuai/garden/pojo/CallNamePojo.java
0 → 100644
View file @
473b78fa
package
com
.
qiwuai
.
garden
.
pojo
;
import
lombok.Data
;
@Data
public
class
CallNamePojo
{
/**
* 称呼id
*/
private
Integer
id
;
/**
* 称呼
*/
private
String
name
;
/**
* 副称呼
*/
private
String
subName
;
/**
* 性别
*/
private
Integer
gender
;
}
src/main/java/com/qiwuai/garden/pojo/ItemPojo.java
View file @
473b78fa
...
@@ -33,6 +33,10 @@ public class ItemPojo {
...
@@ -33,6 +33,10 @@ public class ItemPojo {
*/
*/
private
Integer
salable
;
private
Integer
salable
;
/**
/**
* 物品属性
*/
private
Integer
attributeId
;
/**
* 创建时间
* 创建时间
*/
*/
private
String
createTime
;
private
String
createTime
;
...
...
src/main/java/com/qiwuai/garden/service/backPackService/impl/BackPackServiceImpl.java
View file @
473b78fa
...
@@ -54,21 +54,28 @@ public class BackPackServiceImpl implements BackPackService {
...
@@ -54,21 +54,28 @@ public class BackPackServiceImpl implements BackPackService {
}
}
//种类名称
//种类名称
String
itemTypeName
=
TimingAcquisition
.
itemTypeMap
.
get
(
entry
.
getKey
()).
getDescription
();
String
itemTypeName
=
TimingAcquisition
.
itemTypeMap
.
get
(
entry
.
getKey
()).
getDescription
();
feedText
.
append
(
itemTypeName
).
append
(
count
).
append
(
"个,"
);
if
(
count
>
0
)
{
feedText
.
append
(
itemTypeName
).
append
(
count
).
append
(
"个,"
);
}
else
{
itemTypeCount
--;
}
}
}
}
}
String
text
=
""
;
if
(
feedText
.
length
()
!=
0
)
{
if
(
feedText
.
length
()
!=
0
)
{
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
//获取对应话术
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"view_back_pack"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
itemTypeCount
),
feedText
.
toString
());
resultResponse
.
set
后台附加返回
(
"查看背包回复1"
);
}
else
{
//获取对应话术
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"view_back_pack_fail_none"
);
}
}
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"view_back_pack"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
itemTypeCount
),
feedText
.
toString
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
200401
);
resultResponse
.
set
反馈
ID
(
200401
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看背包回复1"
);
resultVarsResponse
.
setVars
(
resultResponse
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
...
...
src/main/java/com/qiwuai/garden/service/gardenerService/GardenerService.java
View file @
473b78fa
...
@@ -23,6 +23,12 @@ public interface GardenerService {
...
@@ -23,6 +23,12 @@ public interface GardenerService {
*/
*/
CommonResponse
changeGender
(
OperationRequest
operationReq
);
CommonResponse
changeGender
(
OperationRequest
operationReq
);
/**
/**
* 更改玩家称呼
* @param
* @param
*/
CommonResponse
changeCallName
(
OperationRequest
operationReq
);
/**
* 查看园丁等级
* 查看园丁等级
* @param operationReq
* @param operationReq
* @return CommonResponse
* @return CommonResponse
...
...
src/main/java/com/qiwuai/garden/service/gardenerService/impl/GardenerServiceImpl.java
View file @
473b78fa
...
@@ -205,6 +205,18 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -205,6 +205,18 @@ public class GardenerServiceImpl implements GardenerService {
}
}
TimingAcquisition
.
addressMap
.
get
(
region
).
put
(
location
,
regionTmp
);
TimingAcquisition
.
addressMap
.
get
(
region
).
put
(
location
,
regionTmp
);
}
}
//---------------------更新玩家地址的动态词组-------------------
Map
<
String
,
Map
<
String
,
RegionDto
>>
addressMap
=
TimingAcquisition
.
addressMap
;
if
(
addressMap
.
size
()
!=
0
)
{
//所有玩家地址
List
<
String
>
playerList
=
new
ArrayList
<>();
for
(
String
address
:
addressMap
.
keySet
())
{
List
<
String
>
regionPlayerList
=
new
ArrayList
<>(
addressMap
.
get
(
address
).
keySet
());
playerList
.
addAll
(
regionPlayerList
);
}
String
address
=
String
.
join
(
"+"
,
playerList
);
HttpUtil
.
doPut
(
"玩家地址"
,
address
);
}
//玩家初始宠物id
//玩家初始宠物id
String
initialPet
=
TimingAcquisition
.
systemConfigMap
.
get
(
"initial_pet"
).
getValue
();
String
initialPet
=
TimingAcquisition
.
systemConfigMap
.
get
(
"initial_pet"
).
getValue
();
//初始化宠物栏
//初始化宠物栏
...
@@ -290,8 +302,17 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -290,8 +302,17 @@ public class GardenerServiceImpl implements GardenerService {
gardenerInfo
.
setLevel
(
Constants
.
INITIAL_LV
);
gardenerInfo
.
setLevel
(
Constants
.
INITIAL_LV
);
gardenerInfo
.
setSkillResetTimes
(
0
);
gardenerInfo
.
setSkillResetTimes
(
0
);
gardenerInfo
.
setCreateTime
(
nowTime
);
gardenerInfo
.
setCreateTime
(
nowTime
);
String
renameFreeTimes
=
TimingAcquisition
.
systemConfigMap
.
get
(
"rename_free_times"
).
getValue
();
String
renameFreeTimes
=
TimingAcquisition
.
systemConfigMap
.
get
(
"rename_free_times"
).
getValue
();
//免费改名次数
gardenerInfo
.
setRenameFreeTimes
(
Integer
.
valueOf
(
renameFreeTimes
));
gardenerInfo
.
setRenameFreeTimes
(
Integer
.
valueOf
(
renameFreeTimes
));
//找到对应的称呼id
Integer
callNameId
=
null
;
for
(
Map
.
Entry
<
Integer
,
CallNamePojo
>
entry
:
TimingAcquisition
.
callNameMap
.
entrySet
())
{
CallNamePojo
callNamePojo
=
entry
.
getValue
();
if
(
"主人"
.
equals
(
callNamePojo
.
getName
())
&&
gender
.
equals
(
callNamePojo
.
getGender
()))
{
callNameId
=
entry
.
getKey
();
}
}
gardenerInfo
.
setCallNameId
(
callNameId
);
//7.初始化消息提醒
//7.初始化消息提醒
Map
<
String
,
Integer
>
notice
=
new
ConcurrentHashMap
<>();
Map
<
String
,
Integer
>
notice
=
new
ConcurrentHashMap
<>();
...
@@ -366,6 +387,62 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -366,6 +387,62 @@ public class GardenerServiceImpl implements GardenerService {
}
}
@Override
@Override
public
CommonResponse
changeCallName
(
OperationRequest
operationReq
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
Integer
callNameId
=
operationReq
.
getCallNameId
();
//园丁基本信息
GardenerInfoDto
gardenerInfo
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGardenerInfo
();
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
log
.
info
(
uid
+
"开始更改玩家称呼"
+
gardenerInfo
.
getCallNameId
()
+
"为"
+
callNameId
);
//玩家未提供称呼
if
(
StringUtils
.
isEmpty
(
callNameId
))
{
log
.
info
(
uid
+
"未提供玩家称呼,无法更改称呼"
);
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"gardener_call_name_change_fail_null"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
1000104
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//玩家提供的称呼不存在
if
(
callNameId
==
Constants
.
REQ_NON
)
{
log
.
info
(
uid
+
"提供的玩家称呼不存在"
);
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"gardener_call_name_change_fail_not_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
1000105
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
CallNamePojo
callNamePojo
=
TimingAcquisition
.
callNameMap
.
get
(
callNameId
);
assert
callNamePojo
!=
null
;
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"gardener_call_name_change_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callNamePojo
.
getName
(),
callNamePojo
.
getSubName
());
gardenerInfo
.
setCallNameId
(
callNameId
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
1000103
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
玩家称呼
(
callNamePojo
.
getName
());
resultResponse
.
set
玩家第二人称称呼
(
callNamePojo
.
getSubName
());
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
@Override
public
CommonResponse
gardenerLevelCheck
(
OperationRequest
operationReq
)
{
public
CommonResponse
gardenerLevelCheck
(
OperationRequest
operationReq
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
...
@@ -395,6 +472,7 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -395,6 +472,7 @@ public class GardenerServiceImpl implements GardenerService {
ResultResponse
resultResponse
=
new
ResultResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
String
uid
=
operationReq
.
getUid
();
String
noviceGuide
=
operationReq
.
getNoviceGuide
();
//新手引导已经进行到的步骤
log
.
info
(
uid
+
"开始查询园丁升级条件"
);
log
.
info
(
uid
+
"开始查询园丁升级条件"
);
//园丁基本信息
//园丁基本信息
GardenerInfoDto
gardenerInfo
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGardenerInfo
();
GardenerInfoDto
gardenerInfo
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGardenerInfo
();
...
@@ -438,14 +516,29 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -438,14 +516,29 @@ public class GardenerServiceImpl implements GardenerService {
feedText
.
append
(
itemConfigMap
.
get
(
item
.
getItemId
()).
getName
()).
append
(
item
.
getItemNum
()).
append
(
"个、"
);
feedText
.
append
(
itemConfigMap
.
get
(
item
.
getItemId
()).
getName
()).
append
(
item
.
getItemNum
()).
append
(
"个、"
);
}
}
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
//---------------------新手引导的园丁升级至2任务开启,满足条件则开放园丁升级功能------------------------
if
(
gardenerInfo
.
getLevel
()
==
1
)
{
if
(!
StringUtils
.
isEmpty
(
noviceGuide
))
{
if
(!
"完成10010"
.
equals
(
noviceGuide
))
{
log
.
info
(
uid
+
"新手引导的园丁升级任务10011还未开启"
);
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"gardener_upgrade_fail_task_open"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
200119
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
}
}
//保存玩家这轮的请求信息,用于下一步的确认或取消操作
//保存玩家这轮的请求信息,用于下一步的确认或取消操作
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"gardener_upgrade_check"
);
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"gardener_upgrade_check"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
gardenerInfo
.
getLevel
().
toString
(),
feedText
.
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
gardenerInfo
.
getLevel
().
toString
(),
feedText
.
toString
());
text
+=
SpeechUtil
.
getGardenerSpeech
(
gender
,
"gardener_upgrade_check"
);
text
+=
SpeechUtil
.
getGardenerSpeech
(
gender
,
"gardener_upgrade_check"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
200101
);
resultResponse
.
set
反馈
ID
(
200101
);
...
@@ -612,7 +705,12 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -612,7 +705,12 @@ public class GardenerServiceImpl implements GardenerService {
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
feedText
.
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
feedText
.
toString
());
text
+=
SpeechUtil
.
getGardenerSpeech
(
gender
,
"gardener_upgrade_success"
);
text
+=
SpeechUtil
.
getGardenerSpeech
(
gender
,
"gardener_upgrade_success"
);
resultResponse
.
set
后台附加返回
(
"升级园丁回复3"
);
resultResponse
.
set
后台附加返回
(
"升级园丁回复3"
);
//---------------------新手引导的园丁升级任务完成------------------------
//---------------------新手引导的园丁升级至2任务完成------------------------
if
(
"完成10010"
.
equals
(
noviceGuide
)
&&
gardenerInfo
.
getLevel
()
==
2
)
{
resultResponse
.
set
任务完成
(
"10011"
);
log
.
info
(
uid
+
"新手引导的园丁升级任务10011已完成"
);
}
//---------------------新手引导的园丁升级至3任务完成------------------------
if
(
"完成10018"
.
equals
(
noviceGuide
)
&&
gardenerInfo
.
getLevel
()
==
3
)
{
if
(
"完成10018"
.
equals
(
noviceGuide
)
&&
gardenerInfo
.
getLevel
()
==
3
)
{
resultResponse
.
set
任务完成
(
"10019"
);
resultResponse
.
set
任务完成
(
"10019"
);
log
.
info
(
uid
+
"新手引导的园丁升级任务10019已完成"
);
log
.
info
(
uid
+
"新手引导的园丁升级任务10019已完成"
);
...
...
src/main/java/com/qiwuai/garden/service/helpService/HelpService.java
View file @
473b78fa
...
@@ -293,7 +293,7 @@ public interface HelpService {
...
@@ -293,7 +293,7 @@ public interface HelpService {
* @param operationReq
* @param operationReq
* @return CommonResponse
* @return CommonResponse
*/
*/
CommonResponse
stealStrangerRuleCheck
(
OperationRequest
operationReq
);
CommonResponse
stealStrangerRuleCheck
(
OperationRequest
operationReq
)
throws
ParseException
;
/**
/**
* 查询偷菜简报规则
* 查询偷菜简报规则
* @param operationReq
* @param operationReq
...
...
src/main/java/com/qiwuai/garden/service/helpService/impl/HelpServiceImpl.java
View file @
473b78fa
...
@@ -1704,13 +1704,17 @@ public class HelpServiceImpl implements HelpService {
...
@@ -1704,13 +1704,17 @@ public class HelpServiceImpl implements HelpService {
}
}
@Override
@Override
public
CommonResponse
stealStrangerRuleCheck
(
OperationRequest
operationReq
)
{
public
CommonResponse
stealStrangerRuleCheck
(
OperationRequest
operationReq
)
throws
ParseException
{
CommonResponse
commonResponse
=
new
CommonResponse
();
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
//偷菜的冷却时间
String
stealColdTime
=
TimingAcquisition
.
systemConfigMap
.
get
(
"steal_cold_time"
).
getValue
();
String
coldTime
=
DateUtil
.
timeToDate
(
Long
.
parseLong
(
stealColdTime
));
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getHelpSpeech
(
Constants
.
SPEECH_ASIDE
,
"steal_stranger_rule_check"
);
String
text
=
SpeechUtil
.
getHelpSpeech
(
Constants
.
SPEECH_ASIDE
,
"steal_stranger_rule_check"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
coldTime
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
801602
);
resultResponse
.
set
反馈
ID
(
801602
);
...
...
src/main/java/com/qiwuai/garden/service/marketService/impl/MarketServiceImpl.java
View file @
473b78fa
...
@@ -12,10 +12,7 @@ import com.qiwuai.garden.dto.base.CommonResponse;
...
@@ -12,10 +12,7 @@ import com.qiwuai.garden.dto.base.CommonResponse;
import
com.qiwuai.garden.dto.base.ResultResponse
;
import
com.qiwuai.garden.dto.base.ResultResponse
;
import
com.qiwuai.garden.dto.base.ResultVarsResponse
;
import
com.qiwuai.garden.dto.base.ResultVarsResponse
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.pojo.GoodsPojo
;
import
com.qiwuai.garden.pojo.*
;
import
com.qiwuai.garden.pojo.ItemPojo
;
import
com.qiwuai.garden.pojo.ItemTypePojo
;
import
com.qiwuai.garden.pojo.PlantPojo
;
import
com.qiwuai.garden.service.marketService.MarketService
;
import
com.qiwuai.garden.service.marketService.MarketService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -82,10 +79,13 @@ public class MarketServiceImpl implements MarketService {
...
@@ -82,10 +79,13 @@ public class MarketServiceImpl implements MarketService {
}
}
//园丁性别
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
//玩家称呼
CallNamePojo
callName
=
TimingAcquisition
.
getCallNameByUid
(
uid
);
//玩家没有说物品名称时,返回提示需要买什么
//玩家没有说物品名称时,返回提示需要买什么
if
(
StringUtils
.
isEmpty
(
itemId
))
{
if
(
StringUtils
.
isEmpty
(
itemId
))
{
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_check_fail_no_name"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_check_fail_no_name"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400105
);
resultResponse
.
set
反馈
ID
(
400105
);
...
@@ -101,6 +101,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -101,6 +101,7 @@ public class MarketServiceImpl implements MarketService {
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_item_no_exist"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_item_no_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400109
);
resultResponse
.
set
反馈
ID
(
400109
);
...
@@ -117,6 +118,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -117,6 +118,7 @@ public class MarketServiceImpl implements MarketService {
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_item_no_exist"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_item_no_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400109
);
resultResponse
.
set
反馈
ID
(
400109
);
...
@@ -147,6 +149,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -147,6 +149,7 @@ public class MarketServiceImpl implements MarketService {
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_level"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_level"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
level
.
toString
(),
goodsName
,
goods
.
getLevel
().
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
level
.
toString
(),
goodsName
,
goods
.
getLevel
().
toString
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_level"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_level"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400110
);
resultResponse
.
set
反馈
ID
(
400110
);
...
@@ -168,6 +171,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -168,6 +171,7 @@ public class MarketServiceImpl implements MarketService {
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_item_no_exist"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_item_no_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400109
);
resultResponse
.
set
反馈
ID
(
400109
);
...
@@ -184,6 +188,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -184,6 +188,7 @@ public class MarketServiceImpl implements MarketService {
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_check_fail_no_num"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_check_fail_no_num"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_check_fail_no_num"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_check_fail_no_num"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400106
);
resultResponse
.
set
反馈
ID
(
400106
);
...
@@ -216,6 +221,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -216,6 +221,7 @@ public class MarketServiceImpl implements MarketService {
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_check_success"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_check_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
number
.
toString
(),
goodsName
,
String
.
valueOf
(
price
),
moneyConfig
.
getName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
number
.
toString
(),
goodsName
,
String
.
valueOf
(
price
),
moneyConfig
.
getName
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_check_success"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_check_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
log
.
info
(
uid
+
"购买"
+
number
+
"个"
+
goodsName
+
"需要花费"
+
price
+
"的"
+
moneyConfig
.
getName
());
log
.
info
(
uid
+
"购买"
+
number
+
"个"
+
goodsName
+
"需要花费"
+
price
+
"的"
+
moneyConfig
.
getName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
...
@@ -253,10 +259,13 @@ public class MarketServiceImpl implements MarketService {
...
@@ -253,10 +259,13 @@ public class MarketServiceImpl implements MarketService {
}
}
//园丁性别
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
//玩家称呼
CallNamePojo
callName
=
TimingAcquisition
.
getCallNameByUid
(
uid
);
//玩家没有说物品名称时,返回提示需要买什么
//玩家没有说物品名称时,返回提示需要买什么
if
(
StringUtils
.
isEmpty
(
itemId
))
{
if
(
StringUtils
.
isEmpty
(
itemId
))
{
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_check_fail_no_name"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_check_fail_no_name"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400105
);
resultResponse
.
set
反馈
ID
(
400105
);
...
@@ -348,6 +357,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -348,6 +357,7 @@ public class MarketServiceImpl implements MarketService {
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_money"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_money"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_money"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_money"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400103
);
resultResponse
.
set
反馈
ID
(
400103
);
...
@@ -381,6 +391,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -381,6 +391,7 @@ public class MarketServiceImpl implements MarketService {
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_success"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
number
.
toString
(),
itemConfig
.
getName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
number
.
toString
(),
itemConfig
.
getName
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_success"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400102
);
resultResponse
.
set
反馈
ID
(
400102
);
...
@@ -407,9 +418,12 @@ public class MarketServiceImpl implements MarketService {
...
@@ -407,9 +418,12 @@ public class MarketServiceImpl implements MarketService {
//园丁性别
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
log
.
info
(
uid
+
"取消本轮购买完成"
);
log
.
info
(
uid
+
"取消本轮购买完成"
);
//玩家地址
CallNamePojo
callName
=
TimingAcquisition
.
getCallNameByUid
(
uid
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_cancel"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_cancel"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_cancel"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_cancel"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400104
);
resultResponse
.
set
反馈
ID
(
400104
);
...
@@ -885,34 +899,21 @@ public class MarketServiceImpl implements MarketService {
...
@@ -885,34 +899,21 @@ public class MarketServiceImpl implements MarketService {
ResultResponse
resultResponse
=
new
ResultResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
String
uid
=
operationReq
.
getUid
();
Integer
itemTypeId
=
operationReq
.
getItemTypeId
();
Integer
itemTypeId
=
operationReq
.
getItemTypeId
();
//物品种类
Integer
itemAttributeId
=
operationReq
.
getItemAttributeId
();
//物品属性
Integer
itemLevel
=
operationReq
.
getItemLevel
();
//物品等级
Integer
itemId
=
operationReq
.
getItemId
();
Integer
itemId
=
operationReq
.
getItemId
();
Integer
plantId
=
operationReq
.
getPlantId
();
Integer
plantId
=
operationReq
.
getPlantId
();
log
.
info
(
uid
+
"开始查看商品,物品类型id:"
+
itemTypeId
+
",物品id:"
+
itemId
+
",植物id:"
+
plantId
);
log
.
info
(
uid
+
"开始查看商品,物品
等级:"
+
itemLevel
+
", 物品属性id:"
+
itemAttributeId
+
",物品
类型id:"
+
itemTypeId
+
",物品id:"
+
itemId
+
",植物id:"
+
plantId
);
//园丁性别
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
//玩家没有指定种类、特定商品
if
(
StringUtils
.
isEmpty
(
itemTypeId
)
&&
StringUtils
.
isEmpty
(
itemId
)
&&
StringUtils
.
isEmpty
(
plantId
))
{
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_no_name"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400301
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看商品回复1"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//园丁等级
Integer
level
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGardenerInfo
().
getLevel
();
//获取商品配置信息
Map
<
Integer
,
GoodsPojo
>
goodsConfigMap
=
TimingAcquisition
.
goodsConfigMap
;
//物品配置信息
Map
<
Integer
,
ItemPojo
>
itemConfigMap
=
TimingAcquisition
.
itemConfigMap
;
//货币配置信息
//货币配置信息
Integer
moneyId
=
Integer
.
parseInt
(
TimingAcquisition
.
systemConfigMap
.
get
(
"money"
).
getValue
());
Integer
moneyId
=
Integer
.
parseInt
(
TimingAcquisition
.
systemConfigMap
.
get
(
"money"
).
getValue
());
ItemPojo
moneyConfig
=
TimingAcquisition
.
itemConfigMap
.
get
(
moneyId
);
ItemPojo
moneyConfig
=
TimingAcquisition
.
itemConfigMap
.
get
(
moneyId
);
//获取商品配置信息
Map
<
Integer
,
GoodsPojo
>
goodsConfigMap
=
TimingAcquisition
.
goodsConfigMap
;
//园丁等级
Integer
level
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGardenerInfo
().
getLevel
();
Map
<
Integer
,
GoodsPojo
>
goodsLevelMap
=
new
ConcurrentHashMap
<>();
Map
<
Integer
,
GoodsPojo
>
goodsLevelMap
=
new
ConcurrentHashMap
<>();
//当前玩家的园丁等级可购买的物品
//当前玩家的园丁等级可购买的物品
for
(
Map
.
Entry
<
Integer
,
GoodsPojo
>
entry
:
goodsConfigMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Integer
,
GoodsPojo
>
entry
:
goodsConfigMap
.
entrySet
())
{
...
@@ -922,74 +923,19 @@ public class MarketServiceImpl implements MarketService {
...
@@ -922,74 +923,19 @@ public class MarketServiceImpl implements MarketService {
goodsLevelMap
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
goodsLevelMap
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
}
}
String
text
=
""
;
StringBuilder
feedText
=
new
StringBuilder
();
StringBuilder
feedText
=
new
StringBuilder
();
//1.玩家指定了物品种类
//--------------玩家根据上一轮查看了商品情况下,查看下一页
if
(!
StringUtils
.
isEmpty
(
itemTypeId
)
&&
StringUtils
.
isEmpty
(
itemId
))
{
//当前玩家上一轮的请求信息
//物品种类不存在
OperationRequest
lastReq
=
(
OperationRequest
)
CacheUtil
.
get
(
uid
);
if
(
itemTypeId
==
Constants
.
REQ_NON
)
{
//物品配置信息
log
.
info
(
uid
+
"提供的物品种类不存在"
);
Map
<
Integer
,
ItemPojo
>
itemConfigMap
=
TimingAcquisition
.
itemConfigMap
;
//获取对应话术
//1.玩家指定了物品名称
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_type_no_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈
ID
(
400304
);
resultResponse
.
set
后台附加返回
(
"查看商品回复1"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//保存根据物品种类找到的物品id,用于下一步的购买操作
List
<
Integer
>
itemIdList
=
new
ArrayList
<>();
//找出商品的物品类型是itemTypeId的物品
for
(
Map
.
Entry
<
Integer
,
GoodsPojo
>
entry
:
goodsLevelMap
.
entrySet
())
{
GoodsPojo
goods
=
entry
.
getValue
();
ItemPojo
itemPojo
=
itemConfigMap
.
get
(
goods
.
getItemId
());
if
(
itemTypeId
.
equals
(
itemPojo
.
getItemTypeId
()))
{
String
price
=
(
goods
.
getDiscount
().
multiply
(
new
BigDecimal
(
goods
.
getPrice
()))).
stripTrailingZeros
().
toPlainString
();
feedText
.
append
(
itemPojo
.
getName
()).
append
(
"售价为"
).
append
(
price
).
append
(
moneyConfig
.
getName
()).
append
(
"/个、"
);
itemIdList
.
add
(
itemPojo
.
getId
());
}
}
//当前等级没有找到对应物品
if
(
StringUtils
.
isEmpty
(
feedText
.
toString
()))
{
//获取对应话术
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_type_no_goods"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
TimingAcquisition
.
itemTypeMap
.
get
(
itemTypeId
).
getDescription
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_fail_type_no_goods"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400305
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看商品回复1"
);
}
else
{
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
//保存玩家这轮的请求信息,用于下一步的操作
operationReq
.
setList
(
itemIdList
);
operationReq
.
setOperationLabel
(
Constants
.
CHECK_GOODS
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//获取对应话术
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_type_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
TimingAcquisition
.
itemTypeMap
.
get
(
itemTypeId
).
getDescription
(),
feedText
.
toString
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_type_success"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400302
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看商品回复2"
);
}
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//2.玩家指定了物品名称
if
(!
StringUtils
.
isEmpty
(
itemId
))
{
if
(!
StringUtils
.
isEmpty
(
itemId
))
{
//物品名称不存在
//物品名称不存在
if
(
itemId
==
Constants
.
REQ_NON
)
{
if
(
itemId
==
Constants
.
REQ_NON
)
{
log
.
info
(
uid
+
"玩家提供的物品名称不存在"
);
log
.
info
(
uid
+
"玩家提供的物品名称不存在"
);
//获取对应话术
//获取对应话术
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_item_no_exist"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_fail_item_no_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
...
@@ -1001,29 +947,30 @@ public class MarketServiceImpl implements MarketService {
...
@@ -1001,29 +947,30 @@ public class MarketServiceImpl implements MarketService {
}
}
//
//
//当前玩家上一轮的请求信息
//当前玩家上一轮的请求信息
OperationRequest
lastReq
=
(
OperationRequest
)
CacheUtil
.
get
(
uid
);
if
(!
StringUtils
.
isEmpty
(
lastReq
))
{
if
(!
StringUtils
.
isEmpty
(
lastReq
)
&&
Constants
.
CHECK_GOODS
.
equals
(
lastReq
.
getOperationLabel
()))
{
if
(
Constants
.
CHECK_GOODS
.
equals
(
lastReq
.
getOperationLabel
()))
{
List
<
Integer
>
itemIds
=
lastReq
.
getList
();
List
<
Integer
>
itemIds
=
lastReq
.
getList
();
if
(!
StringUtils
.
isEmpty
(
itemIds
))
{
if
(!
StringUtils
.
isEmpty
(
itemIds
))
{
//第一个
//第一个
if
(
itemId
==
Constants
.
REQ_FIRST
)
{
if
(
itemId
==
Constants
.
REQ_FIRST
)
{
itemId
=
itemIds
.
get
(
0
);
itemId
=
itemIds
.
get
(
0
);
}
}
//中间
//中间
if
(
itemId
==
Constants
.
REQ_MIDDLE
)
{
if
(
itemId
==
Constants
.
REQ_MIDDLE
)
{
itemId
=
itemIds
.
get
(
itemIds
.
size
()
/
2
);
itemId
=
itemIds
.
get
(
itemIds
.
size
()
/
2
);
}
}
//最后
//最后
if
(
itemId
==
Constants
.
REQ_LAST
)
{
if
(
itemId
==
Constants
.
REQ_LAST
)
{
itemId
=
itemIds
.
get
(
itemIds
.
size
()
-
1
);
itemId
=
itemIds
.
get
(
itemIds
.
size
()
-
1
);
}
}
//随机
//随机
if
(
itemId
==
Constants
.
REQ_RANDOM
)
{
if
(
itemId
==
Constants
.
REQ_RANDOM
)
{
int
num
=
RandomDropUtil
.
getRandomNum
(
0
,
itemIds
.
size
());
int
num
=
RandomDropUtil
.
getRandomNum
(
0
,
itemIds
.
size
());
itemId
=
itemIds
.
get
(
num
);
itemId
=
itemIds
.
get
(
num
);
}
}
if
(
itemId
>
0
&&
itemId
<=
itemIds
.
size
())
{
if
(
itemId
>
0
&&
itemId
<=
itemIds
.
size
())
{
itemId
=
itemIds
.
get
(
itemId
-
1
);
itemId
=
itemIds
.
get
(
itemId
-
1
);
}
}
}
}
}
}
}
...
@@ -1040,33 +987,10 @@ public class MarketServiceImpl implements MarketService {
...
@@ -1040,33 +987,10 @@ public class MarketServiceImpl implements MarketService {
break
;
break
;
}
}
}
}
//
找到了该
商品
//
没找到对应
商品
if
(
!
Constants
.
NON
.
equals
(
goodsId
))
{
if
(
Constants
.
NON
.
equals
(
goodsId
))
{
//获取对应话术
//获取对应话术
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_item_success"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_item_no_exist"
);
String
goodsName
=
goodsConfigMap
.
get
(
goodsId
).
getName
();
String
goodsDescription
=
goodsConfigMap
.
get
(
goodsId
).
getDescription
();
//商品名称为空,采用物品名称
if
(
StringUtils
.
isEmpty
(
goodsName
))
{
goodsName
=
itemConfigMap
.
get
(
itemId
).
getName
();
}
else
{
if
(
Constants
.
NON_STR
.
equals
(
goodsName
))
{
goodsName
=
itemConfigMap
.
get
(
itemId
).
getName
();
}
}
//商品描述为空,采用物品描述
if
(
StringUtils
.
isEmpty
(
goodsDescription
))
{
goodsDescription
=
itemConfigMap
.
get
(
itemId
).
getDescription
();
}
else
{
if
(
Constants
.
NON_STR
.
equals
(
goodsDescription
))
{
goodsDescription
=
itemConfigMap
.
get
(
itemId
).
getDescription
();
}
}
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
goodsName
,
goodsDescription
,
feedText
.
toString
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_item_success"
);
}
else
{
//没找到对应商品
//获取对应话术
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_fail_item_no_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
...
@@ -1076,13 +1000,48 @@ public class MarketServiceImpl implements MarketService {
...
@@ -1076,13 +1000,48 @@ public class MarketServiceImpl implements MarketService {
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
//找到了该商品
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_item_success"
);
String
goodsName
=
goodsConfigMap
.
get
(
goodsId
).
getName
();
String
goodsDescription
=
goodsConfigMap
.
get
(
goodsId
).
getDescription
();
//商品名称为空,采用物品名称
if
(
StringUtils
.
isEmpty
(
goodsName
))
{
goodsName
=
itemConfigMap
.
get
(
itemId
).
getName
();
}
else
{
if
(
Constants
.
NON_STR
.
equals
(
goodsName
))
{
goodsName
=
itemConfigMap
.
get
(
itemId
).
getName
();
}
}
//商品描述为空,采用物品描述
if
(
StringUtils
.
isEmpty
(
goodsDescription
))
{
goodsDescription
=
itemConfigMap
.
get
(
itemId
).
getDescription
();
}
else
{
if
(
Constants
.
NON_STR
.
equals
(
goodsDescription
))
{
goodsDescription
=
itemConfigMap
.
get
(
itemId
).
getDescription
();
}
}
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
goodsName
,
goodsDescription
,
feedText
.
toString
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_item_success"
);
//保存玩家这轮的请求信息,用于下一步的操作
operationReq
.
setItemId
(
itemId
);
operationReq
.
setOperationLabel
(
Constants
.
CHECK_GOODS
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400303
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看商品回复3"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
}
//
3
.玩家指定了植物名称,通过植物找到果实对应的itemId
//
2
.玩家指定了植物名称,通过植物找到果实对应的itemId
if
(!
StringUtils
.
isEmpty
(
plantId
))
{
if
(!
StringUtils
.
isEmpty
(
plantId
))
{
//植物名称不存在即物品名称不存在
//植物名称不存在即物品名称不存在
if
(
plantId
==
Constants
.
REQ_NON
)
{
if
(
plantId
==
Constants
.
REQ_NON
)
{
//获取对应话术
//获取对应话术
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_item_no_exist"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_fail_item_no_exist"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_fail_item_no_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
...
@@ -1108,56 +1067,142 @@ public class MarketServiceImpl implements MarketService {
...
@@ -1108,56 +1067,142 @@ public class MarketServiceImpl implements MarketService {
break
;
break
;
}
}
}
}
//
找到了该
商品
//
没找到对应
商品
if
(
!
Constants
.
NON
.
equals
(
goodsId
))
{
if
(
Constants
.
NON
.
equals
(
goodsId
))
{
//获取对应话术
//获取对应话术
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_item_success"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_item_no_exist"
);
String
goodsName
=
goodsConfigMap
.
get
(
goodsId
).
getName
();
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_fail_item_no_exist"
);
String
goodsDescription
=
goodsConfigMap
.
get
(
goodsId
).
getDescription
();
commonResponse
.
setCode
(
1
);
//商品名称为空,采用物品名称
commonResponse
.
setMsg
(
"成功"
);
if
(
StringUtils
.
isEmpty
(
goodsName
))
{
resultResponse
.
set
反馈
ID
(
400306
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//找到了该商品
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_item_success"
);
String
goodsName
=
goodsConfigMap
.
get
(
goodsId
).
getName
();
String
goodsDescription
=
goodsConfigMap
.
get
(
goodsId
).
getDescription
();
//商品名称为空,采用物品名称
if
(
StringUtils
.
isEmpty
(
goodsName
))
{
goodsName
=
itemConfigMap
.
get
(
itemId
).
getName
();
}
else
{
if
(
Constants
.
NON_STR
.
equals
(
goodsName
))
{
goodsName
=
itemConfigMap
.
get
(
itemId
).
getName
();
goodsName
=
itemConfigMap
.
get
(
itemId
).
getName
();
}
else
{
if
(
Constants
.
NON_STR
.
equals
(
goodsName
))
{
goodsName
=
itemConfigMap
.
get
(
itemId
).
getName
();
}
}
}
//商品描述为空,采用物品描述
}
if
(
StringUtils
.
isEmpty
(
goodsDescription
))
{
//商品描述为空,采用物品描述
if
(
StringUtils
.
isEmpty
(
goodsDescription
))
{
goodsDescription
=
itemConfigMap
.
get
(
itemId
).
getDescription
();
}
else
{
if
(
Constants
.
NON_STR
.
equals
(
goodsDescription
))
{
goodsDescription
=
itemConfigMap
.
get
(
itemId
).
getDescription
();
goodsDescription
=
itemConfigMap
.
get
(
itemId
).
getDescription
();
}
else
{
}
if
(
Constants
.
NON_STR
.
equals
(
goodsDescription
))
{
}
goodsDescription
=
itemConfigMap
.
get
(
itemId
).
getDescription
();
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
goodsName
,
goodsDescription
,
feedText
.
toString
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_item_success"
);
//保存玩家这轮的请求信息,用于下一步的操作
operationReq
.
setItemId
(
itemId
);
operationReq
.
setOperationLabel
(
Constants
.
CHECK_GOODS
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400303
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看商品回复3"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
if
(!
StringUtils
.
isEmpty
(
lastReq
))
{
if
(
Constants
.
CHECK_GOODS_CONDITION
.
equals
(
lastReq
.
getOperationLabel
()))
{
Integer
page
=
lastReq
.
getPage
();
//当前查看页数
List
<
Integer
>
itemIdList
=
lastReq
.
getList
();
//3.玩家指定了物品种类、物品属性、物品等级中的一个及以上
if
(!
StringUtils
.
isEmpty
(
itemTypeId
)
||
!
StringUtils
.
isEmpty
(
itemAttributeId
)
||
!
StringUtils
.
isEmpty
(
itemLevel
))
{
return
TimingAcquisition
.
getItemInfoByCondition
(
uid
,
goodsLevelMap
,
itemTypeId
,
itemAttributeId
,
itemLevel
,
expireTime
);
}
itemLevel
=
(
itemLevel
==
null
)
?
lastReq
.
getItemLevel
()
:
itemLevel
;
itemAttributeId
=
(
itemAttributeId
==
null
)
?
lastReq
.
getItemAttributeId
()
:
itemAttributeId
;
itemTypeId
=
(
itemTypeId
==
null
)
?
lastReq
.
getItemTypeId
()
:
itemTypeId
;
int
size
=
itemIdList
.
size
();
//可查看的所有物品的个数
int
start
=
(
page
-
1
)
*
Constants
.
PAGE_NUM
;
//开始页数
int
end
=
page
*
Constants
.
PAGE_NUM
;
//结束页数
if
((
start
<
size
)
&&
(
end
>
size
))
{
end
=
itemIdList
.
size
();
}
if
(
start
>=
size
)
{
page
=
1
;
start
=
0
;
end
=
page
*
Constants
.
PAGE_NUM
;
if
(
end
>
size
)
{
end
=
size
;
}
}
for
(
int
i
=
start
;
i
<
end
;
i
++)
{
itemId
=
itemIdList
.
get
(
i
);
//通过物品id找到商品
Integer
finalItemId
=
itemId
;
GoodsPojo
goods
=
TimingAcquisition
.
goodsConfigMap
.
values
().
stream
().
filter
(
goodsPojo
->
finalItemId
.
equals
(
goodsPojo
.
getItemId
())).
findAny
().
orElse
(
null
);
assert
goods
!=
null
;
if
(
itemIdList
.
get
(
i
).
equals
(
goods
.
getItemId
()))
{
String
price
=
(
goods
.
getDiscount
().
multiply
(
new
BigDecimal
(
goods
.
getPrice
()))).
stripTrailingZeros
().
toPlainString
();
feedText
.
append
(
TimingAcquisition
.
itemConfigMap
.
get
(
itemId
).
getName
()).
append
(
"售价为"
).
append
(
price
).
append
(
moneyConfig
.
getName
()).
append
(
"/个"
);
if
(
goods
.
getDiscount
().
compareTo
(
new
BigDecimal
(
1
))
<
0
)
{
feedText
.
append
(
"(该商品已打折)"
);
}
feedText
.
append
(
"、"
);
}
}
}
}
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
goodsName
,
goodsDescription
,
feedText
.
toString
());
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_item_success"
);
//保存玩家这轮的请求信息,用于下一步的操作
}
else
{
//没找到对应商品
operationReq
.
setItemLevel
(
itemLevel
);
operationReq
.
setItemAttributeId
(
itemAttributeId
);
operationReq
.
setItemTypeId
(
itemTypeId
);
operationReq
.
setList
(
itemIdList
);
operationReq
.
setOperationLabel
(
Constants
.
CHECK_GOODS_CONDITION
);
operationReq
.
setPage
(
page
+
1
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
String
itemLevelName
=
StringUtils
.
isEmpty
(
itemLevel
)
?
""
:
(
"等级"
+
itemLevel
+
"的"
);
String
itemType
=
""
;
String
itemAttribute
=
""
;
if
(!
StringUtils
.
isEmpty
(
itemTypeId
))
{
itemType
=
TimingAcquisition
.
itemTypeMap
.
get
(
itemTypeId
).
getDescription
();
}
if
(!
StringUtils
.
isEmpty
(
itemAttributeId
))
{
itemAttribute
=
TimingAcquisition
.
attributeMap
.
get
(
itemAttributeId
).
getAttribute
()
+
"属性"
;
}
//获取对应话术
//获取对应话术
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_item_no_exist"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_type_success"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_fail_item_no_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemLevelName
,
itemAttribute
,
itemType
,
feedText
.
toString
());
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"goods_check_type_success"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
40030
6
);
resultResponse
.
set
反馈
ID
(
40030
2
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看商品回复2"
);
resultVarsResponse
.
setVars
(
resultResponse
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
}
}
//保存玩家这轮的请求信息,用于下一步的操作
//玩家没有指定种类、特定商品
operationReq
.
setItemId
(
itemId
);
if
(
StringUtils
.
isEmpty
(
itemTypeId
)
&&
StringUtils
.
isEmpty
(
itemId
)
&&
StringUtils
.
isEmpty
(
plantId
)
&&
operationReq
.
setOperationLabel
(
Constants
.
CHECK_GOODS
);
StringUtils
.
isEmpty
(
itemAttributeId
)
&&
StringUtils
.
isEmpty
(
itemLevel
))
{
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//获取对应话术
commonResponse
.
setCode
(
1
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"goods_check_fail_no_name"
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setCode
(
1
);
resultResponse
.
set
反馈
ID
(
400303
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈
ID
(
400301
);
resultResponse
.
set
后台附加返回
(
"查看商品回复3"
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
resultResponse
.
set
后台附加返回
(
"查看商品回复1"
);
commonResponse
.
setData
(
resultVarsResponse
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
commonResponse
;
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//3.玩家指定了物品种类、物品属性、物品等级中的一个及以上
return
TimingAcquisition
.
getItemInfoByCondition
(
uid
,
goodsLevelMap
,
itemTypeId
,
itemAttributeId
,
itemLevel
,
expireTime
);
}
}
}
}
src/main/java/com/qiwuai/garden/service/nurseryService/impl/NurseryServiceImpl.java
View file @
473b78fa
...
@@ -56,6 +56,7 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -56,6 +56,7 @@ public class NurseryServiceImpl implements NurseryService {
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"nursery_amount_check"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"nursery_amount_check"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumText
,
String
.
valueOf
(
nurseryAmount
),
String
.
valueOf
(
level
),
nurseryMax
.
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumText
,
String
.
valueOf
(
nurseryAmount
),
String
.
valueOf
(
level
),
nurseryMax
.
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
"nursery_amount_check"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100901
);
resultResponse
.
set
反馈
ID
(
100901
);
...
@@ -84,6 +85,7 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -84,6 +85,7 @@ public class NurseryServiceImpl implements NurseryService {
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"check_nursery_fail_no_num"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"check_nursery_fail_no_num"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumText
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumText
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"check_nursery_fail_no_num"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
101007
);
resultResponse
.
set
反馈
ID
(
101007
);
...
@@ -185,6 +187,8 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -185,6 +187,8 @@ public class NurseryServiceImpl implements NurseryService {
if
(!
StringUtils
.
isEmpty
(
plant
)
&&
!
StringUtils
.
isEmpty
(
pet
))
{
if
(!
StringUtils
.
isEmpty
(
plant
)
&&
!
StringUtils
.
isEmpty
(
pet
))
{
addText
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"check_nursery_info_have_plant_pet"
);
addText
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"check_nursery_info_have_plant_pet"
);
addText
=
SpeechUtil
.
speechReplaceNum
(
addText
,
plant
.
getName
(),
plantStatusText
,
pet
.
getName
());
addText
=
SpeechUtil
.
speechReplaceNum
(
addText
,
plant
.
getName
(),
plantStatusText
,
pet
.
getName
());
text
+=
addText
;
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"check_nursery_info_have_plant_pet"
);
resultResponse
.
set
反馈
ID
(
101001
);
resultResponse
.
set
反馈
ID
(
101001
);
}
}
//2.有植物没宠物
//2.有植物没宠物
...
@@ -204,8 +208,6 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -204,8 +208,6 @@ public class NurseryServiceImpl implements NurseryService {
addText
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"check_nursery_info_no_plant_no_pet"
);
addText
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"check_nursery_info_no_plant_no_pet"
);
resultResponse
.
set
反馈
ID
(
101004
);
resultResponse
.
set
反馈
ID
(
101004
);
}
}
text
+=
addText
;
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_status"
);
// //有新来的宠物
// //有新来的宠物
if
(
nurseryInfo
.
getPetCheck
()
==
Constants
.
PET_UNCHECK
&&
!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPetField
()))
{
if
(
nurseryInfo
.
getPetCheck
()
==
Constants
.
PET_UNCHECK
&&
!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPetField
()))
{
nurseryInfo
.
setPetCheck
(
Constants
.
PET_CHECK
);
nurseryInfo
.
setPetCheck
(
Constants
.
PET_CHECK
);
...
@@ -1100,7 +1102,8 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -1100,7 +1102,8 @@ public class NurseryServiceImpl implements NurseryService {
//开启花圃数量已达到上限
//开启花圃数量已达到上限
if
(
nurseryCount
>=
nurseryMax
)
{
if
(
nurseryCount
>=
nurseryMax
)
{
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_fail_num"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"nursery_reclaim_fail_num"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_fail_num"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100802
);
resultResponse
.
set
反馈
ID
(
100802
);
...
@@ -1115,12 +1118,16 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -1115,12 +1118,16 @@ public class NurseryServiceImpl implements NurseryService {
Map
<
Integer
,
ItemBagDto
>
itemBags
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getBackPack
().
getItemBags
();
Map
<
Integer
,
ItemBagDto
>
itemBags
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getBackPack
().
getItemBags
();
//获取背包的钱袋
//获取背包的钱袋
ItemDto
money
=
itemBags
.
get
(
Constants
.
ITEM_TYPE_MONEY
).
getItems
(
moneyId
);
ItemDto
money
=
itemBags
.
get
(
Constants
.
ITEM_TYPE_MONEY
).
getItems
(
moneyId
);
//货币名称
String
moneyName
=
TimingAcquisition
.
itemConfigMap
.
get
(
moneyId
).
getName
();
//获取开启花圃所需费用配置
//获取开启花圃所需费用配置
Map
<
Integer
,
NurseryReclaimPojo
>
nurseryReclaimMap
=
TimingAcquisition
.
nurseryReclaimMap
;
Map
<
Integer
,
NurseryReclaimPojo
>
nurseryReclaimMap
=
TimingAcquisition
.
nurseryReclaimMap
;
//开启花圃时,货币数量不够,以下的“nurseryCount - 1”,由"nurseryCount + 1 - 2"推导得出,其中2为初始花圃个数
//开启花圃时,货币数量不够,以下的“nurseryCount - 1”,由"nurseryCount + 1 - 2"推导得出,其中2为初始花圃个数
if
(
money
.
getItemNum
()
<
nurseryReclaimMap
.
get
(
nurseryCount
-
1
).
getCost
())
{
if
(
money
.
getItemNum
()
<
nurseryReclaimMap
.
get
(
nurseryCount
-
1
).
getCost
())
{
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_fail_money"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"nursery_reclaim_fail_money"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_fail_money"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
moneyName
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100803
);
resultResponse
.
set
反馈
ID
(
100803
);
...
@@ -1129,11 +1136,11 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -1129,11 +1136,11 @@ public class NurseryServiceImpl implements NurseryService {
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
//满足开启花圃条件,玩家进行二次确认
String
moneyName
=
TimingAcquisition
.
itemConfigMap
.
get
(
moneyId
).
getName
();
//货币名称
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"nursery_reclaim_check"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"nursery_reclaim_check"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
nurseryCount
+
1
),
nurseryReclaimMap
.
get
(
nurseryCount
-
1
).
getCost
().
toString
(),
moneyName
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
nurseryCount
+
1
),
nurseryReclaimMap
.
get
(
nurseryCount
-
1
).
getCost
().
toString
(),
moneyName
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_check"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
moneyName
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100801
);
resultResponse
.
set
反馈
ID
(
100801
);
...
@@ -1164,7 +1171,8 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -1164,7 +1171,8 @@ public class NurseryServiceImpl implements NurseryService {
//开启花圃数量已达到上限
//开启花圃数量已达到上限
if
(
nurseryCount
>=
nurseryMax
)
{
if
(
nurseryCount
>=
nurseryMax
)
{
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_fail_num"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"nursery_reclaim_fail_num"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_fail_num"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100802
);
resultResponse
.
set
反馈
ID
(
100802
);
...
@@ -1179,12 +1187,16 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -1179,12 +1187,16 @@ public class NurseryServiceImpl implements NurseryService {
Map
<
Integer
,
ItemBagDto
>
itemBags
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getBackPack
().
getItemBags
();
Map
<
Integer
,
ItemBagDto
>
itemBags
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getBackPack
().
getItemBags
();
//获取背包的钱袋
//获取背包的钱袋
ItemDto
money
=
itemBags
.
get
(
Constants
.
ITEM_TYPE_MONEY
).
getItems
(
moneyId
);
ItemDto
money
=
itemBags
.
get
(
Constants
.
ITEM_TYPE_MONEY
).
getItems
(
moneyId
);
//货币名称
String
moneyName
=
TimingAcquisition
.
itemConfigMap
.
get
(
moneyId
).
getName
();
//获取开启花圃所需费用配置
//获取开启花圃所需费用配置
Map
<
Integer
,
NurseryReclaimPojo
>
nurseryReclaimMap
=
TimingAcquisition
.
nurseryReclaimMap
;
Map
<
Integer
,
NurseryReclaimPojo
>
nurseryReclaimMap
=
TimingAcquisition
.
nurseryReclaimMap
;
//开启花圃时,货币数量不够,以下的“nurseryCount - 1”,由"nurseryCount + 1 - 2"推导得出,其中2为初始花圃个数
//开启花圃时,货币数量不够,以下的“nurseryCount - 1”,由"nurseryCount + 1 - 2"推导得出,其中2为初始花圃个数
if
(
money
.
getItemNum
()
<
nurseryReclaimMap
.
get
(
nurseryCount
-
1
).
getCost
())
{
if
(
money
.
getItemNum
()
<
nurseryReclaimMap
.
get
(
nurseryCount
-
1
).
getCost
())
{
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_fail_money"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"nursery_reclaim_fail_money"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_fail_money"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
moneyName
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100803
);
resultResponse
.
set
反馈
ID
(
100803
);
...
@@ -1213,7 +1225,9 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -1213,7 +1225,9 @@ public class NurseryServiceImpl implements NurseryService {
//------------------------园丁升级任务事件[开启花圃]是否完成------------------------
//------------------------园丁升级任务事件[开启花圃]是否完成------------------------
TaskResultDto
updateTaskResult
=
TimingAcquisition
.
checkUpdateTask
(
uid
,
Constants
.
RECLAIM_NURSERY_EVENT
);
TaskResultDto
updateTaskResult
=
TimingAcquisition
.
checkUpdateTask
(
uid
,
Constants
.
RECLAIM_NURSERY_EVENT
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_success"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"nursery_reclaim_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
nurseryCount
+
1
));
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"nursery_reclaim_success"
);
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[开启花圃]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[开启花圃]完成提醒
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
...
...
src/main/java/com/qiwuai/garden/service/petService/PetService.java
View file @
473b78fa
...
@@ -17,7 +17,7 @@ public interface PetService {
...
@@ -17,7 +17,7 @@ public interface PetService {
*/
*/
CommonResponse
petMoveToNursery
(
OperationRequest
operationReq
);
CommonResponse
petMoveToNursery
(
OperationRequest
operationReq
);
/**
/**
* 宠物移至宠物栏指令,将宠物从花圃中移动至宠物栏
*
花圃
宠物移至宠物栏指令,将宠物从花圃中移动至宠物栏
* @param operationReq
* @param operationReq
* @return CommonResponse
* @return CommonResponse
*/
*/
...
@@ -94,4 +94,10 @@ public interface PetService {
...
@@ -94,4 +94,10 @@ public interface PetService {
* @return CommonResponse
* @return CommonResponse
*/
*/
CommonResponse
nurseryPetCheckCancel
(
OperationRequest
operationReq
);
CommonResponse
nurseryPetCheckCancel
(
OperationRequest
operationReq
);
/**
* 花圃宠物调换指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse
nurseryPetSwitch
(
OperationRequest
operationReq
);
}
}
src/main/java/com/qiwuai/garden/service/petService/impl/PetServiceImpl.java
View file @
473b78fa
...
@@ -260,9 +260,11 @@ public class PetServiceImpl implements PetService {
...
@@ -260,9 +260,11 @@ public class PetServiceImpl implements PetService {
//花圃编号越界
//花圃编号越界
if
(
nurseryNum
>
nurseryInfoMap
.
size
())
{
if
(
nurseryNum
>
nurseryInfoMap
.
size
())
{
log
.
info
(
uid
+
"提供的花圃编号越界"
);
log
.
info
(
uid
+
"提供的花圃编号越界"
);
//所有的花圃
String
allNurseryText
=
TimingAcquisition
.
getAllNurseryNum
(
uid
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_fail_pos_over"
);
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_fail_pos_over"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
nurseryInfoMap
.
size
())
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
allNurseryText
);
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_nursery_fail_pos_over"
);
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_nursery_fail_pos_over"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
...
@@ -385,54 +387,14 @@ public class PetServiceImpl implements PetService {
...
@@ -385,54 +387,14 @@ public class PetServiceImpl implements PetService {
String
uid
=
operationReq
.
getUid
();
String
uid
=
operationReq
.
getUid
();
Integer
petId
=
operationReq
.
getPetId
();
Integer
petId
=
operationReq
.
getPetId
();
//当前玩家上一轮的请求信息
Integer
nurseryNum
=
operationReq
.
getNurseryNum
();
OperationRequest
lastReq
=
(
OperationRequest
)
CacheUtil
.
get
(
uid
);
if
(!
StringUtils
.
isEmpty
(
lastReq
))
{
petId
=
(
petId
==
null
)
?
lastReq
.
getPetId
()
:
petId
;
}
//保存玩家这轮的请求信息
if
(!
StringUtils
.
isEmpty
(
petId
))
{
operationReq
.
setPetId
((
petId
==
Constants
.
REQ_NON
)
?
null
:
petId
);
}
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//园丁性别
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
if
(
StringUtils
.
isEmpty
(
petId
))
{
log
.
info
(
uid
+
"的花圃没有提供宠物名称"
);
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_fail_no_pet_name"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
300313
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"宠物移动回复2"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
if
(
petId
==
Constants
.
REQ_NON
)
{
log
.
info
(
uid
+
"的花圃没有玩家提供的宠物名称"
);
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_fail_pet_not_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
300315
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//宠物配置信息
PetPojo
petConfig
=
TimingAcquisition
.
petConfigMap
.
get
(
petId
);
log
.
info
(
uid
+
"开始移动花圃中的宠物"
+
petConfig
.
getName
()
+
"到宠物栏"
);
//获取玩家所有花圃信息
Map
<
Integer
,
NurseryInfoDto
>
nurseryInfoMap
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGarden
().
getNurseryInfos
();
//获取玩家的宠物栏位
//获取玩家的宠物栏位
List
<
Integer
>
petList
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getPetFields
();
List
<
Integer
>
petList
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getPetFields
();
List
<
Integer
>
petIdList
=
nurseryInfoMap
.
values
().
stream
().
map
(
NurseryInfoDto:
:
getPetField
).
collect
(
Collectors
.
toList
());
//园丁宠物栏存放上限
//园丁宠物栏存放上限
int
petNumMax
=
TimingAcquisition
.
gardenerLevelMap
.
get
(
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGardenerInfo
().
getLevel
()).
getPetNumMax
();
int
petNumMax
=
TimingAcquisition
.
gardenerLevelMap
.
get
(
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGardenerInfo
().
getLevel
()).
getPetNumMax
();
//宠物栏没有空位了
//
1.
宠物栏没有空位了
if
(
petList
.
size
()
>=
petNumMax
)
{
if
(
petList
.
size
()
>=
petNumMax
)
{
log
.
info
(
uid
+
"的宠物栏已满"
);
log
.
info
(
uid
+
"的宠物栏已满"
);
//获取对应话术
//获取对应话术
...
@@ -446,55 +408,159 @@ public class PetServiceImpl implements PetService {
...
@@ -446,55 +408,159 @@ public class PetServiceImpl implements PetService {
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
//花圃中没有宠物
//所有的花圃
if
(
StringUtils
.
isEmpty
(
petIdList
))
{
String
allNurseryText
=
TimingAcquisition
.
getAllNurseryNum
(
uid
);
log
.
info
(
uid
+
"的花圃还没有宠物"
);
//2.没提供花圃编号和宠物名称
if
(
StringUtils
.
isEmpty
(
petId
)
&&
StringUtils
.
isEmpty
(
nurseryNum
))
{
log
.
info
(
uid
+
"没有提供花圃编号和宠物名称,无法移动"
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_field_fail_no_pet"
);
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_field_fail_null"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
petConfig
.
getName
());
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_field_fail_no_pet"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
30031
1
);
resultResponse
.
set
反馈
ID
(
30031
9
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"宠物移动回复1"
);
resultVarsResponse
.
setVars
(
resultResponse
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
//花圃中宠物不存在
//3.玩家提供了宠物名称和花圃编号
if
(!
petIdList
.
contains
(
petId
))
{
String
addText
=
""
;
log
.
info
(
uid
+
"的花圃没有"
+
petConfig
.
getName
());
if
(!
StringUtils
.
isEmpty
(
petId
)
&&
!
StringUtils
.
isEmpty
(
nurseryNum
))
{
//获取对应话术
//花圃编号不存在
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_field_fail_no_exist"
);
if
(
nurseryNum
==
Constants
.
REQ_NON
)
{
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
petConfig
.
getName
());
log
.
info
(
uid
+
"提供的花圃编号不存在"
);
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_field_fail_no_exist"
);
//获取对应话术
commonResponse
.
setCode
(
1
);
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_fail_wrong_num"
);
commonResponse
.
setMsg
(
"成功"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
allNurseryText
);
resultResponse
.
set
反馈
ID
(
300312
);
commonResponse
.
setCode
(
1
);
resultResponse
.
set
反馈文本
(
text
);
commonResponse
.
setMsg
(
"成功"
);
resultVarsResponse
.
setVars
(
resultResponse
);
resultResponse
.
set
反馈
ID
(
300321
);
commonResponse
.
setData
(
resultVarsResponse
);
resultResponse
.
set
反馈文本
(
text
);
return
commonResponse
;
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//花圃编号越界
int
size
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGarden
().
getNurseryInfos
().
size
();
if
(
nurseryNum
>
size
)
{
log
.
info
(
uid
+
"提供的花圃编号越界"
);
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_fail_wrong_num"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
allNurseryText
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
300321
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//获取玩家指定花圃的信息
NurseryInfoDto
nurseryInfo
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGarden
().
getNurseryInfos
().
get
(
nurseryNum
);
Integer
nurseryPetId
=
nurseryInfo
.
getPetField
();
if
(
StringUtils
.
isEmpty
(
nurseryPetId
))
{
log
.
info
(
uid
+
"的花圃"
+
nurseryNum
+
"中没有宠物,无法移动"
);
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_field_fail_no_pet"
);
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_field_fail_no_pet"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
300320
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"宠物移动回复1"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//玩家提供的宠物名称和花圃中的宠物不一致,提示玩家
if
(!
petId
.
equals
(
nurseryPetId
))
{
log
.
info
(
uid
+
"提供的宠物"
+
petId
+
"与花圃的宠物"
+
nurseryPetId
+
"不一致"
);
//获取对应话术
addText
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_field_fail_not_same"
);
}
}
}
//4.玩家仅提供了宠物名称
if
(!
StringUtils
.
isEmpty
(
petId
)
&&
StringUtils
.
isEmpty
(
nurseryNum
))
{
if
(
petId
==
Constants
.
REQ_NON
)
{
log
.
info
(
uid
+
"的花圃没有玩家提供的宠物名称"
);
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_fail_pet_not_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
300315
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//宠物配置信息
PetPojo
petConfig
=
TimingAcquisition
.
petConfigMap
.
get
(
petId
);
//获取玩家所有花圃信息
Map
<
Integer
,
NurseryInfoDto
>
nurseryInfoMap
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGarden
().
getNurseryInfos
();
List
<
Integer
>
petIdList
=
nurseryInfoMap
.
values
().
stream
().
map
(
NurseryInfoDto:
:
getPetField
).
collect
(
Collectors
.
toList
());
//花圃中没有宠物
if
(
StringUtils
.
isEmpty
(
petIdList
))
{
log
.
info
(
uid
+
"的花圃还没有宠物"
);
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_field_fail_no_pet"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
petConfig
.
getName
());
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_field_fail_no_pet"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
300311
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//花圃中没有宠物
if
(!
petIdList
.
contains
(
petId
))
{
log
.
info
(
uid
+
"的花圃没有"
+
petConfig
.
getName
());
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_field_fail_no_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
petConfig
.
getName
());
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_field_fail_no_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
300312
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
for
(
Map
.
Entry
<
Integer
,
NurseryInfoDto
>
entry
:
nurseryInfoMap
.
entrySet
())
{
NurseryInfoDto
nursery
=
entry
.
getValue
();
if
(
petId
.
equals
(
nursery
.
getPetField
()))
{
nurseryNum
=
entry
.
getKey
();
break
;
}
}
}
//获取玩家指定花圃的信息
NurseryInfoDto
nurseryInfo
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGarden
().
getNurseryInfos
().
get
(
nurseryNum
);
petId
=
nurseryInfo
.
getPetField
();
//宠物配置信息
PetPojo
petConfig
=
TimingAcquisition
.
petConfigMap
.
get
(
petId
);
log
.
info
(
uid
+
"开始移动花圃中的宠物"
+
petConfig
.
getName
()
+
"到宠物栏"
);
//宠物从花圃移动到宠物栏位
//宠物从花圃移动到宠物栏位
//宠物栏未满,可移动
//宠物栏未满,可移动
petList
.
add
(
petId
);
petList
.
add
(
petId
);
for
(
NurseryInfoDto
nurseryInfo
:
nurseryInfoMap
.
values
())
{
nurseryInfo
.
setPetField
(
null
);
if
(
petId
.
equals
(
nurseryInfo
.
getPetField
()))
{
//如果是新来宠物删除则标记已读
nurseryInfo
.
setPetField
(
null
);
if
(
nurseryInfo
.
getPetCheck
()
==
Constants
.
PET_UNCHECK
)
{
//如果是新来宠物删除则标记已读
nurseryInfo
.
setPetCheck
(
Constants
.
PET_CHECK
);
if
(
nurseryInfo
.
getPetCheck
()
==
Constants
.
PET_UNCHECK
)
{
nurseryInfo
.
setPetCheck
(
Constants
.
PET_CHECK
);
}
break
;
}
}
}
//清除缓存,本轮对话结束
//清除缓存,本轮对话结束
CacheGlobal
.
concurrentMap
.
remove
(
uid
);
CacheGlobal
.
concurrentMap
.
remove
(
uid
);
log
.
info
(
uid
+
"花圃中的宠物移动宠物栏结束"
);
log
.
info
(
uid
+
"花圃中的宠物移动宠物栏结束"
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_field_success"
);
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_field_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
petConfig
.
getName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNum
.
toString
(),
petConfig
.
getName
());
int
strPos
=
text
.
indexOf
(
"】"
);
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
text
).
insert
(
strPos
+
1
,
addText
);
text
=
sb
.
toString
();
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_field_success"
);
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_field_success"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
...
@@ -557,9 +623,11 @@ public class PetServiceImpl implements PetService {
...
@@ -557,9 +623,11 @@ public class PetServiceImpl implements PetService {
//花圃编号越界
//花圃编号越界
if
((
nurseryPos
>
nurseryInfoMap
.
size
())
||
(
nurseryNumPos
>
nurseryInfoMap
.
size
()))
{
if
((
nurseryPos
>
nurseryInfoMap
.
size
())
||
(
nurseryNumPos
>
nurseryInfoMap
.
size
()))
{
log
.
info
(
uid
+
"提供的花圃编号nurseryPos:"
+
nurseryPos
+
"或者nurseryNumPos:"
+
nurseryNumPos
+
"越界"
);
log
.
info
(
uid
+
"提供的花圃编号nurseryPos:"
+
nurseryPos
+
"或者nurseryNumPos:"
+
nurseryNumPos
+
"越界"
);
//所有的花圃
String
allNurseryText
=
TimingAcquisition
.
getAllNurseryNum
(
uid
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_fail_pos_over"
);
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_fail_pos_over"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
nurseryInfoMap
.
size
())
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
allNurseryText
);
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_nursery_fail_pos_over"
);
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_nursery_fail_pos_over"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
...
@@ -570,7 +638,7 @@ public class PetServiceImpl implements PetService {
...
@@ -570,7 +638,7 @@ public class PetServiceImpl implements PetService {
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
//
目的
地花圃中已有宠物,不可移动
//
指向
地花圃中已有宠物,不可移动
if
(!
StringUtils
.
isEmpty
(
nurseryInfoMap
.
get
(
nurseryNumPos
).
getPetField
()))
{
if
(!
StringUtils
.
isEmpty
(
nurseryInfoMap
.
get
(
nurseryNumPos
).
getPetField
()))
{
log
.
info
(
uid
+
"的nurseryNumPos:"
+
nurseryNumPos
+
"已有宠物,无法移动"
);
log
.
info
(
uid
+
"的nurseryNumPos:"
+
nurseryNumPos
+
"已有宠物,无法移动"
);
//获取对应话术
//获取对应话术
...
@@ -585,7 +653,7 @@ public class PetServiceImpl implements PetService {
...
@@ -585,7 +653,7 @@ public class PetServiceImpl implements PetService {
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
//花圃中没有宠物
//
主体
花圃中没有宠物
if
(
StringUtils
.
isEmpty
(
nurseryInfoMap
.
get
(
nurseryPos
).
getPetField
()))
{
if
(
StringUtils
.
isEmpty
(
nurseryInfoMap
.
get
(
nurseryPos
).
getPetField
()))
{
log
.
info
(
uid
+
"的花圃"
+
nurseryPos
+
"没有宠物"
);
log
.
info
(
uid
+
"的花圃"
+
nurseryPos
+
"没有宠物"
);
//获取对应话术
//获取对应话术
...
@@ -1647,6 +1715,7 @@ public class PetServiceImpl implements PetService {
...
@@ -1647,6 +1715,7 @@ public class PetServiceImpl implements PetService {
//获取对应话术
//获取对应话术
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
petNum
),
String
.
valueOf
(
nurseryInfoMap
.
size
()
-
petNum
));
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
petNum
),
String
.
valueOf
(
nurseryInfoMap
.
size
()
-
petNum
));
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"nursery_pet_check_free"
);
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"nursery_pet_check_free"
);
resultResponse
.
set
后台附加返回
(
"查看花圃宠物状况回复1"
);
}
}
log
.
info
(
uid
+
"查看花圃宠物数量详情完成"
);
log
.
info
(
uid
+
"查看花圃宠物数量详情完成"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
...
@@ -1896,4 +1965,114 @@ public class PetServiceImpl implements PetService {
...
@@ -1896,4 +1965,114 @@ public class PetServiceImpl implements PetService {
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
@Override
public
CommonResponse
nurseryPetSwitch
(
OperationRequest
operationReq
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
Integer
nurseryPos
=
operationReq
.
getNurseryPos
();
Integer
nurseryNumPos
=
operationReq
.
getNurseryNumPos
();
log
.
info
(
uid
+
"开始交换花圃"
+
nurseryPos
+
"中的宠物和花圃"
+
nurseryNumPos
+
"的宠物"
);
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
//有花圃位置,但格式不符合规范
if
(!
StringUtils
.
isEmpty
(
nurseryPos
))
{
if
(
nurseryPos
.
equals
(
Constants
.
REQ_NON
))
{
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_fail_wrong_pos"
);
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_nursery_fail_wrong_pos"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
301003
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
}
//获取玩家所有花圃信息
Map
<
Integer
,
NurseryInfoDto
>
nurseryInfoMap
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGarden
().
getNurseryInfos
();
//花圃编号越界
if
((
nurseryPos
>
nurseryInfoMap
.
size
())
||
(
nurseryNumPos
>
nurseryInfoMap
.
size
()))
{
log
.
info
(
uid
+
"提供的花圃编号nurseryPos:"
+
nurseryPos
+
"或者nurseryNumPos:"
+
nurseryNumPos
+
"越界"
);
//所有的花圃
String
allNurseryText
=
TimingAcquisition
.
getAllNurseryNum
(
uid
);
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_fail_pos_over"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
allNurseryText
);
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_nursery_fail_pos_over"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
301004
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"宠物移动回复1”"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//主体花圃中没有宠物,无法交换
if
(
StringUtils
.
isEmpty
(
nurseryInfoMap
.
get
(
nurseryPos
).
getPetField
()))
{
log
.
info
(
uid
+
"的主体花圃"
+
nurseryPos
+
"没有宠物,无法交换"
);
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_switch_fail_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryPos
.
toString
());
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_nursery_fail_none"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
301002
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//指向地花圃中没有宠物,无法交换
if
(
StringUtils
.
isEmpty
(
nurseryInfoMap
.
get
(
nurseryNumPos
).
getPetField
()))
{
log
.
info
(
uid
+
"的主体花圃nurseryNumPos:"
+
nurseryNumPos
+
"没有有宠物,无法交换"
);
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_switch_fail_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumPos
.
toString
());
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_nursery_fail_none"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
301002
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//取出主体花圃nurseryPos中的宠物id
int
id
=
nurseryInfoMap
.
get
(
nurseryPos
).
getPetField
();
//取出指向花圃nurseryNumPos中的宠物id
int
numId
=
nurseryInfoMap
.
get
(
nurseryNumPos
).
getPetField
();
//花圃nurseryPos与花圃nurseryNumPos的宠物进行交换
nurseryInfoMap
.
get
(
nurseryNumPos
).
setPetField
(
id
);
nurseryInfoMap
.
get
(
nurseryPos
).
setPetField
(
numId
);
//如果是新来宠物删除则标记已读
if
(
nurseryInfoMap
.
get
(
nurseryPos
).
getPetCheck
()
==
Constants
.
PET_UNCHECK
)
{
nurseryInfoMap
.
get
(
nurseryPos
).
setPetCheck
(
Constants
.
PET_CHECK
);
}
//如果是新来宠物删除则标记已读
if
(
nurseryInfoMap
.
get
(
nurseryNumPos
).
getPetCheck
()
==
Constants
.
PET_UNCHECK
)
{
nurseryInfoMap
.
get
(
nurseryNumPos
).
setPetCheck
(
Constants
.
PET_CHECK
);
}
//清除缓存,本轮对话结束
CacheGlobal
.
concurrentMap
.
remove
(
uid
);
log
.
info
(
uid
+
"交换花圃"
+
nurseryPos
+
"中的宠物和花圃"
+
nurseryNumPos
);
//获取对应话术
String
text
=
SpeechUtil
.
getPetSpeech
(
Constants
.
SPEECH_ASIDE
,
"pet_move_nursery_switch_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryPos
.
toString
(),
TimingAcquisition
.
petConfigMap
.
get
(
id
).
getName
(),
nurseryNumPos
.
toString
(),
TimingAcquisition
.
petConfigMap
.
get
(
numId
).
getName
());
text
+=
SpeechUtil
.
getPetSpeech
(
gender
,
"pet_move_nursery_success"
);
resultResponse
.
set
反馈
ID
(
301001
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
}
}
src/main/java/com/qiwuai/garden/service/plantService/impl/PlantServiceImpl.java
View file @
473b78fa
...
@@ -108,6 +108,8 @@ public class PlantServiceImpl implements PlantService {
...
@@ -108,6 +108,8 @@ public class PlantServiceImpl implements PlantService {
operationReq
.
setPlantId
(
plantId
);
operationReq
.
setPlantId
(
plantId
);
//保存玩家这轮的请求信息
//保存玩家这轮的请求信息
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//玩家称呼
CallNamePojo
callName
=
TimingAcquisition
.
getCallNameByUid
(
uid
);
//植物名称不存在
//植物名称不存在
if
(!
StringUtils
.
isEmpty
(
plantId
))
{
if
(!
StringUtils
.
isEmpty
(
plantId
))
{
//植物名称不存在
//植物名称不存在
...
@@ -137,6 +139,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -137,6 +139,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_no_nursery"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_no_nursery"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumText
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumText
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_no_nursery"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_no_nursery"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100112
);
resultResponse
.
set
反馈
ID
(
100112
);
...
@@ -157,6 +160,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -157,6 +160,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_nursery_not_exist"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_nursery_not_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumText
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumText
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_nursery_not_exist"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_nursery_not_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100117
);
resultResponse
.
set
反馈
ID
(
100117
);
...
@@ -207,6 +211,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -207,6 +211,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_nursery_not_exist"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_nursery_not_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumText
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNumText
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_nursery_not_exist"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_nursery_not_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100117
);
resultResponse
.
set
反馈
ID
(
100117
);
...
@@ -242,6 +247,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -242,6 +247,7 @@ public class PlantServiceImpl implements PlantService {
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_no_plant_name"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_no_plant_name"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100113
);
resultResponse
.
set
反馈
ID
(
100113
);
...
@@ -372,6 +378,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -372,6 +378,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_gardener_level"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_gardener_level"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
level
.
toString
(),
TimingAcquisition
.
plantMap
.
get
(
plantId
).
getName
(),
plant
.
getGardenerLevel
().
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
level
.
toString
(),
TimingAcquisition
.
plantMap
.
get
(
plantId
).
getName
(),
plant
.
getGardenerLevel
().
toString
());
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_gardener_level"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_gardener_level"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100110
);
resultResponse
.
set
反馈
ID
(
100110
);
...
@@ -392,6 +399,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -392,6 +399,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_seed_none"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_seed_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
TimingAcquisition
.
itemConfigMap
.
get
(
plant
.
getFruitId
()).
getName
());
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_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100119
);
resultResponse
.
set
反馈
ID
(
100119
);
...
@@ -435,6 +443,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -435,6 +443,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_nursery_level"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_nursery_level"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
TimingAcquisition
.
plantMap
.
get
(
plantId
).
getName
(),
plant
.
getNurseryLevel
().
toString
(),
nurseryConfig
.
getLevel
().
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
TimingAcquisition
.
plantMap
.
get
(
plantId
).
getName
(),
plant
.
getNurseryLevel
().
toString
(),
nurseryConfig
.
getLevel
().
toString
());
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_nursery_level"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_nursery_level"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100105
);
resultResponse
.
set
反馈
ID
(
100105
);
...
@@ -460,7 +469,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -460,7 +469,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_nursery_type"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_nursery_type"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
TimingAcquisition
.
plantMap
.
get
(
plantId
).
getName
(),
feedText
.
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
TimingAcquisition
.
plantMap
.
get
(
plantId
).
getName
(),
feedText
.
toString
());
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_nursery_type"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_nursery_type"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100106
);
resultResponse
.
set
反馈
ID
(
100106
);
...
@@ -485,6 +494,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -485,6 +494,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_skill"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_skill"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
skillInfo
.
getName
(),
plant
.
getName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
skillInfo
.
getName
(),
plant
.
getName
());
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_skill"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_skill"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100111
);
resultResponse
.
set
反馈
ID
(
100111
);
...
@@ -517,6 +527,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -517,6 +527,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_near_plant"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_near_plant"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
plantName
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
plantName
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_near_plant"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_near_plant"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100108
);
resultResponse
.
set
反馈
ID
(
100108
);
...
@@ -585,6 +596,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -585,6 +596,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_material"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_material"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
plant
.
getName
(),
itemName
,
"0"
,
item
.
getItemNum
().
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
plant
.
getName
(),
itemName
,
"0"
,
item
.
getItemNum
().
toString
());
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_material"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_material"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100114
);
resultResponse
.
set
反馈
ID
(
100114
);
...
@@ -604,6 +616,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -604,6 +616,7 @@ public class PlantServiceImpl implements PlantService {
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_material"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_fail_material"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
plant
.
getName
(),
itemName
,
itemPacket
.
getItemNum
().
toString
(),
item
.
getItemNum
().
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
plant
.
getName
(),
itemName
,
itemPacket
.
getItemNum
().
toString
(),
item
.
getItemNum
().
toString
());
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_material"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_fail_material"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100107
);
resultResponse
.
set
反馈
ID
(
100107
);
...
@@ -765,10 +778,13 @@ public class PlantServiceImpl implements PlantService {
...
@@ -765,10 +778,13 @@ public class PlantServiceImpl implements PlantService {
CacheGlobal
.
concurrentMap
.
remove
(
uid
);
CacheGlobal
.
concurrentMap
.
remove
(
uid
);
//园丁性别
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
//玩家称呼
CallNamePojo
callName
=
TimingAcquisition
.
getCallNameByUid
(
uid
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_success"
);
String
text
=
SpeechUtil
.
getPlantSpeech
(
Constants
.
SPEECH_ASIDE
,
"plant_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNum
.
toString
(),
plant
.
getName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNum
.
toString
(),
plant
.
getName
());
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_success"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[播种]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[播种]完成提醒
text
+=
dailyTaskResult
.
getResultText
();
//日常任务事件[播种]完成提醒
text
+=
dailyTaskResult
.
getResultText
();
//日常任务事件[播种]完成提醒
//升级任务已完成
//升级任务已完成
...
@@ -1260,7 +1276,8 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1260,7 +1276,8 @@ public class PlantServiceImpl implements PlantService {
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
int
count
=
0
;
int
count
=
0
;
TaskResultDto
taskResult
=
new
TaskResultDto
();
TaskResultDto
taskResult
=
new
TaskResultDto
();
//玩家称呼
CallNamePojo
callName
=
TimingAcquisition
.
getCallNameByUid
(
uid
);
//1.仅指定植物id的情况下-“收取某植物的果子”
//1.仅指定植物id的情况下-“收取某植物的果子”
if
(!
StringUtils
.
isEmpty
(
plantId
)
&&
StringUtils
.
isEmpty
(
nurseryNum
))
{
if
(!
StringUtils
.
isEmpty
(
plantId
)
&&
StringUtils
.
isEmpty
(
nurseryNum
))
{
//植物名称不存在
//植物名称不存在
...
@@ -1364,6 +1381,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1364,6 +1381,7 @@ public class PlantServiceImpl implements PlantService {
text
+=
taskResult
.
getResultText
();
//养成任务事件[获得宠物]完成提醒
text
+=
taskResult
.
getResultText
();
//养成任务事件[获得宠物]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[收获]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[收获]完成提醒
text
+=
dailyTaskResult
.
getResultText
();
//日常任务事件[收获]完成提醒
text
+=
dailyTaskResult
.
getResultText
();
//日常任务事件[收获]完成提醒
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
//所有升级条件已满足
//所有升级条件已满足
if
(
taskResult
.
isFinished
()
||
updateTaskResult
.
isFinished
())
{
if
(
taskResult
.
isFinished
()
||
updateTaskResult
.
isFinished
())
{
resultResponse
.
set
后台附加返回
2
(
"查看任务1"
);
resultResponse
.
set
后台附加返回
2
(
"查看任务1"
);
...
@@ -1521,6 +1539,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1521,6 +1539,7 @@ public class PlantServiceImpl implements PlantService {
text
+=
taskResult
.
getResultText
();
//养成任务事件[获得宠物]完成提醒
text
+=
taskResult
.
getResultText
();
//养成任务事件[获得宠物]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[收获]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[收获]完成提醒
text
+=
dailyTaskResult
.
getResultText
();
//日常任务事件[收获]完成提醒
text
+=
dailyTaskResult
.
getResultText
();
//日常任务事件[收获]完成提醒
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
//所有升级条件已满足
//所有升级条件已满足
if
(
taskResult
.
isFinished
()
||
updateTaskResult
.
isFinished
())
{
if
(
taskResult
.
isFinished
()
||
updateTaskResult
.
isFinished
())
{
resultResponse
.
set
后台附加返回
2
(
"查看任务1"
);
resultResponse
.
set
后台附加返回
2
(
"查看任务1"
);
...
@@ -1552,6 +1571,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1552,6 +1571,7 @@ public class PlantServiceImpl implements PlantService {
//3.仅指定植物状态的情况下-“收取成熟的果子”或“收取果子”
//3.仅指定植物状态的情况下-“收取成熟的果子”或“收取果子”
if
(
StringUtils
.
isEmpty
(
plantId
)
&&
StringUtils
.
isEmpty
(
nurseryNum
))
{
if
(
StringUtils
.
isEmpty
(
plantId
)
&&
StringUtils
.
isEmpty
(
nurseryNum
))
{
StringBuilder
feedText
=
new
StringBuilder
();
//各花圃植物状态查询
//各花圃植物状态查询
for
(
Map
.
Entry
<
Integer
,
NurseryInfoDto
>
entry
:
nurseryInfoMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Integer
,
NurseryInfoDto
>
entry
:
nurseryInfoMap
.
entrySet
())
{
NurseryInfoDto
nurseryInfo
=
entry
.
getValue
();
NurseryInfoDto
nurseryInfo
=
entry
.
getValue
();
...
@@ -1575,14 +1595,32 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1575,14 +1595,32 @@ public class PlantServiceImpl implements PlantService {
}
}
//花圃中植物已成熟
//花圃中植物已成熟
if
(
nurseryInfo
.
getStatus
()
==
Constants
.
PLANT_MATURE
)
{
if
(
nurseryInfo
.
getStatus
()
==
Constants
.
PLANT_MATURE
)
{
feedText
.
append
(
"花圃"
).
append
(
entry
.
getKey
()).
append
(
"的"
);
ItemDto
itemDto
=
nurseryInfo
.
getHarvestFruit
();
feedText
.
append
(
itemDto
.
getItemNum
()).
append
(
"个"
).
append
(
itemConfigMap
.
get
(
itemDto
.
getItemId
()).
getName
());
List
<
ItemDto
>
dropItems
=
nurseryInfo
.
getDropItems
();
if
(!
StringUtils
.
isEmpty
(
dropItems
)
&&
dropItems
.
size
()
!=
0
)
{
feedText
.
append
(
","
).
append
(
"额外收获了"
);
for
(
ItemDto
item
:
dropItems
)
{
if
(
item
.
getItemNum
()
!=
0
)
{
feedText
.
append
(
item
.
getItemNum
()).
append
(
"个"
).
append
(
itemConfigMap
.
get
(
item
.
getItemId
()).
getName
()).
append
(
"、"
);
}
}
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
}
feedText
.
append
(
"。"
);
//收集所有果实
fruitList
.
add
(
nurseryInfo
.
getHarvestFruit
());
fruitList
.
add
(
nurseryInfo
.
getHarvestFruit
());
//
植物成熟
有掉落物品
//
收集所
有掉落物品
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getDropItems
()
))
{
if
(!
StringUtils
.
isEmpty
(
dropItems
))
{
dropItemList
=
TypeConvertUtil
.
listMerge
(
dropItemList
,
nurseryInfo
.
getDropItems
()
);
dropItemList
=
TypeConvertUtil
.
listMerge
(
dropItemList
,
dropItems
);
}
}
harvestedNurseryMap
.
put
(
entry
.
getKey
(),
nurseryInfo
);
harvestedNurseryMap
.
put
(
entry
.
getKey
(),
nurseryInfo
);
}
}
}
}
if
(
feedText
.
length
()
!=
0
)
{
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
}
//所有花圃均未种植
//所有花圃均未种植
if
(
count
==
nurseryInfoMap
.
size
())
{
if
(
count
==
nurseryInfoMap
.
size
())
{
//获取对应话术
//获取对应话术
...
@@ -1608,19 +1646,6 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1608,19 +1646,6 @@ public class PlantServiceImpl implements PlantService {
return
commonResponse
;
return
commonResponse
;
}
}
//以上条件判断完可知植物已成熟
//以上条件判断完可知植物已成熟
StringBuilder
feedText
=
new
StringBuilder
();
for
(
ItemDto
itemDto
:
fruitList
)
{
feedText
.
append
(
itemDto
.
getItemNum
()).
append
(
"个"
).
append
(
itemConfigMap
.
get
(
itemDto
.
getItemId
()).
getName
()).
append
(
","
);
}
if
(!
StringUtils
.
isEmpty
(
dropItemList
)
&&
dropItemList
.
size
()
!=
0
)
{
feedText
.
append
(
"额外收获了"
);
for
(
ItemDto
item
:
dropItemList
)
{
if
(
item
.
getItemNum
()
!=
0
)
{
feedText
.
append
(
item
.
getItemNum
()).
append
(
"个"
).
append
(
itemConfigMap
.
get
(
item
.
getItemId
()).
getName
()).
append
(
"、"
);
}
}
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
}
log
.
info
(
"收获:"
+
feedText
);
log
.
info
(
"收获:"
+
feedText
);
//---------------------------更新玩家数据--------------------------
//---------------------------更新玩家数据--------------------------
dataUpdate
(
uid
,
harvestedNurseryMap
,
itemConfigMap
,
fruitList
,
dropItemList
);
dataUpdate
(
uid
,
harvestedNurseryMap
,
itemConfigMap
,
fruitList
,
dropItemList
);
...
@@ -1635,6 +1660,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1635,6 +1660,7 @@ public class PlantServiceImpl implements PlantService {
text
+=
taskResult
.
getResultText
();
//养成任务事件[获得宠物]完成提醒
text
+=
taskResult
.
getResultText
();
//养成任务事件[获得宠物]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[收获]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[收获]完成提醒
text
+=
dailyTaskResult
.
getResultText
();
//日常任务事件[收获]完成提醒
text
+=
dailyTaskResult
.
getResultText
();
//日常任务事件[收获]完成提醒
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
//所有升级条件已满足
//所有升级条件已满足
if
(
taskResult
.
isFinished
()
||
updateTaskResult
.
isFinished
())
{
if
(
taskResult
.
isFinished
()
||
updateTaskResult
.
isFinished
())
{
resultResponse
.
set
后台附加返回
2
(
"查看任务1"
);
resultResponse
.
set
后台附加返回
2
(
"查看任务1"
);
...
@@ -1764,6 +1790,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1764,6 +1790,7 @@ public class PlantServiceImpl implements PlantService {
text
+=
taskResult
.
getResultText
();
//养成任务事件[获得宠物]完成提醒
text
+=
taskResult
.
getResultText
();
//养成任务事件[获得宠物]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[收获]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[收获]完成提醒
text
+=
dailyTaskResult
.
getResultText
();
//日常任务事件[收获]完成提醒
text
+=
dailyTaskResult
.
getResultText
();
//日常任务事件[收获]完成提醒
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
//所有升级条件已满足
//所有升级条件已满足
if
(
taskResult
.
isFinished
()
||
updateTaskResult
.
isFinished
())
{
if
(
taskResult
.
isFinished
()
||
updateTaskResult
.
isFinished
())
{
resultResponse
.
set
后台附加返回
2
(
"查看任务1"
);
resultResponse
.
set
后台附加返回
2
(
"查看任务1"
);
...
...
src/main/java/com/qiwuai/garden/service/socialService/impl/SocialServiceImpl.java
View file @
473b78fa
...
@@ -107,6 +107,21 @@ public class SocialServiceImpl implements SocialService {
...
@@ -107,6 +107,21 @@ public class SocialServiceImpl implements SocialService {
if
(!
find
)
{
if
(!
find
)
{
//找到该玩家最近的玩家地址
//找到该玩家最近的玩家地址
String
nearestAddress
=
TimingAcquisition
.
findNearestAddress
(
uid
);
String
nearestAddress
=
TimingAcquisition
.
findNearestAddress
(
uid
);
//没有找到相邻玩家
if
(
StringUtils
.
isEmpty
(
nearestAddress
))
{
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"visit_stranger_check_fail_no_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nearestAddress
);
text
+=
SpeechUtil
.
getSocialSpeech
(
gender
,
"visit_stranger_check_fail_no_exist"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
500108
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"是否拜访相邻玩家"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"visit_stranger_check_fail_no_exist"
);
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"visit_stranger_check_fail_no_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nearestAddress
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nearestAddress
);
...
@@ -378,28 +393,80 @@ public class SocialServiceImpl implements SocialService {
...
@@ -378,28 +393,80 @@ public class SocialServiceImpl implements SocialService {
//当前玩家上一轮的请求信息
//当前玩家上一轮的请求信息
OperationRequest
lastReq
=
(
OperationRequest
)
CacheUtil
.
get
(
uid
);
OperationRequest
lastReq
=
(
OperationRequest
)
CacheUtil
.
get
(
uid
);
if
(
StringUtils
.
isEmpty
(
lastReq
))
{
if
(
StringUtils
.
isEmpty
(
lastReq
))
{
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"visit_other_address_fail_no_pre"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"失败,对话已结束"
);
commonResponse
.
setMsg
(
"成功"
);
return
commonResponse
;
resultResponse
.
set
反馈
ID
(
500110
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
}
String
address
=
lastReq
.
getAddress
();
//上一轮对话时玩家所处的地点
String
address
=
lastReq
.
getAddress
();
//上一轮对话时玩家所处的地点
//找到上一家的玩家地址
//通过上一轮玩家地址即当前所在地址找到上一家的玩家地址
String
lastAddress
=
TimingAcquisition
.
findLastAddress
(
uid
,
address
);
//获取对应话术
//没有找到上一家
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"add_friend_ask_fail_self"
);
if
(
StringUtils
.
isEmpty
(
lastAddress
))
{
text
+=
SpeechUtil
.
getSocialSpeech
(
gender
,
"add_friend_ask_fail_self"
);
//获取对应话术
commonResponse
.
setCode
(
1
);
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"visit_last_address_fail_no_one"
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setCode
(
1
);
resultResponse
.
set
反馈
ID
(
500213
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈
ID
(
500111
);
resultVarsResponse
.
setVars
(
resultResponse
);
resultResponse
.
set
反馈文本
(
text
);
commonResponse
.
setData
(
resultVarsResponse
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
commonResponse
;
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//-------------------------复用拜访陌生人和好友的操作-----------------------
OperationRequest
request
=
new
OperationRequest
();
request
.
setUid
(
uid
);
request
.
setAddress
(
lastAddress
);
return
visitStrangerCheck
(
request
);
}
}
@Override
@Override
public
CommonResponse
visitNextOne
(
OperationRequest
operationReq
)
{
public
CommonResponse
visitNextOne
(
OperationRequest
operationReq
)
{
return
null
;
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
//当前玩家上一轮的请求信息
OperationRequest
lastReq
=
(
OperationRequest
)
CacheUtil
.
get
(
uid
);
if
(
StringUtils
.
isEmpty
(
lastReq
))
{
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"visit_other_address_fail_no_pre"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
500112
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
String
address
=
lastReq
.
getAddress
();
//上一轮对话时玩家所处的地点
//通过上一轮玩家地址即当前所在地址找到下一家的玩家地址
String
nextAddress
=
TimingAcquisition
.
findNextAddress
(
uid
,
address
);
//没有找到下一家
if
(
StringUtils
.
isEmpty
(
nextAddress
))
{
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"visit_next_address_fail_no_one"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
500113
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//-------------------------复用拜访陌生人和好友的操作-----------------------
OperationRequest
request
=
new
OperationRequest
();
request
.
setUid
(
uid
);
request
.
setAddress
(
nextAddress
);
return
visitStrangerCheck
(
request
);
}
}
@Override
@Override
...
@@ -6887,7 +6954,14 @@ public class SocialServiceImpl implements SocialService {
...
@@ -6887,7 +6954,14 @@ public class SocialServiceImpl implements SocialService {
}
}
//获取帮助方的背包
//获取帮助方的背包
BackPackDto
backPack
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getBackPack
();
BackPackDto
backPack
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getBackPack
();
result
.
append
(
fruit
.
getItemNum
()).
append
(
"个"
).
append
(
itemConfigMap
.
get
(
fruit
.
getItemId
()).
getName
()).
append
(
"、"
);
result
.
append
(
fruit
.
getItemNum
()).
append
(
"个"
).
append
(
itemConfigMap
.
get
(
fruit
.
getItemId
()).
getName
()).
append
(
"、"
);
//有问题
if
(
dropItems
.
size
()
!=
0
)
{
result
.
append
(
"额外收取了"
);
for
(
ItemDto
item
:
dropItems
)
{
result
.
append
(
item
.
getItemNum
()).
append
(
"个"
).
append
(
itemConfigMap
.
get
(
item
.
getItemId
()).
getName
()).
append
(
"、"
);
}
result
.
deleteCharAt
(
result
.
length
()
-
1
);
}
//帮助方收获的果实放入其对应掉落物品中
//帮助方收获的果实放入其对应掉落物品中
dropItems
.
add
(
fruit
);
dropItems
.
add
(
fruit
);
//物品配置信息
//物品配置信息
...
@@ -6911,9 +6985,7 @@ public class SocialServiceImpl implements SocialService {
...
@@ -6911,9 +6985,7 @@ public class SocialServiceImpl implements SocialService {
}
else
{
//有则新增数量
}
else
{
//有则新增数量
itemPacket
.
setItemNum
(
itemPacket
.
getItemNum
()
+
item
.
getItemNum
());
itemPacket
.
setItemNum
(
itemPacket
.
getItemNum
()
+
item
.
getItemNum
());
}
}
result
.
append
(
item
.
getItemNum
()).
append
(
"个"
).
append
(
itemConfigMap
.
get
(
item
.
getItemId
()).
getName
()).
append
(
"、"
);
}
}
result
.
deleteCharAt
(
result
.
length
()
-
1
);
//------------------好友花圃中的植物结果次数减1---------------------
//------------------好友花圃中的植物结果次数减1---------------------
nurseryInfoSide
.
setFruitTimes
(
nurseryInfoSide
.
getFruitTimes
()
-
1
);
nurseryInfoSide
.
setFruitTimes
(
nurseryInfoSide
.
getFruitTimes
()
-
1
);
//植物结果次数大于0时,植物重新转为成长状态,种植时间更新到当前时间
//植物结果次数大于0时,植物重新转为成长状态,种植时间更新到当前时间
...
...
src/main/resources/application-dev.yml
View file @
473b78fa
...
@@ -64,4 +64,6 @@ messageFilePath: /home/secretGarden/message/
...
@@ -64,4 +64,6 @@ messageFilePath: /home/secretGarden/message/
reportFilePath
:
/home/secretGarden/report/
reportFilePath
:
/home/secretGarden/report/
#动态词组更新秘钥
#动态词组更新秘钥
appSecret
:
nnPGsrbMriXdrRNISQeb
appSecret
:
nnPGsrbMriXdrRNISQeb
\ No newline at end of file
#动态词组更新链接
updatePhraseUrl
:
http://hw-gz24.heyqiwu.cn:8082/out/phrase
\ No newline at end of file
src/main/resources/application-uat.yml
View file @
473b78fa
...
@@ -64,4 +64,6 @@ messageFilePath: /home/secretGarden/message/
...
@@ -64,4 +64,6 @@ messageFilePath: /home/secretGarden/message/
reportFilePath
:
/home/secretGarden/report/
reportFilePath
:
/home/secretGarden/report/
#动态词组更新秘钥
#动态词组更新秘钥
appSecret
:
nnPGsrbMriXdrRNISQeb
appSecret
:
nnPGsrbMriXdrRNISQeb
\ No newline at end of file
#动态词组更新链接
updatePhraseUrl
:
http://hw-gz25.heyqiwu.cn:8082/out/phrase
\ No newline at end of file
src/main/resources/com/qiwuai/garden/dao/CallNameMapper.xml
0 → 100644
View file @
473b78fa
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.qiwuai.garden.dao.CallNameMapper"
>
<select
id=
"findAll"
resultType=
"com.qiwuai.garden.pojo.CallNamePojo"
>
select
id, name, sub_name, gender
from
call_name
</select>
</mapper>
\ No newline at end of file
src/main/resources/com/qiwuai/garden/dao/ItemMapper.xml
View file @
473b78fa
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<select
id=
"searchAll"
resultType=
"com.qiwuai.garden.pojo.ItemPojo"
>
<select
id=
"searchAll"
resultType=
"com.qiwuai.garden.pojo.ItemPojo"
>
select
select
id, name, description, item_type_id, price, usable, salable, create_time, update_time
id, name, description, item_type_id, price, usable, salable,
attribute_id,
create_time, update_time
from
from
item
item
</select>
</select>
...
...
src/main/resources/speech/gardener.yaml
View file @
473b78fa
...
@@ -3,6 +3,13 @@ aside:
...
@@ -3,6 +3,13 @@ aside:
#进入游戏
#进入游戏
enter_game
:
enter_game
:
-
【旁白@正常】欢迎进入追梦花园。
-
【旁白@正常】欢迎进入追梦花园。
#更改称呼
gardener_call_name_change_fail_null
:
-
【旁白@正常】你还未提供称呼,暂时无法更改。
gardener_call_name_change_fail_not_exist
:
-
【旁白@正常】没有你提供的称呼,暂时无法更改。
gardener_call_name_change_success
:
-
【旁白@正常】好的【1】,欢迎【2】来到秘密花园。现在我来帮【2】熟悉一下这里吧。
#园丁升级
#园丁升级
gardener_level_check
:
gardener_level_check
:
-
【旁白@正常】园丁目前的等级为【1】级。
-
【旁白@正常】园丁目前的等级为【1】级。
...
@@ -16,6 +23,8 @@ aside:
...
@@ -16,6 +23,8 @@ aside:
-
【旁白@正常】已达到最大等级。
-
【旁白@正常】已达到最大等级。
gardener_upgrade_fail_task
:
gardener_upgrade_fail_task
:
-
【旁白@正常】未完成升级任务,【1】。
-
【旁白@正常】未完成升级任务,【1】。
gardener_upgrade_fail_task_open
:
-
【旁白@正常】目前升级任务还未开启。
gardener_upgrade_cancel
:
gardener_upgrade_cancel
:
-
【旁白@正常】已取消园丁升级。
-
【旁白@正常】已取消园丁升级。
#学习技能
#学习技能
...
@@ -70,6 +79,8 @@ aside:
...
@@ -70,6 +79,8 @@ aside:
#查看背包
#查看背包
view_back_pack
:
view_back_pack
:
-
【旁白@正常】目前背包里有物品类共【1】种,拥有【2】,物种丰富,是否要查看特定种类的详情?
-
【旁白@正常】目前背包里有物品类共【1】种,拥有【2】,物种丰富,是否要查看特定种类的详情?
view_back_pack_fail_none
:
-
【旁白@正常】目前背包空空如也。
view_back_pack_item
:
view_back_pack_item
:
-
【旁白@正常】目前拥有的【1】,一共有【2】。
-
【旁白@正常】目前拥有的【1】,一共有【2】。
view_back_pack_item_none
:
view_back_pack_item_none
:
...
...
src/main/resources/speech/help.yaml
View file @
473b78fa
...
@@ -160,7 +160,7 @@ aside:
...
@@ -160,7 +160,7 @@ aside:
visit_strange_rule_check
:
visit_strange_rule_check
:
-
【旁白@正常】你可以通过‘拜访陌生人’指令拜访一名随机问你匹配的陌生人,也可以通过使用‘拜访’加上玩家地址信息拜访一名指定的陌生人。需要注意的是,当跨区拜访时,需要花费【1】【2】才可以拜访。
-
【旁白@正常】你可以通过‘拜访陌生人’指令拜访一名随机问你匹配的陌生人,也可以通过使用‘拜访’加上玩家地址信息拜访一名指定的陌生人。需要注意的是,当跨区拜访时,需要花费【1】【2】才可以拜访。
steal_stranger_rule_check
:
steal_stranger_rule_check
:
-
【旁白@正常】在拜访时,通过下达‘偷取果实’指令进行偷菜,如果没有另外指定一个花圃编号的话就会随机选取一个有成熟果实的花圃偷菜。当然偷菜需要宠物进行战斗,双方宠物栏中的宠物1对1的进行作战,胜利的话就可以成功偷菜,成功偷菜会获得所有该花圃的产出包括各种掉落物品。战斗失败或平局就没办法偷菜了。对同一个陌生人偷菜后需要等待
‘配置冷却时间’
才可以再次对其偷菜。
-
【旁白@正常】在拜访时,通过下达‘偷取果实’指令进行偷菜,如果没有另外指定一个花圃编号的话就会随机选取一个有成熟果实的花圃偷菜。当然偷菜需要宠物进行战斗,双方宠物栏中的宠物1对1的进行作战,胜利的话就可以成功偷菜,成功偷菜会获得所有该花圃的产出包括各种掉落物品。战斗失败或平局就没办法偷菜了。对同一个陌生人偷菜后需要等待
【1】
才可以再次对其偷菜。
steal_report_rule_check
:
steal_report_rule_check
:
-
【旁白@正常】被其他人偷菜后,您会收到一条偷菜简报,通过下达指令‘查看偷菜简报’进行查看,简报会存放总数【1】条,每一条的存放时间为【2】天。查看简报时可以选择查看详细的战斗过程,战斗过程需要根据每一轮战斗单独查看详情。
-
【旁白@正常】被其他人偷菜后,您会收到一条偷菜简报,通过下达指令‘查看偷菜简报’进行查看,简报会存放总数【1】条,每一条的存放时间为【2】天。查看简报时可以选择查看详细的战斗过程,战斗过程需要根据每一轮战斗单独查看详情。
#8017:好友
#8017:好友
...
...
src/main/resources/speech/market.yaml
View file @
473b78fa
...
@@ -46,15 +46,19 @@ aside:
...
@@ -46,15 +46,19 @@ aside:
-
【旁白@正常】已为你取消出售所有物品操作。
-
【旁白@正常】已为你取消出售所有物品操作。
#查看商品
#查看商品
goods_check_type_success
:
goods_check_type_success
:
-
【旁白@正常】【1】
有:【2】,你想购买哪一种
?
-
【旁白@正常】【1】
【2】【3】有:【4】,还想看看别的吗
?
goods_check_item_success
:
goods_check_item_success
:
-
【旁白@正常】【1】,【2】,【3】。
-
【旁白@正常】【1】,【2】,【3】。
goods_check_fail_no_name
:
goods_check_fail_no_name
:
-
【旁白@正常】市场里现在有材料、果实两种大类的产品,你有感兴趣想看的吗?
-
【旁白@正常】市场里现在有材料、果实两种大类的产品,你有感兴趣想看的吗?
你也可以同时告诉我物品的等级或属性,会更精确找到您想要购买的商品。
goods_check_fail_type_no_exist
:
goods_check_fail_type_no_exist
:
-
【旁白@正常】这类商品不存在。
-
【旁白@正常】这类商品不存在。
goods_check_fail_attribute_no_exist
:
-
【旁白@正常】该属性不存在,目前有【1】。
goods_check_fail_level_no_exist
:
-
【旁白@正常】你提供了等级格式错误,无法为你查看。
goods_check_fail_type_no_goods
:
goods_check_fail_type_no_goods
:
-
【旁白@正常】
当前等级没有可以购买的【1】
。
-
【旁白@正常】
市场里没有找到符合要求的商品
。
goods_check_fail_item_no_exist
:
goods_check_fail_item_no_exist
:
-
【旁白@正常】该商品不存在。
-
【旁白@正常】该商品不存在。
...
@@ -65,37 +69,37 @@ aside:
...
@@ -65,37 +69,37 @@ aside:
man
:
man
:
#购买物品
#购买物品
buy_check_success
:
buy_check_success
:
-
【男园丁@正常】确定购买吗
主人
?
-
【男园丁@正常】确定购买吗
【1】
?
buy_check_fail_no_name
:
buy_check_fail_no_name
:
-
【男园丁@正常】
主人,你
想买什么?可以直接告诉我想买东西的名字的。
-
【男园丁@正常】
【1】,【2】
想买什么?可以直接告诉我想买东西的名字的。
buy_check_fail_no_num
:
buy_check_fail_no_num
:
-
【男园丁@正常】一次性买完种下,省的之后还要再来。
-
【男园丁@正常】一次性买完种下,省的之后还要再来。
-
【男园丁@正常】如果钱不够的话,可以先少买一些。
-
【男园丁@正常】如果钱不够的话,可以先少买一些。
-
【男园丁@正常】不着急,
主人
可以仔细想想。
-
【男园丁@正常】不着急,
【1】
可以仔细想想。
-
【男园丁@正常】种子买好了,现在可以去种下了。
-
【男园丁@正常】种子买好了,现在可以去种下了。
-
【男园丁@正常】事不宜迟,现在就去播种吧!
-
【男园丁@正常】事不宜迟,现在就去播种吧!
-
【男园丁@正常】这些种子的品质看起来都很不错,种出来的果实一定很优质。
-
【男园丁@正常】这些种子的品质看起来都很不错,种出来的果实一定很优质。
buy_success
:
buy_success
:
-
【男园丁@正常】这真是个明智的选择。
-
【男园丁@正常】这真是个明智的选择。
-
【男园丁@正常】
主人
还是很具有当商人的潜质的。
-
【男园丁@正常】
【1】
还是很具有当商人的潜质的。
-
【男园丁@正常】我刚好也想买这个东西,
主人
真是和我心有灵犀啊。
-
【男园丁@正常】我刚好也想买这个东西,
【1】
真是和我心有灵犀啊。
buy_fail_money
:
buy_fail_money
:
-
【男园丁@正常】哈哈……我们还是去赚些钱再来吧。
-
【男园丁@正常】哈哈……我们还是去赚些钱再来吧。
-
【男园丁@正常】没钱什么都买不了。
-
【男园丁@正常】没钱什么都买不了。
-
【男园丁@正常】
主人
,我会努力种植物帮你赚钱的!
-
【男园丁@正常】
【1】
,我会努力种植物帮你赚钱的!
buy_fail_level
:
buy_fail_level
:
-
【男园丁@正常】可惜买不了,
主人
的等级不够,那我们努力升级吧。
-
【男园丁@正常】可惜买不了,
【1】
的等级不够,那我们努力升级吧。
buy_fail_item_no_exist
:
buy_fail_item_no_exist
:
-
【男园丁@正常】
主人
,那我们看一下其他的吧。
-
【男园丁@正常】
【1】
,那我们看一下其他的吧。
buy_cancel
:
buy_cancel
:
-
【男园丁@正常】既然如此,我们去别的地方看看吧。
-
【男园丁@正常】既然如此,我们去别的地方看看吧。
-
【男园丁@正常】好,遵照
主人
的意愿。
-
【男园丁@正常】好,遵照
【1】
的意愿。
-
【男园丁@正常】之后还可以再来购买。
-
【男园丁@正常】之后还可以再来购买。
#出售商品
#出售商品
sell_check_item_no_name
:
sell_check_item_no_name
:
-
【男园丁@正常】
主人
你想卖什么?可以直接说出名称,或者全部出售。
-
【男园丁@正常】
【1】
你想卖什么?可以直接说出名称,或者全部出售。
-
【男园丁@正常】说出物品名,可以更准确的购买该物品。
-
【男园丁@正常】说出物品名,可以更准确的购买该物品。
-
【男园丁@正常】不说出准确的名字,我也不知道
主人
想买的是什么。
-
【男园丁@正常】不说出准确的名字,我也不知道
【1】
想买的是什么。
sell_check_fail_no_exist
:
sell_check_fail_no_exist
:
-
【男园丁@正常】主人,是没有这样物品的。
-
【男园丁@正常】主人,是没有这样物品的。
sell_success
:
sell_success
:
...
...
src/main/resources/speech/pet.yaml
View file @
473b78fa
...
@@ -26,18 +26,28 @@ aside:
...
@@ -26,18 +26,28 @@ aside:
-
【旁白@正常】宠物栏和花圃中没有找到【1】。
-
【旁白@正常】宠物栏和花圃中没有找到【1】。
pet_move_nursery_fail_no_exist
:
pet_move_nursery_fail_no_exist
:
-
【旁白@正常】花圃【1】的宠物不是【2】。
-
【旁白@正常】花圃【1】的宠物不是【2】。
pet_move_nursery_fail_no_nursery
:
-
【旁白@正常】你还未提供花圃编号。目前有【1】。
pet_move_nursery_fail_wrong_num
:
pet_move_nursery_fail_wrong_num
:
-
【旁白@正常】花圃编号不对。
-
【旁白@正常】花圃编号不对。
目前有【1】。
pet_move_nursery_fail_wrong_pos
:
pet_move_nursery_fail_wrong_pos
:
-
【旁白@正常】位置不对。
-
【旁白@正常】位置不对。
pet_move_nursery_fail_pos_over
:
pet_move_nursery_fail_pos_over
:
-
【旁白@正常】
目前有【1】个花圃,不存在这样的花圃编号
。
-
【旁白@正常】
不存在这样的花圃编号。目前有【1】
。
pet_move_nursery_fail_none
:
pet_move_nursery_fail_none
:
-
【旁白@正常】花圃【1】没有宠物,无法移动。
-
【旁白@正常】花圃【1】没有宠物,无法移动。
pet_move_nursery_switch_fail_none
:
-
【旁白@正常】花圃【1】没有宠物,无法交换。
pet_move_nursery_switch_success
:
-
【旁白@正常】花圃【1】的【2】与花圃【3】的【4】交换成功。
pet_move_field_success
:
pet_move_field_success
:
-
【旁白@正常】
【1
】成功移动到宠物栏。
-
【旁白@正常】
花圃【1】中的【2
】成功移动到宠物栏。
pet_move_field_fail_pet
:
pet_move_field_fail_pet
:
-
【旁白@正常】目前宠物栏已满,暂时无法移动。
-
【旁白@正常】目前宠物栏已满,暂时无法移动。
pet_move_field_fail_null
:
-
【旁白@正常】你还未提供宠物名称或花圃编号,暂时无法移动。
pet_move_field_fail_not_same
:
-
该花圃没有你说的宠物。
pet_move_field_fail_no_pet
:
pet_move_field_fail_no_pet
:
-
【旁白@正常】花圃中还没有放置宠物。
-
【旁白@正常】花圃中还没有放置宠物。
pet_move_field_fail_no_exist
:
pet_move_field_fail_no_exist
:
...
...
src/main/resources/speech/plant.yaml
View file @
473b78fa
...
@@ -193,6 +193,12 @@ aside:
...
@@ -193,6 +193,12 @@ aside:
#开启花圃
#开启花圃
nursery_reclaim_check
:
nursery_reclaim_check
:
-
【旁白@正常】目前可开启花圃【1】,需要消费【2】【3】,要开启这个花圃吗?
-
【旁白@正常】目前可开启花圃【1】,需要消费【2】【3】,要开启这个花圃吗?
nursery_reclaim_fail_num
:
-
【旁白@正常】花圃已满,暂时无法开启。
nursery_reclaim_success
:
-
【旁白@正常】开启成功,你的花园里又多了一个花圃【1】。
nursery_reclaim_fail_money
:
-
【旁白@正常】【1】不足,暂时无法开启新花圃。
nursery_reclaim_cancel
:
nursery_reclaim_cancel
:
-
【旁白@正常】已为你取消开启新花圃。
-
【旁白@正常】已为你取消开启新花圃。
#查看植物成熟时间
#查看植物成熟时间
...
@@ -231,11 +237,11 @@ man:
...
@@ -231,11 +237,11 @@ man:
plant_cancel
:
plant_cancel
:
-
【男园丁@正常】好,下次再种。
-
【男园丁@正常】好,下次再种。
plant_success
:
plant_success
:
-
【男园丁@正常】真期待以后和
主人
一起看到它成熟的样子……
-
【男园丁@正常】真期待以后和
【1】
一起看到它成熟的样子……
-
【男园丁@正常】真好啊,这样它就能慢慢长大了。
-
【男园丁@正常】真好啊,这样它就能慢慢长大了。
-
【男园丁@正常】过一段时间它就会慢慢成熟了……
-
【男园丁@正常】过一段时间它就会慢慢成熟了……
plant_fail_seed_none
:
plant_fail_seed_none
:
-
【男园丁@正常】
主人
,等下次有了再来种植吧。
-
【男园丁@正常】
【1】
,等下次有了再来种植吧。
plant_fail_seed_not_exist
:
plant_fail_seed_not_exist
:
-
【男园丁@正常】没有的话,只能再去找找了。
-
【男园丁@正常】没有的话,只能再去找找了。
plant_fail_seed
:
plant_fail_seed
:
...
@@ -247,19 +253,19 @@ man:
...
@@ -247,19 +253,19 @@ man:
-
【男园丁@正常】可以换另一块花圃种植。
-
【男园丁@正常】可以换另一块花圃种植。
-
【男园丁@正常】看看别的空闲花圃吧。
-
【男园丁@正常】看看别的空闲花圃吧。
plant_fail_nursery_level
:
plant_fail_nursery_level
:
-
【男园丁@正常】
主人
,看来我们还需要再接再厉,努力升级啊!
-
【男园丁@正常】
【1】
,看来我们还需要再接再厉,努力升级啊!
-
【男园丁@正常】花圃的等级还是太低了……
主人
,我们要一起努力升级啊。
-
【男园丁@正常】花圃的等级还是太低了……
【1】
,我们要一起努力升级啊。
-
【男园丁@正常】要想早日种植这些植物,还是得努力升级啊
主人
。
-
【男园丁@正常】要想早日种植这些植物,还是得努力升级啊
【1】
。
plant_fail_nursery_type
:
plant_fail_nursery_type
:
-
【男园丁@正常】
主人
,换一块花圃种植试试吧。
-
【男园丁@正常】
【1】
,换一块花圃种植试试吧。
-
【男园丁@正常】特定的植物需要在特定的花圃上种植。
-
【男园丁@正常】特定的植物需要在特定的花圃上种植。
-
【男园丁@正常】我们还有别的花圃,再试试吧。
-
【男园丁@正常】我们还有别的花圃,再试试吧。
plant_fail_material
:
plant_fail_material
:
-
【男园丁@正常】既然如此,我们再去找找吧。
-
【男园丁@正常】既然如此,我们再去找找吧。
-
【男园丁@正常】背包里找不到这种材料,需要麻烦
主人
再去找找。
-
【男园丁@正常】背包里找不到这种材料,需要麻烦
【1】
再去找找。
-
【男园丁@正常】材料不足了,找到之后再来种植吧。
-
【男园丁@正常】材料不足了,找到之后再来种植吧。
plant_fail_near_plant
:
plant_fail_near_plant
:
-
【男园丁@正常】这种植物比较特别,要先在其他花圃种植另一种伴生植物才能再种植它呢
主人
。
-
【男园丁@正常】这种植物比较特别,要先在其他花圃种植另一种伴生植物才能再种植它呢
【1】
。
-
【男园丁@正常】它们是相辅相成的关系,缺了其中的一种,另一种就种植不了。
-
【男园丁@正常】它们是相辅相成的关系,缺了其中的一种,另一种就种植不了。
-
【男园丁@正常】还是先去种植伴生植物吧!
-
【男园丁@正常】还是先去种植伴生植物吧!
plant_fail_pet
:
plant_fail_pet
:
...
@@ -267,21 +273,21 @@ man:
...
@@ -267,21 +273,21 @@ man:
-
【男园丁@正常】路漫漫其修远兮……我们先等到对应的小动物来后,再回来种植吧。
-
【男园丁@正常】路漫漫其修远兮……我们先等到对应的小动物来后,再回来种植吧。
-
【男园丁@正常】看来还得要小动物啊!那等下次了。
-
【男园丁@正常】看来还得要小动物啊!那等下次了。
plant_fail_gardener_level
:
plant_fail_gardener_level
:
-
【男园丁@正常】是我太弱了
主人
,真是对不起……
-
【男园丁@正常】是我太弱了
【1】
,真是对不起……
-
【男园丁@正常】我会加油升级的,还请
主人
能够好好帮助我。
-
【男园丁@正常】我会加油升级的,还请
【1】
能够好好帮助我。
-
【男园丁@正常】光凭我一个人的力量是无法升级的,希望
主人
能帮我一起!
-
【男园丁@正常】光凭我一个人的力量是无法升级的,希望
【1】
能帮我一起!
plant_fail_skill
:
plant_fail_skill
:
-
【男园丁@正常】
主人
,你快带我去学习吧!
-
【男园丁@正常】
【1】
,你快带我去学习吧!
-
【男园丁@正常】我想学习这个技能,
主人
你帮帮我吧。
-
【男园丁@正常】我想学习这个技能,
【1】
你帮帮我吧。
-
【男园丁@正常】能让我学习这个技能吗?我想帮助
主人
种植更多的植物。
-
【男园丁@正常】能让我学习这个技能吗?我想帮助
【1】
种植更多的植物。
plant_fail_no_nursery
:
plant_fail_no_nursery
:
-
【男园丁@正常】
主人
,请问你想在哪一块花圃种植呢?
-
【男园丁@正常】
【1】
,请问你想在哪一块花圃种植呢?
plant_fail_no_plant_name
:
plant_fail_no_plant_name
:
-
【男园丁@正常】
主人
,请问你想种植的是什么植物呢?
-
【男园丁@正常】
【1】
,请问你想种植的是什么植物呢?
-
【男园丁@正常】今天又想种些什么呢?
-
【男园丁@正常】今天又想种些什么呢?
-
【男园丁@正常】告诉我你想种植的植物名吧。
-
【男园丁@正常】告诉我你想种植的植物名吧。
plant_fail_nursery_not_exist
:
plant_fail_nursery_not_exist
:
-
【男园丁@正常】
主人
,我们可以换个花圃。
-
【男园丁@正常】
【1】
,我们可以换个花圃。
plant_fail_plant_not_exist
:
plant_fail_plant_not_exist
:
-
【男园丁@正常】可惜了,试试其他植物吧。
-
【男园丁@正常】可惜了,试试其他植物吧。
plant_check_nursery_random
:
plant_check_nursery_random
:
...
@@ -290,11 +296,11 @@ man:
...
@@ -290,11 +296,11 @@ man:
-
【男园丁@正常】这个也不错。
-
【男园丁@正常】这个也不错。
#植物收获
#植物收获
harvest_success
:
harvest_success
:
-
【男园丁@正常】多亏了
主人,我们才能收获到这些果实,你
真是太厉害了!
-
【男园丁@正常】多亏了
【1】,我们才能收获到这些果实,【2】
真是太厉害了!
-
【男园丁@正常】又是大丰收,
主人
功不可没啊!
-
【男园丁@正常】又是大丰收,
【1】
功不可没啊!
-
【男园丁@正常】种植这件事果然是熟能生巧啊,现在我们都能收获这么多了,
主人
也越来越熟练了吧。
-
【男园丁@正常】种植这件事果然是熟能生巧啊,现在我们都能收获这么多了,
【1】
也越来越熟练了吧。
-
【男园丁@正常】
主人你
可真是幸运啊!
-
【男园丁@正常】
【1】【2】
可真是幸运啊!
-
【男园丁@正常】真不错,
主人
,我们下次种植也要再接再厉啊!
-
【男园丁@正常】真不错,
【1】
,我们下次种植也要再接再厉啊!
harvest_fail_mature
:
harvest_fail_mature
:
-
【男园丁@正常】主人,你不如先去别的地方转转?过会儿再来收取。
-
【男园丁@正常】主人,你不如先去别的地方转转?过会儿再来收取。
harvest_fail_mature_nursery
:
harvest_fail_mature_nursery
:
...
@@ -309,6 +315,18 @@ man:
...
@@ -309,6 +315,18 @@ man:
-
【男园丁@正常】主人你又忘了吗?我们的花圃里还没有种植植物,想要收获东西的话赶快种植吧!
-
【男园丁@正常】主人你又忘了吗?我们的花圃里还没有种植植物,想要收获东西的话赶快种植吧!
harvest_fail_usable
:
harvest_fail_usable
:
-
【男园丁@正常】这块花圃……我们还没有开启权限呢。要先开启,才能种植哦主人!
-
【男园丁@正常】这块花圃……我们还没有开启权限呢。要先开启,才能种植哦主人!
#查看花圃数量
nursery_amount_check
:
-
【男园丁@正常】提高等级后就能开启新的花圃,再接再厉吧。
#查看花圃概览信息
check_nursery_fail_no_num
:
-
【男园丁@正常】请问主人想要查看的是哪个花圃?
check_nursery_info_have_plant_no_pet
:
-
【男园丁@正常】再耐心等一等,说不定就有宠物出现了。
check_nursery_info_no_plant_have_pet
:
-
【男园丁@正常】看来花圃现在是空闲状态,正好可以把我们的种子种下去。
check_nursery_info_no_plant_no_pet
:
-
【男园丁@正常】空地是吸引不了宠物的,还是要先种植植物才行。
#查看花圃状态
#查看花圃状态
nursery_status
:
nursery_status
:
-
【男园丁@正常】花园在主人井井有条的打理下,所有花圃的植物都在茁壮成长!
-
【男园丁@正常】花园在主人井井有条的打理下,所有花圃的植物都在茁壮成长!
...
@@ -401,12 +419,15 @@ man:
...
@@ -401,12 +419,15 @@ man:
nursery_reset_fail_nursery_no_exist
:
nursery_reset_fail_nursery_no_exist
:
-
【男园丁@正常】主人,再试试重置其他花圃吧。
-
【男园丁@正常】主人,再试试重置其他花圃吧。
#开启花圃
#开启花圃
nursery_reclaim_check
:
-
【男园丁@正常】搜集【1】的目的就是为了用在这些事情上,不过这还是要看主人的个人意愿。你想要花费【1】开启花圃吗?
nursery_reclaim_success
:
nursery_reclaim_success
:
-
【男园丁@正常】
成功开启花圃,我们的花园建设的又更好了!
-
【男园丁@正常】
我就知道有你在,我们的花园建设的会越来越好。
nursery_reclaim_fail_num
:
nursery_reclaim_fail_num
:
-
【男园丁@正常】暂时不能再开启新的花圃,因为主人现在所拥有的花圃已经是数量最多的!主人真厉害啊!
-
【男园丁@正常】暂时不能再开启新的花圃,因为主人现在所拥有的花圃已经是数量最多的!主人真厉害啊!
-
【男园丁@正常】主人现在所拥有的花圃已经是数量最多的,这些成果在我看来真的很厉害。
nursery_reclaim_fail_money
:
nursery_reclaim_fail_money
:
-
【男园丁@正常】想要开启新花圃,我们的
货币还差一点,主人我们先去赚些货币
再来吧!
-
【男园丁@正常】想要开启新花圃,我们的
【1】还差一点,主人我们先去赚些【1】
再来吧!
#查看植物成熟时间
#查看植物成熟时间
check_plant_mature_time_success
:
check_plant_mature_time_success
:
-
【男园丁@正常】主人,可以去采摘了。
-
【男园丁@正常】主人,可以去采摘了。
...
@@ -506,6 +527,18 @@ woman:
...
@@ -506,6 +527,18 @@ woman:
-
【女园丁@正常】花圃里空空如也,要想收获还要先种植!
-
【女园丁@正常】花圃里空空如也,要想收获还要先种植!
harvest_fail_usable
:
harvest_fail_usable
:
-
【女园丁@正常】要先开启这块花圃才能进行种植,主人赶快去开启吧!
-
【女园丁@正常】要先开启这块花圃才能进行种植,主人赶快去开启吧!
#查看花圃数量
nursery_amount_check
:
-
【女园丁@正常】我会帮助你一起升级,我们早日解锁所有的花圃。
#查看花圃概览信息
check_nursery_fail_no_num
:
-
【女园丁@正常】你想看的是我们花园里的哪一个花圃?
check_nursery_info_have_plant_no_pet
:
-
【女园丁@正常】等待就会出现奇迹,肯定会有宠物来我们花圃居住的!
check_nursery_info_no_plant_have_pet
:
-
【女园丁@正常】那我们就把种子种下去,不要浪费一点一滴的空闲时间啊。
check_nursery_info_no_plant_no_pet
:
-
【女园丁@正常】种了植物才能吸引宠物,依我看还是先种一些植物到空的花圃里去吧。
#查看花圃状态
#查看花圃状态
nursery_status
:
nursery_status
:
-
【女园丁@正常】太阳当空照,花园乐淘淘,我们的花园正在往更好的方向发展呢!
-
【女园丁@正常】太阳当空照,花园乐淘淘,我们的花园正在往更好的方向发展呢!
...
@@ -598,12 +631,16 @@ woman:
...
@@ -598,12 +631,16 @@ woman:
nursery_reset_fail_nursery_no_exist
:
nursery_reset_fail_nursery_no_exist
:
-
【女园丁@正常】主人,没有这样的花圃,重置不了呀。
-
【女园丁@正常】主人,没有这样的花圃,重置不了呀。
#开启花圃
#开启花圃
nursery_reclaim_check
:
-
【女园丁@正常】【1】足够的情况下,可以选择这么做,主人你确认开启新花圃吗?
nursery_reclaim_success
:
nursery_reclaim_success
:
-
【女园丁@正常】
创建新花圃成功,花园变得更繁荣了!果然有主人在,做什么都很厉害
!
-
【女园丁@正常】
花园变得更繁荣了,果然有主人在,做什么事情都会变得游刃有余
!
nursery_reclaim_fail_num
:
nursery_reclaim_fail_num
:
-
【女园丁@正常】我们现在已经拥有最大限度数量的花圃了,暂时无法开启新花圃了,主人就不要再贪心啦!
-
【女园丁@正常】我们现在已经拥有最大限度数量的花圃了,暂时无法开启新花圃了,主人就不要再贪心啦!
-
【女园丁@正常】我们现在已经拥有最大限度数量的花圃了,主人就不要再贪心啦!
nursery_reclaim_fail_money
:
nursery_reclaim_fail_money
:
-
【女园丁@正常】货币不够啊,我们先去赚一点货币再来升级吧。
-
【女园丁@正常】【1】不够啊,我们先去赚一点【1】再来升级吧。
-
【女园丁@正常】看来【1】这个东西缺一枚都不行,我们先去赚一点【1】再来升级吧。
#查看植物成熟时间
#查看植物成熟时间
check_plant_mature_time_success
:
check_plant_mature_time_success
:
-
【女园丁@正常】哇,已经熟啦,那我们赶紧摘了吧。
-
【女园丁@正常】哇,已经熟啦,那我们赶紧摘了吧。
...
...
src/main/resources/speech/social.yaml
View file @
473b78fa
...
@@ -15,6 +15,12 @@ aside:
...
@@ -15,6 +15,12 @@ aside:
-
【旁白@正常】好的,已为你取消访问【1】。
-
【旁白@正常】好的,已为你取消访问【1】。
visit_stranger_random
:
visit_stranger_random
:
-
【旁白@正常】已为你匹配进入【1】的花园。
-
【旁白@正常】已为你匹配进入【1】的花园。
visit_other_address_fail_no_pre
:
-
【旁白@正常】你还没在对方的花园里,请先拜访一个人。
visit_last_address_fail_no_one
:
-
【旁白@正常】没有找到上一家,暂时无法前往。
visit_next_address_fail_no_one
:
-
【旁白@正常】没有找到下一家,暂时无法前往。
#好友申请
#好友申请
add_friend_ask
:
add_friend_ask
:
-
【旁白@正常】已为你向【1】发送好友申请。
-
【旁白@正常】已为你向【1】发送好友申请。
...
@@ -731,7 +737,7 @@ woman:
...
@@ -731,7 +737,7 @@ woman:
-
【女园丁@正常】还有很多其他简报等着主人去看啊!要先去读读看吗?
-
【女园丁@正常】还有很多其他简报等着主人去看啊!要先去读读看吗?
-
【女园丁@正常】看一下其他的简报也很有意思啊,主人去看看吧?
-
【女园丁@正常】看一下其他的简报也很有意思啊,主人去看看吧?
steal_report_check_fail_none
:
steal_report_check_fail_none
:
-
【女园丁@正常】没有来偷我们的花圃,真幸运啊主人!
-
【女园丁@正常】没有
人
来偷我们的花圃,真幸运啊主人!
steal_report_success_check
:
steal_report_success_check
:
-
【女园丁@正常】我们辛辛苦苦种的植物就这么被偷了啊……你还想看战斗详情吗主人?
-
【女园丁@正常】我们辛辛苦苦种的植物就这么被偷了啊……你还想看战斗详情吗主人?
-
【女园丁@正常】对不起,是我战斗能力太弱了……我为主人回放一下战斗详情吧,你要看吗?
-
【女园丁@正常】对不起,是我战斗能力太弱了……我为主人回放一下战斗详情吧,你要看吗?
...
...
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