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
a665650b
Commit
a665650b
authored
Sep 22, 2022
by
周君强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.线上问题修复
parent
1b803042
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
154 additions
and
55 deletions
+154
-55
Constants.java
src/main/java/com/qiwuai/garden/common/Constants.java
+4
-0
TimingAcquisition.java
...main/java/com/qiwuai/garden/common/TimingAcquisition.java
+20
-12
RequestConversionUtil.java
...com/qiwuai/garden/common/utils/RequestConversionUtil.java
+20
-0
CallRequest.java
src/main/java/com/qiwuai/garden/dto/request/CallRequest.java
+8
-0
GardenerService.java
...iwuai/garden/service/gardenerService/GardenerService.java
+3
-1
GardenerServiceImpl.java
...den/service/gardenerService/impl/GardenerServiceImpl.java
+39
-3
MarketServiceImpl.java
.../garden/service/marketService/impl/MarketServiceImpl.java
+7
-1
NurseryServiceImpl.java
...arden/service/nurseryService/impl/NurseryServiceImpl.java
+6
-6
PlantServiceImpl.java
...ai/garden/service/plantService/impl/PlantServiceImpl.java
+9
-6
SocialServiceImpl.java
.../garden/service/socialService/impl/SocialServiceImpl.java
+25
-19
application.yml
src/main/resources/application.yml
+2
-2
market.yaml
src/main/resources/speech/market.yaml
+1
-1
plant.yaml
src/main/resources/speech/plant.yaml
+2
-2
social.yaml
src/main/resources/speech/social.yaml
+8
-2
No files found.
src/main/java/com/qiwuai/garden/common/Constants.java
View file @
a665650b
...
@@ -173,6 +173,10 @@ public class Constants {
...
@@ -173,6 +173,10 @@ public class Constants {
*/
*/
public
static
final
Integer
BUY_GOODS
=
4001
;
public
static
final
Integer
BUY_GOODS
=
4001
;
/**
/**
* 购买物品
*/
public
static
final
Integer
SELL_ITEMS
=
4002
;
/**
* 查看商品
* 查看商品
*/
*/
public
static
final
Integer
CHECK_GOODS
=
4003
;
public
static
final
Integer
CHECK_GOODS
=
4003
;
...
...
src/main/java/com/qiwuai/garden/common/TimingAcquisition.java
View file @
a665650b
...
@@ -360,16 +360,23 @@ public class TimingAcquisition {
...
@@ -360,16 +360,23 @@ public class TimingAcquisition {
* 更新动态词组到bot服务器
* 更新动态词组到bot服务器
*/
*/
public
static
void
updatePhraseToBotServer
()
{
public
static
void
updatePhraseToBotServer
()
{
//更新玩家地址的动态词组
// //更新玩家地址的动态词组
// if (addressMap.size() != 0 ) {
// //所有玩家地址
// List<String> playerList = new ArrayList<>();
// for (String region : addressMap.keySet()) {
// List<String> regionPlayerList = new ArrayList<>(addressMap.get(region).keySet());
// playerList.addAll(regionPlayerList);
// }
// String address = String.join("+", playerList);
// HttpUtil.doPut("项目词组玩家地址", address);
// }
//更新玩家地区的动态词组
if
(
addressMap
.
size
()
!=
0
)
{
if
(
addressMap
.
size
()
!=
0
)
{
//所有玩家地址
//所有玩家地区
List
<
String
>
playerList
=
new
ArrayList
<>();
List
<
String
>
regionList
=
regionIPMap
.
values
().
stream
().
map
(
RegionPojo:
:
getPlace
).
collect
(
Collectors
.
toList
());
for
(
String
region
:
addressMap
.
keySet
())
{
String
regions
=
String
.
join
(
"+"
,
regionList
);
List
<
String
>
regionPlayerList
=
new
ArrayList
<>(
addressMap
.
get
(
region
).
keySet
());
HttpUtil
.
doPut
(
"项目词组玩家地址"
,
regions
);
playerList
.
addAll
(
regionPlayerList
);
}
String
address
=
String
.
join
(
"+"
,
playerList
);
HttpUtil
.
doPut
(
"项目词组玩家地址"
,
address
);
}
}
//更新植物名称的动态词组
//更新植物名称的动态词组
if
(
plantMap
.
size
()
!=
0
)
{
if
(
plantMap
.
size
()
!=
0
)
{
...
@@ -1557,8 +1564,6 @@ public class TimingAcquisition {
...
@@ -1557,8 +1564,6 @@ 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
)
{
...
@@ -1566,7 +1571,10 @@ public class TimingAcquisition {
...
@@ -1566,7 +1571,10 @@ public class TimingAcquisition {
}
}
});
});
int
pos
=
addressList
.
indexOf
(
location
);
int
pos
=
addressList
.
indexOf
(
location
);
if
(
addressList
.
size
()
==
1
)
{
List
<
String
>
addressCopyList
=
new
ArrayList
<>(
addressList
);
//去除玩家本人
addressCopyList
.
removeIf
(
location:
:
contains
);
if
(
addressCopyList
.
size
()
==
0
)
{
return
null
;
return
null
;
}
}
//已经是最后一个
//已经是最后一个
...
...
src/main/java/com/qiwuai/garden/common/utils/RequestConversionUtil.java
View file @
a665650b
...
@@ -356,6 +356,26 @@ public class RequestConversionUtil {
...
@@ -356,6 +356,26 @@ public class RequestConversionUtil {
if
(!
StringUtils
.
isEmpty
(
address
))
{
if
(!
StringUtils
.
isEmpty
(
address
))
{
operationRequest
.
setAddress
(
address
);
operationRequest
.
setAddress
(
address
);
}
}
//-------------存在玩家地区------------
String
addressRegion
=
callRequest
.
get
玩家地区
();
if
(!
StringUtils
.
isEmpty
(
addressRegion
))
{
if
(
"随机"
.
equals
(
addressRegion
))
{
operationRequest
.
setAddress
(
addressRegion
);
}
else
{
//-------------存在地区编号------------
String
addressNum
=
callRequest
.
get
地区编号
();
if
(!
StringUtils
.
isEmpty
(
addressNum
))
{
//找到中文数字对应的阿拉伯数字
Integer
number
=
TypeConvertUtil
.
change2Integer
(
addressNum
);
//中文中不包含中文数字时,提取阿拉伯数字
if
(
number
==
0
)
{
number
=
TypeConvertUtil
.
extractNum
(
addressNum
);
}
String
numStr
=
String
.
format
(
"%04d"
,
number
);
//1转成0001
operationRequest
.
setAddress
(
addressRegion
+
numStr
);
}
}
}
//----------存在植物状态--------------
//----------存在植物状态--------------
String
plantStatus
=
callRequest
.
get
植物状态
();
String
plantStatus
=
callRequest
.
get
植物状态
();
if
(!
StringUtils
.
isEmpty
(
plantStatus
))
{
if
(!
StringUtils
.
isEmpty
(
plantStatus
))
{
...
...
src/main/java/com/qiwuai/garden/dto/request/CallRequest.java
View file @
a665650b
...
@@ -109,6 +109,14 @@ public class CallRequest {
...
@@ -109,6 +109,14 @@ public class CallRequest {
*/
*/
private
String
玩家地址
;
private
String
玩家地址
;
/**
/**
* 玩家地区
*/
private
String
玩家地区
;
/**
* 地区编号
*/
private
String
地区编号
;
/**
* 植物状态
* 植物状态
*/
*/
private
String
植物状态
;
private
String
植物状态
;
...
...
src/main/java/com/qiwuai/garden/service/gardenerService/GardenerService.java
View file @
a665650b
...
@@ -4,13 +4,15 @@ import com.qiwuai.garden.dto.base.CommonResponse;
...
@@ -4,13 +4,15 @@ import com.qiwuai.garden.dto.base.CommonResponse;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.dto.response.PhraseResponse
;
import
com.qiwuai.garden.dto.response.PhraseResponse
;
import
java.text.ParseException
;
public
interface
GardenerService
{
public
interface
GardenerService
{
/**
/**
* 进入游戏。清除该玩家现有缓存
* 进入游戏。清除该玩家现有缓存
* @param
* @param
* @param
* @param
*/
*/
CommonResponse
enterGame
(
OperationRequest
operationReq
);
CommonResponse
enterGame
(
OperationRequest
operationReq
)
throws
ParseException
;
/**
/**
* 创建园丁
* 创建园丁
* @param
* @param
...
...
src/main/java/com/qiwuai/garden/service/gardenerService/impl/GardenerServiceImpl.java
View file @
a665650b
...
@@ -45,7 +45,7 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -45,7 +45,7 @@ public class GardenerServiceImpl implements GardenerService {
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
@Override
@Override
public
CommonResponse
enterGame
(
OperationRequest
operationReq
)
{
public
CommonResponse
enterGame
(
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
();
...
@@ -83,8 +83,44 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -83,8 +83,44 @@ public class GardenerServiceImpl implements GardenerService {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
//玩家间隔登录超过简报过期后,简报提示消息的个数置0
long
subTime
=
DateUtil
.
subTime
(
DateUtil
.
getCurrentTime
(),
gardener
.
getOfflineTime
());
subTime
=
subTime
/(
60
*
60
);
//单位为小时
//帮助简报保留时间
String
helpReportKeepTime
=
TimingAcquisition
.
systemConfigMap
.
get
(
"help_report_keep_time"
).
getValue
();
//留言保留时间
String
messageKeepTime
=
TimingAcquisition
.
systemConfigMap
.
get
(
"message_keep_time"
).
getValue
();
//获取玩家的所有消息提醒
Map
<
String
,
Integer
>
notice
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getNotice
();
if
(
subTime
>
Long
.
parseLong
(
helpReportKeepTime
))
{
//偷菜简报提示个数设置为0
if
(!
StringUtils
.
isEmpty
(
notice
.
get
(
Constants
.
STEAL_REPORT_NOTICE
)))
{
if
(
notice
.
get
(
Constants
.
STEAL_REPORT_NOTICE
)
>
0
)
{
notice
.
put
(
Constants
.
STEAL_REPORT_NOTICE
,
0
);
}
}
//帮助简报提示个数设置为0
if
(!
StringUtils
.
isEmpty
(
notice
.
get
(
Constants
.
HELP_REPORT_NOTICE
)))
{
if
(
notice
.
get
(
Constants
.
HELP_REPORT_NOTICE
)
>
0
)
{
notice
.
put
(
Constants
.
HELP_REPORT_NOTICE
,
0
);
}
}
}
if
(
subTime
>
Long
.
parseLong
(
messageKeepTime
))
{
//好友留言提示个数设置为0
if
(!
StringUtils
.
isEmpty
(
notice
.
get
(
Constants
.
MESSAGE_NOTICE
)))
{
if
(
notice
.
get
(
Constants
.
MESSAGE_NOTICE
)
>
0
)
{
notice
.
put
(
Constants
.
MESSAGE_NOTICE
,
0
);
}
}
}
//清除缓存,本轮对话结束
//清除缓存,本轮对话结束
CacheGlobal
.
concurrentMap
.
remove
(
uid
);
CacheGlobal
.
concurrentMap
.
remove
(
uid
);
//---------------------------持久化该园丁信息----------------------------
Map
<
String
,
GardenerDto
>
gardenerMap
=
new
ConcurrentHashMap
<>();
gardenerMap
.
put
(
uid
,
TimingAcquisition
.
gardenerMap
.
get
(
uid
));
String
gardenerStr
=
JSON
.
toJSONString
(
gardenerMap
);
PersistenceUtil
.
saveDataToFile
(
uid
,
gardenerStr
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"enter_game"
);
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"enter_game"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
...
@@ -219,8 +255,8 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -219,8 +255,8 @@ public class GardenerServiceImpl implements GardenerService {
playerList
.
addAll
(
regionPlayerList
);
playerList
.
addAll
(
regionPlayerList
);
}
}
String
address
=
String
.
join
(
"+"
,
playerList
);
String
address
=
String
.
join
(
"+"
,
playerList
);
HttpUtil
.
doPut
(
"项目词组玩家地址"
,
address
);
//
HttpUtil.doPut("项目词组玩家地址", address);
HttpUtil
.
doPutCrazyGardener
(
"项目词组玩家地址"
,
address
);
//
HttpUtil.doPutCrazyGardener("项目词组玩家地址", address);
}
}
//玩家初始宠物id
//玩家初始宠物id
String
initialPet
=
TimingAcquisition
.
systemConfigMap
.
get
(
"initial_pet"
).
getValue
();
String
initialPet
=
TimingAcquisition
.
systemConfigMap
.
get
(
"initial_pet"
).
getValue
();
...
...
src/main/java/com/qiwuai/garden/service/marketService/impl/MarketServiceImpl.java
View file @
a665650b
...
@@ -357,6 +357,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -357,6 +357,7 @@ public class MarketServiceImpl implements MarketService {
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400103
);
resultResponse
.
set
反馈
ID
(
400103
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"购买物品回复3"
);
resultVarsResponse
.
setVars
(
resultResponse
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
...
@@ -449,14 +450,17 @@ public class MarketServiceImpl implements MarketService {
...
@@ -449,14 +450,17 @@ public class MarketServiceImpl implements MarketService {
OperationRequest
lastReq
=
(
OperationRequest
)
CacheUtil
.
get
(
uid
);
OperationRequest
lastReq
=
(
OperationRequest
)
CacheUtil
.
get
(
uid
);
//存在上一轮对话
//存在上一轮对话
if
(!
StringUtils
.
isEmpty
(
lastReq
))
{
if
(!
StringUtils
.
isEmpty
(
lastReq
))
{
itemId
=(
itemId
==
null
)
?
lastReq
.
getItemId
()
:
itemId
;
//需要出售的物品id
if
(
Constants
.
SELL_ITEMS
.
equals
(
lastReq
.
getOperationLabel
()))
{
itemId
=
(
itemId
==
null
)
?
lastReq
.
getItemId
()
:
itemId
;
//需要出售的物品id
itemTypeId
=
(
itemTypeId
==
null
)
?
lastReq
.
getItemTypeId
()
:
itemTypeId
;
//物品类型
itemTypeId
=
(
itemTypeId
==
null
)
?
lastReq
.
getItemTypeId
()
:
itemTypeId
;
//物品类型
number
=
(
number
==
null
)
?
lastReq
.
getNumber
()
:
number
;
//出售物品的数量
number
=
(
number
==
null
)
?
lastReq
.
getNumber
()
:
number
;
//出售物品的数量
}
}
}
//保存玩家这轮的请求信息,用于下一步的操作
//保存玩家这轮的请求信息,用于下一步的操作
operationReq
.
setItemId
(
itemId
);
operationReq
.
setItemId
(
itemId
);
operationReq
.
setItemTypeId
(
itemTypeId
);
operationReq
.
setItemTypeId
(
itemTypeId
);
operationReq
.
setNumber
(
number
);
operationReq
.
setNumber
(
number
);
operationReq
.
setOperationLabel
(
Constants
.
SELL_ITEMS
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//园丁性别
//园丁性别
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
String
gender
=
TimingAcquisition
.
getGardenerGender
(
uid
);
...
@@ -559,6 +563,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -559,6 +563,7 @@ public class MarketServiceImpl implements MarketService {
operationReq
.
setItemId
(
itemId
);
operationReq
.
setItemId
(
itemId
);
operationReq
.
setItemTypeId
(
itemTypeId
);
operationReq
.
setItemTypeId
(
itemTypeId
);
operationReq
.
setNumber
(
item
.
getItemNum
());
//保存最大数量,提供给下一步操作
operationReq
.
setNumber
(
item
.
getItemNum
());
//保存最大数量,提供给下一步操作
operationReq
.
setOperationLabel
(
Constants
.
SELL_ITEMS
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
...
@@ -576,6 +581,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -576,6 +581,7 @@ public class MarketServiceImpl implements MarketService {
operationReq
.
setItemId
(
itemId
);
operationReq
.
setItemId
(
itemId
);
operationReq
.
setItemTypeId
(
itemTypeId
);
operationReq
.
setItemTypeId
(
itemTypeId
);
operationReq
.
setNumber
(
item
.
getItemNum
());
//保存最大数量,提供给下一步操作
operationReq
.
setNumber
(
item
.
getItemNum
());
//保存最大数量,提供给下一步操作
operationReq
.
setOperationLabel
(
Constants
.
SELL_ITEMS
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"sell_check_success"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"sell_check_success"
);
...
...
src/main/java/com/qiwuai/garden/service/nurseryService/impl/NurseryServiceImpl.java
View file @
a665650b
...
@@ -156,7 +156,7 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -156,7 +156,7 @@ public class NurseryServiceImpl implements NurseryService {
//花圃中植物的信息
//花圃中植物的信息
plant
=
TimingAcquisition
.
plantMap
.
get
(
nurseryInfo
.
getPlantId
());
plant
=
TimingAcquisition
.
plantMap
.
get
(
nurseryInfo
.
getPlantId
());
//当前时间大于开花期的最后时间,即已进入成熟期
//当前时间大于开花期的最后时间,即已进入成熟期
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
0
)
{
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
=
0
)
{
//------------------------植物成熟后吸引宠物过来-----------------------
//------------------------植物成熟后吸引宠物过来-----------------------
RandomDropUtil
.
getPetByPlantMature
(
uid
,
nurseryNum
,
nurseryInfo
);
RandomDropUtil
.
getPetByPlantMature
(
uid
,
nurseryNum
,
nurseryInfo
);
String
petText
=
""
;
String
petText
=
""
;
...
@@ -262,18 +262,18 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -262,18 +262,18 @@ public class NurseryServiceImpl implements NurseryService {
NurseryInfoDto
nurseryInfo
=
entry
.
getValue
();
NurseryInfoDto
nurseryInfo
=
entry
.
getValue
();
String
nowTime
=
DateUtil
.
getCurrentTime
();
String
nowTime
=
DateUtil
.
getCurrentTime
();
//植物生长期判断
//植物生长期判断
if
(
nurseryInfo
.
getStatus
()
!=
Constants
.
PLANT_NO
)
{
if
(
!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
())
)
{
//当前时间大于开花期的最后时间,即已进入成熟期
//当前时间大于开花期的最后时间,即已进入成熟期
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
0
)
{
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
=
0
)
{
matureNumList
.
add
(
entry
.
getKey
());
matureNumList
.
add
(
entry
.
getKey
());
//花圃还没有宠物,则有一定几率吸引宠物到来
//花圃还没有宠物,则有一定几率吸引宠物到来
//------------------------植物成熟后吸引宠物过来-----------------------
//------------------------植物成熟后吸引宠物过来-----------------------
RandomDropUtil
.
getPetByPlantMature
(
uid
,
entry
.
getKey
(),
nurseryInfo
);
RandomDropUtil
.
getPetByPlantMature
(
uid
,
entry
.
getKey
(),
nurseryInfo
);
}
else
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getGrowingTime
())
>
0
)
{
}
else
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getGrowingTime
())
>
=
0
)
{
bloomingNumList
.
add
(
entry
.
getKey
());
bloomingNumList
.
add
(
entry
.
getKey
());
}
else
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getSowingTime
())
>
0
)
{
}
else
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getSowingTime
())
>
=
0
)
{
growingNumList
.
add
(
entry
.
getKey
());
growingNumList
.
add
(
entry
.
getKey
());
}
else
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getSeedingTime
())
>
0
)
{
}
else
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getSeedingTime
())
>
=
0
)
{
sowingNumList
.
add
(
entry
.
getKey
());
sowingNumList
.
add
(
entry
.
getKey
());
}
else
{
}
else
{
seedingNumList
.
add
(
entry
.
getKey
());
seedingNumList
.
add
(
entry
.
getKey
());
...
...
src/main/java/com/qiwuai/garden/service/plantService/impl/PlantServiceImpl.java
View file @
a665650b
...
@@ -863,9 +863,10 @@ public class PlantServiceImpl implements PlantService {
...
@@ -863,9 +863,10 @@ public class PlantServiceImpl implements PlantService {
resultResponse
.
set
任务完成
(
"10014"
);
resultResponse
.
set
任务完成
(
"10014"
);
}
}
}
}
String
subTime
=
DateUtil
.
subTimeToDate
(
nurseryInfo
.
getPlantTime
().
getMatureTime
(),
DateUtil
.
getCurrentTime
());
//获取对应话术
//获取对应话术
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
()
,
subTime
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_success"
);
text
+=
SpeechUtil
.
getPlantSpeech
(
gender
,
"plant_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[播种]完成提醒
text
+=
updateTaskResult
.
getResultText
();
//养成任务事件[播种]完成提醒
...
@@ -1583,7 +1584,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1583,7 +1584,7 @@ public class PlantServiceImpl implements PlantService {
}
}
//触发植物成熟判断
//触发植物成熟判断
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//已经种植了植物
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//已经种植了植物
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
0
)
{
//当前时间大于开花期的最后时间,即进入成熟
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
=
0
)
{
//当前时间大于开花期的最后时间,即进入成熟
//------------------------植物成熟后数据更新-----------------------
//------------------------植物成熟后数据更新-----------------------
RandomDropUtil
.
plantMature
(
uid
,
nurseryNum
,
nurseryInfo
);
RandomDropUtil
.
plantMature
(
uid
,
nurseryNum
,
nurseryInfo
);
nurseryInfo
.
setStatus
(
Constants
.
PLANT_MATURE
);
//花圃中植物状态改为已成熟
nurseryInfo
.
setStatus
(
Constants
.
PLANT_MATURE
);
//花圃中植物状态改为已成熟
...
@@ -1695,7 +1696,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1695,7 +1696,7 @@ public class PlantServiceImpl implements PlantService {
}
}
//触发植物成熟判断
//触发植物成熟判断
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//已经种植了植物
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//已经种植了植物
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
0
)
{
//当前时间大于开花期的最后时间,即进入成熟期
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
=
0
)
{
//当前时间大于开花期的最后时间,即进入成熟期
//------------------------植物成熟后数据更新-----------------------
//------------------------植物成熟后数据更新-----------------------
RandomDropUtil
.
plantMature
(
uid
,
entry
.
getKey
(),
nurseryInfo
);
//花圃中植物成熟,一定概率掉落物品
RandomDropUtil
.
plantMature
(
uid
,
entry
.
getKey
(),
nurseryInfo
);
//花圃中植物成熟,一定概率掉落物品
nurseryInfo
.
setStatus
(
Constants
.
PLANT_MATURE
);
//花圃中植物状态改为已成熟
nurseryInfo
.
setStatus
(
Constants
.
PLANT_MATURE
);
//花圃中植物状态改为已成熟
...
@@ -1857,7 +1858,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -1857,7 +1858,7 @@ public class PlantServiceImpl implements PlantService {
}
}
//触发植物成熟判断
//触发植物成熟判断
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//已经种植了植物
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//已经种植了植物
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
0
)
{
//当前时间大于开花期的最后时间,即进入成熟
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
=
0
)
{
//当前时间大于开花期的最后时间,即进入成熟
//------------------------植物成熟后数据更新-----------------------
//------------------------植物成熟后数据更新-----------------------
RandomDropUtil
.
plantMature
(
uid
,
nurseryNum
,
nurseryInfo
);
RandomDropUtil
.
plantMature
(
uid
,
nurseryNum
,
nurseryInfo
);
nurseryInfo
.
setStatus
(
Constants
.
PLANT_MATURE
);
//花圃中植物状态改为已成熟
nurseryInfo
.
setStatus
(
Constants
.
PLANT_MATURE
);
//花圃中植物状态改为已成熟
...
@@ -2558,7 +2559,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -2558,7 +2559,7 @@ public class PlantServiceImpl implements PlantService {
//2.1 花圃中的植物已经成熟
//2.1 花圃中的植物已经成熟
String
nowTime
=
DateUtil
.
getCurrentTime
();
String
nowTime
=
DateUtil
.
getCurrentTime
();
//当前时间大于开花期的最后时间,即已进入成熟期
//当前时间大于开花期的最后时间,即已进入成熟期
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
0
)
{
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
=
0
)
{
log
.
info
(
uid
+
"的花圃"
+
nurseryNumList
.
get
(
0
)
+
"中的"
+
plantName
+
"已经成熟"
);
log
.
info
(
uid
+
"的花圃"
+
nurseryNumList
.
get
(
0
)
+
"中的"
+
plantName
+
"已经成熟"
);
//------------------------植物成熟后吸引宠物过来-----------------------
//------------------------植物成熟后吸引宠物过来-----------------------
RandomDropUtil
.
getPetByPlantMature
(
uid
,
nurseryNumList
.
get
(
0
),
nurseryInfo
);
RandomDropUtil
.
getPetByPlantMature
(
uid
,
nurseryNumList
.
get
(
0
),
nurseryInfo
);
...
@@ -2683,7 +2684,7 @@ public class PlantServiceImpl implements PlantService {
...
@@ -2683,7 +2684,7 @@ public class PlantServiceImpl implements PlantService {
//2.花圃中的植物已经成熟
//2.花圃中的植物已经成熟
String
nowTime
=
DateUtil
.
getCurrentTime
();
String
nowTime
=
DateUtil
.
getCurrentTime
();
//当前时间大于开花期的最后时间,即已进入成熟期
//当前时间大于开花期的最后时间,即已进入成熟期
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
0
)
{
if
(
nowTime
.
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
=
0
)
{
log
.
info
(
uid
+
"的花圃"
+
nurseryNum
+
"中的"
+
plantName
+
"已经成熟"
);
log
.
info
(
uid
+
"的花圃"
+
nurseryNum
+
"中的"
+
plantName
+
"已经成熟"
);
//------------------------植物成熟后吸引宠物过来-----------------------
//------------------------植物成熟后吸引宠物过来-----------------------
RandomDropUtil
.
getPetByPlantMature
(
uid
,
nurseryNum
,
nurseryInfo
);
RandomDropUtil
.
getPetByPlantMature
(
uid
,
nurseryNum
,
nurseryInfo
);
...
@@ -2979,6 +2980,8 @@ public class PlantServiceImpl implements PlantService {
...
@@ -2979,6 +2980,8 @@ public class PlantServiceImpl implements PlantService {
Map
<
Integer
,
PlantPeriodDto
>
periodTempMap
=
TimingAcquisition
.
periodMap
.
get
(
nurseryInfo
.
getPlantId
());
Map
<
Integer
,
PlantPeriodDto
>
periodTempMap
=
TimingAcquisition
.
periodMap
.
get
(
nurseryInfo
.
getPlantId
());
//更新植物所有生长期的所需时间
//更新植物所有生长期的所需时间
PlantTimeDto
plantTime
=
new
PlantTimeDto
();
PlantTimeDto
plantTime
=
new
PlantTimeDto
();
plantTime
.
setSeedingTime
(
nurseryInfo
.
getPlantTime
().
getSeedingTime
());
plantTime
.
setSowingTime
(
nurseryInfo
.
getPlantTime
().
getSowingTime
());
plantTime
.
setGrowingTime
(
DateUtil
.
addTime
(
nurseryInfo
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_GROWING
).
getEndTime
()));
plantTime
.
setGrowingTime
(
DateUtil
.
addTime
(
nurseryInfo
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_GROWING
).
getEndTime
()));
plantTime
.
setBloomingTime
(
DateUtil
.
addTime
(
nurseryInfo
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_BLOOMING
).
getEndTime
()));
plantTime
.
setBloomingTime
(
DateUtil
.
addTime
(
nurseryInfo
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_BLOOMING
).
getEndTime
()));
plantTime
.
setMatureTime
(
DateUtil
.
addTime
(
nurseryInfo
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_MATURE
).
getEndTime
()));
plantTime
.
setMatureTime
(
DateUtil
.
addTime
(
nurseryInfo
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_MATURE
).
getEndTime
()));
...
...
src/main/java/com/qiwuai/garden/service/socialService/impl/SocialServiceImpl.java
View file @
a665650b
...
@@ -117,15 +117,11 @@ public class SocialServiceImpl implements SocialService {
...
@@ -117,15 +117,11 @@ public class SocialServiceImpl implements SocialService {
//没有找到相邻玩家
//没有找到相邻玩家
if
(
StringUtils
.
isEmpty
(
nearestAddress
))
{
if
(
StringUtils
.
isEmpty
(
nearestAddress
))
{
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"visit_stranger_check_fail_no_exist"
);
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"visit_stranger_check_fail_none"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nearestAddress
);
text
+=
SpeechUtil
.
getSocialSpeech
(
gender
,
"visit_stranger_check_fail_no_exist"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
5001
08
);
resultResponse
.
set
反馈
ID
(
5001
14
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"是否拜访相邻玩家"
);
resultVarsResponse
.
setVars
(
resultResponse
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
...
@@ -1261,7 +1257,7 @@ public class SocialServiceImpl implements SocialService {
...
@@ -1261,7 +1257,7 @@ public class SocialServiceImpl implements SocialService {
}
}
//触发植物成熟判断
//触发植物成熟判断
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//已经种植了植物
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//已经种植了植物
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
0
)
{
//当前时间大于开花期的最后时间,即进入成熟期
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
=
0
)
{
//当前时间大于开花期的最后时间,即进入成熟期
nurseryInfo
.
setStatus
(
Constants
.
PLANT_MATURE
);
//花圃中植物状态改为已成熟
nurseryInfo
.
setStatus
(
Constants
.
PLANT_MATURE
);
//花圃中植物状态改为已成熟
friendAddressMatureList
.
add
(
friend
.
getAddress
());
friendAddressMatureList
.
add
(
friend
.
getAddress
());
break
;
break
;
...
@@ -1853,7 +1849,7 @@ public class SocialServiceImpl implements SocialService {
...
@@ -1853,7 +1849,7 @@ public class SocialServiceImpl implements SocialService {
NurseryInfoDto
nurseryInfo
=
entry
.
getValue
();
NurseryInfoDto
nurseryInfo
=
entry
.
getValue
();
//触发植物成熟判断
//触发植物成熟判断
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantId
())
&&
!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//已经种植了植物
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantId
())
&&
!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//已经种植了植物
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
0
)
{
//当前时间大于开花期的最后时间,即进入成熟期
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
=
0
)
{
//当前时间大于开花期的最后时间,即进入成熟期
RandomDropUtil
.
getPetByPlantMature
(
uidSide
,
entry
.
getKey
(),
nurseryInfo
);
RandomDropUtil
.
getPetByPlantMature
(
uidSide
,
entry
.
getKey
(),
nurseryInfo
);
nurseryInfo
.
setStatus
(
Constants
.
PLANT_MATURE
);
//花圃中植物状态改为已成熟
nurseryInfo
.
setStatus
(
Constants
.
PLANT_MATURE
);
//花圃中植物状态改为已成熟
nurseryMatureList
.
add
(
entry
.
getKey
());
nurseryMatureList
.
add
(
entry
.
getKey
());
...
@@ -1987,7 +1983,7 @@ public class SocialServiceImpl implements SocialService {
...
@@ -1987,7 +1983,7 @@ public class SocialServiceImpl implements SocialService {
//已种植物的配置信息
//已种植物的配置信息
PlantPojo
plantConfig
=
TimingAcquisition
.
plantMap
.
get
(
nurseryInfo
.
getPlantId
());
PlantPojo
plantConfig
=
TimingAcquisition
.
plantMap
.
get
(
nurseryInfo
.
getPlantId
());
//当前时间大于开花期的最后时间,即已进入成熟期
//当前时间大于开花期的最后时间,即已进入成熟期
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
0
)
{
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
>
=
0
)
{
//获取对应话术
//获取对应话术
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"garden_check_mature"
);
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"garden_check_mature"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNum
.
toString
(),
plantConfig
.
getName
(),
feedText
,
answer
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryNum
.
toString
(),
plantConfig
.
getName
(),
feedText
,
answer
);
...
@@ -2463,12 +2459,18 @@ public class SocialServiceImpl implements SocialService {
...
@@ -2463,12 +2459,18 @@ public class SocialServiceImpl implements SocialService {
}
}
}
}
}
}
//对方所在地区
String
place
=
TypeConvertUtil
.
extractChinese
(
address
);
//对方uid
String
uidSide
=
TimingAcquisition
.
addressMap
.
get
(
place
).
get
(
address
).
getUid
();
//1.玩家未提供花圃编号
//1.玩家未提供花圃编号
if
(
StringUtils
.
isEmpty
(
nurseryNum
))
{
if
(
StringUtils
.
isEmpty
(
nurseryNum
))
{
//保存玩家这轮的请求信息,用于下一步操作
//保存玩家这轮的请求信息,用于下一步操作
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
String
nurseryText
=
TimingAcquisition
.
getAllNurseryNum
(
uidSide
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"steal_stranger_cross"
);
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"steal_fail_no_nursery"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
nurseryText
);
text
+=
SpeechUtil
.
getSocialSpeech
(
gender
,
"steal_fail_no_nursery"
);
text
+=
SpeechUtil
.
getSocialSpeech
(
gender
,
"steal_fail_no_nursery"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
...
@@ -2496,10 +2498,6 @@ public class SocialServiceImpl implements SocialService {
...
@@ -2496,10 +2498,6 @@ public class SocialServiceImpl implements SocialService {
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
//对方所在地区
String
place
=
TypeConvertUtil
.
extractChinese
(
address
);
//对方uid
String
uidSide
=
TimingAcquisition
.
addressMap
.
get
(
place
).
get
(
address
).
getUid
();
//对方当前花圃信息
//对方当前花圃信息
NurseryInfoDto
nurseryInfo
=
TimingAcquisition
.
gardenerMap
.
get
(
uidSide
).
getGarden
().
getNurseryInfos
().
get
(
nurseryNum
);
NurseryInfoDto
nurseryInfo
=
TimingAcquisition
.
gardenerMap
.
get
(
uidSide
).
getGarden
().
getNurseryInfos
().
get
(
nurseryNum
);
//3.对方玩家没有该花圃编号
//3.对方玩家没有该花圃编号
...
@@ -2615,7 +2613,7 @@ public class SocialServiceImpl implements SocialService {
...
@@ -2615,7 +2613,7 @@ public class SocialServiceImpl implements SocialService {
return
commonResponse
;
return
commonResponse
;
}
}
//9.对方该花圃的植物还未成熟
//9.对方该花圃的植物还未成熟
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
<
=
0
)
{
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getBloomingTime
())
<
0
)
{
log
.
info
(
uid
+
"偷菜失败,花圃"
+
nurseryNum
+
"的植物还未成熟"
);
log
.
info
(
uid
+
"偷菜失败,花圃"
+
nurseryNum
+
"的植物还未成熟"
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"steal_fail_no_mature"
);
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"steal_fail_no_mature"
);
...
@@ -4668,14 +4666,18 @@ public class SocialServiceImpl implements SocialService {
...
@@ -4668,14 +4666,18 @@ public class SocialServiceImpl implements SocialService {
operationReq
.
setRoundFightMap
(
stealReport
.
getRoundFightMap
());
operationReq
.
setRoundFightMap
(
stealReport
.
getRoundFightMap
());
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
String
result
=
(
Constants
.
DEFEND_SUCCESS
.
equals
(
stealReport
.
getFightResult
()))
?
"对方"
:
"我方"
;
String
result
=
(
Constants
.
DEFEND_SUCCESS
.
equals
(
stealReport
.
getFightResult
()))
?
"对方"
:
"我方"
;
String
text
=
""
;
//对方玩家宠物栏没有宠物,我方不战而胜
if
(
stealReport
.
getPetList
().
size
()
==
0
)
{
text
+=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"fight_detail_check_no_fight"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
stealReport
.
getPetSideList
().
size
()),
petText
.
toString
(),
String
.
valueOf
(
stealReport
.
getPetList
().
size
()),
result
);
}
else
{
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"fight_detail_check"
);
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"fight_detail_check"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
stealReport
.
getPetSideList
().
size
()),
petText
.
toString
(),
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
stealReport
.
getPetSideList
().
size
()),
petText
.
toString
(),
String
.
valueOf
(
stealReport
.
getPetList
().
size
()),
petSideText
.
toString
(),
String
.
valueOf
(
stealReport
.
getRoundFightMap
().
size
()),
result
);
String
.
valueOf
(
stealReport
.
getPetList
().
size
()),
petSideText
.
toString
(),
String
.
valueOf
(
stealReport
.
getRoundFightMap
().
size
()),
result
);
//对方玩家宠物栏没有宠物,我方不战而胜
if
(
stealReport
.
getPetList
().
size
()
!=
0
)
{
text
+=
SpeechUtil
.
getSocialSpeech
(
gender
,
"fight_detail_check"
);
text
+=
SpeechUtil
.
getSocialSpeech
(
gender
,
"fight_detail_check"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
resultResponse
.
set
后台附加返回
(
"获取战斗轮次"
);
resultResponse
.
set
后台附加返回
(
"获取战斗轮次"
);
}
}
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
...
@@ -7400,6 +7402,8 @@ public class SocialServiceImpl implements SocialService {
...
@@ -7400,6 +7402,8 @@ public class SocialServiceImpl implements SocialService {
//更新植物所有生长期的所需时间
//更新植物所有生长期的所需时间
PlantTimeDto
plantTime
=
new
PlantTimeDto
();
PlantTimeDto
plantTime
=
new
PlantTimeDto
();
try
{
try
{
plantTime
.
setSeedingTime
(
nurseryInfoSide
.
getPlantTime
().
getSeedingTime
());
plantTime
.
setSowingTime
(
nurseryInfoSide
.
getPlantTime
().
getSowingTime
());
plantTime
.
setGrowingTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_GROWING
).
getEndTime
()));
plantTime
.
setGrowingTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_GROWING
).
getEndTime
()));
plantTime
.
setBloomingTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_BLOOMING
).
getEndTime
()));
plantTime
.
setBloomingTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_BLOOMING
).
getEndTime
()));
plantTime
.
setMatureTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_MATURE
).
getEndTime
()));
plantTime
.
setMatureTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_MATURE
).
getEndTime
()));
...
@@ -7571,6 +7575,8 @@ public class SocialServiceImpl implements SocialService {
...
@@ -7571,6 +7575,8 @@ public class SocialServiceImpl implements SocialService {
//更新植物所有生长期的所需时间
//更新植物所有生长期的所需时间
PlantTimeDto
plantTime
=
new
PlantTimeDto
();
PlantTimeDto
plantTime
=
new
PlantTimeDto
();
try
{
try
{
plantTime
.
setSeedingTime
(
nurseryInfoSide
.
getPlantTime
().
getSeedingTime
());
plantTime
.
setSowingTime
(
nurseryInfoSide
.
getPlantTime
().
getSowingTime
());
plantTime
.
setGrowingTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_GROWING
).
getEndTime
()));
plantTime
.
setGrowingTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_GROWING
).
getEndTime
()));
plantTime
.
setBloomingTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_BLOOMING
).
getEndTime
()));
plantTime
.
setBloomingTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_BLOOMING
).
getEndTime
()));
plantTime
.
setMatureTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_MATURE
).
getEndTime
()));
plantTime
.
setMatureTime
(
DateUtil
.
addTime
(
nurseryInfoSide
.
getSeedingTime
(),
(
int
)
periodTempMap
.
get
(
Constants
.
PLANT_MATURE
).
getEndTime
()));
...
...
src/main/resources/application.yml
View file @
a665650b
spring
:
spring
:
profiles
:
profiles
:
active
:
dev
active
:
uat
\ No newline at end of file
\ No newline at end of file
src/main/resources/speech/market.yaml
View file @
a665650b
...
@@ -52,7 +52,7 @@ aside:
...
@@ -52,7 +52,7 @@ aside:
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_level_over
:
goods_check_fail_level_over
:
...
...
src/main/resources/speech/plant.yaml
View file @
a665650b
...
@@ -6,7 +6,7 @@ aside:
...
@@ -6,7 +6,7 @@ aside:
plant_cancel
:
plant_cancel
:
-
【旁白@正常】已为你取消在【1】号{花圃称呼}种植【2】。
-
【旁白@正常】已为你取消在【1】号{花圃称呼}种植【2】。
plant_success
:
plant_success
:
-
【旁白@正常】我已经按照你的吩咐,在【1】号{花圃称呼}种上了【2】植物。
-
【旁白@正常】我已经按照你的吩咐,在【1】号{花圃称呼}种上了【2】植物。
【3】后可以成熟,记得来收取哦。
plant_success_fail_no_pre
:
plant_success_fail_no_pre
:
-
【旁白@正常】你还未检查种植条件,请先确定你想种植的植物是否能在指定{花圃称呼}中种植。
-
【旁白@正常】你还未检查种植条件,请先确定你想种植的植物是否能在指定{花圃称呼}中种植。
plant_fail_no_nursery
:
plant_fail_no_nursery
:
...
@@ -122,7 +122,7 @@ aside:
...
@@ -122,7 +122,7 @@ aside:
nursery_all_fail_no_plant
:
nursery_all_fail_no_plant
:
-
【旁白@正常】所有{花圃称呼}还未种植。
-
【旁白@正常】所有{花圃称呼}还未种植。
nursery_all_check
:
nursery_all_check
:
-
【旁白@正常】【1】。
-
【旁白@正常】【1】。
可以去收取果实了。
nursery_all_seeding
:
nursery_all_seeding
:
-
中的【1】刚刚播种了,
-
中的【1】刚刚播种了,
nursery_all_sowing
:
nursery_all_sowing
:
...
...
src/main/resources/speech/social.yaml
View file @
a665650b
...
@@ -5,6 +5,8 @@ aside:
...
@@ -5,6 +5,8 @@ aside:
-
【旁白@正常】你正在拜访【1】。
-
【旁白@正常】你正在拜访【1】。
visit_stranger_check_fail_no_exist
:
visit_stranger_check_fail_no_exist
:
-
【旁白@正常】不存在该玩家。已为你找到最近的玩家【1】,是否前往?
-
【旁白@正常】不存在该玩家。已为你找到最近的玩家【1】,是否前往?
visit_stranger_check_fail_none
:
-
【旁白@正常】不存在该玩家。目前暂无邻居可拜访。
visit_stranger_check_cross
:
visit_stranger_check_cross
:
-
【旁白@正常】前往【1】区域需要花费【2】【3】,是否前往?
-
【旁白@正常】前往【1】区域需要花费【2】【3】,是否前往?
visit_stranger_check_cross_fail
:
visit_stranger_check_cross_fail
:
...
@@ -82,6 +84,8 @@ aside:
...
@@ -82,6 +84,8 @@ aside:
-
【旁白@正常】在【1】号{花圃称呼}没有收取到东西,需要查看战斗详情吗?
-
【旁白@正常】在【1】号{花圃称呼}没有收取到东西,需要查看战斗详情吗?
steal_stranger_cross
:
steal_stranger_cross
:
-
【旁白@正常】已进入【1】的花园。
-
【旁白@正常】已进入【1】的花园。
steal_fail_no_nursery
:
-
【旁白@正常】你还未提供花圃编号,暂时无法攻打。目前对方有【1】。
steal_fail_not_exist
:
steal_fail_not_exist
:
-
【旁白@正常】【1】这里没有这个{花圃称呼}。
-
【旁白@正常】【1】这里没有这个{花圃称呼}。
steal_fail_unusable
:
steal_fail_unusable
:
...
@@ -241,6 +245,8 @@ aside:
...
@@ -241,6 +245,8 @@ aside:
-
【旁白@正常】【1】
-
【旁白@正常】【1】
fight_detail_check
:
fight_detail_check
:
-
【旁白@正常】本次战斗我方上阵宠物【1】只,【2】对方上阵宠物【3】只,【4】一共进行了【5】轮次,【6】获得了胜利。
-
【旁白@正常】本次战斗我方上阵宠物【1】只,【2】对方上阵宠物【3】只,【4】一共进行了【5】轮次,【6】获得了胜利。
fight_detail_check_no_fight
:
-
【旁白@正常】本次战斗我方上阵宠物【1】只,【2】对方上阵宠物【3】只,不战而胜,【4】获得了胜利。
fight_detail_check_fail_no_pre
:
fight_detail_check_fail_no_pre
:
-
【旁白@正常】暂时无法查看战斗详情,请先查看防守简报。
-
【旁白@正常】暂时无法查看战斗详情,请先查看防守简报。
fight_detail_play_fail_none
:
fight_detail_play_fail_none
:
...
@@ -433,7 +439,7 @@ man:
...
@@ -433,7 +439,7 @@ man:
garden_check_fail_no_exist
:
garden_check_fail_no_exist
:
-
【男园丁@正常】【1】,我们确实没有这个{花圃称呼}。
-
【男园丁@正常】【1】,我们确实没有这个{花圃称呼}。
garden_check_fail_none
:
garden_check_fail_none
:
-
【男园丁@正常】还不知道【1】想看谁的{花圃称呼}呢。
-
【男园丁@正常】还不知道【1】想看谁的{花圃称呼}呢。
想查看自己的{花圃称呼}的话,请先对我说“我要回家”。
#偷菜
#偷菜
steal_success
:
steal_success
:
-
【男园丁@正常】我们的宠物越来越强了,竟然连这样的战斗都能打赢,还是【1】【2】驯养的好!
-
【男园丁@正常】我们的宠物越来越强了,竟然连这样的战斗都能打赢,还是【1】【2】驯养的好!
...
@@ -654,7 +660,7 @@ woman:
...
@@ -654,7 +660,7 @@ woman:
garden_check_fail_no_exist
:
garden_check_fail_no_exist
:
-
【女园丁@正常】【1】,是没有这个{花圃称呼}呀。
-
【女园丁@正常】【1】,是没有这个{花圃称呼}呀。
garden_check_fail_none
:
garden_check_fail_none
:
-
【女园丁@正常】【1】,【2】想看谁的{花圃称呼}呢。
-
【女园丁@正常】【1】,【2】想看谁的{花圃称呼}呢。
想查看自己的{花圃称呼}的话,请先对我说“我要回家”。
#偷菜
#偷菜
steal_success
:
steal_success
:
-
【女园丁@正常】这些宠物们也太厉害了,回去一定要好好犒劳他们啊【1】!
-
【女园丁@正常】这些宠物们也太厉害了,回去一定要好好犒劳他们啊【1】!
...
...
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