Commit 62ae40e0 by 周君强

1.数据同步到关卡;

2.建议系统优化
parent 9855819a
......@@ -99,6 +99,11 @@
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.6.5</version>
</dependency>
</dependencies>
<properties>
......
......@@ -161,6 +161,10 @@ public class Constants {
*/
public static final Integer GARDENER_UPGRADE = 2001;
/**
* 查看背包物品
*/
public static final Integer CHECK_BAG = 2002;
/**
* 查看技能
*/
public static final Integer SKILL_CHECK = 2010;
......@@ -225,13 +229,17 @@ public class Constants {
*/
public static final Integer CHECK_STEAL_REPORT = 5014;
/**
* 消息推送
* 查看提示
*/
public static final Integer CHECK_NOTICE = 5018;
/**
* 消息推送
*/
public static final Integer ADVISE = 9001;
/**
* 套圈
*/
public static final Integer PITCH_PET = 11001;
/**
......@@ -559,9 +567,4 @@ public class Constants {
*/
public static final Integer PAGE_NUM = 3;
/**
* 数据存放地址
*/
public static final String userFilePath = "/home/qwyf14/dataBackup/";
}
......@@ -2,10 +2,7 @@ package com.qiwuai.garden.common;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.qiwuai.garden.common.utils.HttpUtil;
import com.qiwuai.garden.common.utils.PersistenceUtil;
import com.qiwuai.garden.common.utils.RankingUtil;
import com.qiwuai.garden.common.utils.TypeConvertUtil;
import com.qiwuai.garden.common.utils.*;
import com.qiwuai.garden.dao.*;
import com.qiwuai.garden.dto.*;
import com.qiwuai.garden.pojo.*;
......@@ -18,6 +15,7 @@ import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -55,10 +53,11 @@ public class InitSysServlet implements InitializingBean {
private ItemTypeMapper itemTypeMapper;
private GoodsMapper goodsMapper;
private QuantityRangeMapper quantityRangeMapper;
private RegionMapper regionMapper;
// private RegionMapper regionMapper;
private RarityMapper rarityMapper;
private TaskTypeMapper taskTypeMapper;
private CallNameMapper callNameMapper;
private CopyPetMapper copyPetMapper;
@Autowired
public void setNurseryMapper(NurseryMapper nurseryMapper) {
......@@ -161,10 +160,10 @@ public class InitSysServlet implements InitializingBean {
this.quantityRangeMapper = quantityRangeMapper;
}
@Autowired
public void setRegionMapper(RegionMapper regionMapper) {
this.regionMapper = regionMapper;
}
// @Autowired
// public void setRegionMapper(RegionMapper regionMapper) {
// this.regionMapper = regionMapper;
// }
@Autowired
public void setRarityMapper(RarityMapper rarityMapper) {
......@@ -181,6 +180,11 @@ public class InitSysServlet implements InitializingBean {
this.callNameMapper = callNameMapper;
}
@Autowired
public void setCopyPetMapper(CopyPetMapper copyPetMapper) {
this.copyPetMapper = copyPetMapper;
}
/**
* 保存配置信息到缓存
*/
......@@ -433,14 +437,29 @@ public class InitSysServlet implements InitializingBean {
// log.info("缓存中数量范围配置信息" + TimingAcquisition.quantityRangeMap);
log.info("数量范围配置信息缓存完成");
//----------------------缓存地区与服务器对应信息--------------------------
// //----------------------缓存地区与服务器对应信息--------------------------
// Map<String, RegionPojo> regionIPMap = new ConcurrentHashMap<>();
// List<RegionPojo> regionList = regionMapper.findAll();
// for (RegionPojo region : regionList) {
// regionIPMap.put(region.getPlace(), region);
// }
// TimingAcquisition.regionIPMap.putAll(regionIPMap);
// log.info("地区与服务器对应信息缓存完成");
Map<String, RegionPojo> regionIPMap = new ConcurrentHashMap<>();
List<RegionPojo> regionList = regionMapper.findAll();
for (RegionPojo region : regionList) {
regionIPMap.put(region.getPlace(), region);
String fileName = "region.json";
String s = PersistenceUtil.getConfigFromFile(configFilePath, fileName);
Map<String, List<RegionIPDto>> IPRegionsMap = JSON.parseObject(s, new TypeReference<Map<String, List<RegionIPDto>>>(){});
for (Map.Entry<String, List<RegionIPDto>> entry : IPRegionsMap.entrySet()) {
List<RegionIPDto> regionIPList = entry.getValue();
for (RegionIPDto regionIP : regionIPList) {
RegionPojo regionPojo = new RegionPojo();
regionPojo.setId(regionIP.getId());
regionPojo.setPlace(regionIP.getPlace());
regionPojo.setServerIP(regionIP.getServerIP());
regionIPMap.put(regionIP.getPlace(), regionPojo);
}
}
TimingAcquisition.regionIPMap.putAll(regionIPMap);
// log.info("缓存中地区与服务器对应信息" + TimingAcquisition.regionIPMap);
log.info("地区与服务器对应信息缓存完成");
//----------------------缓存任务类型对应信息--------------------------
......@@ -473,6 +492,15 @@ public class InitSysServlet implements InitializingBean {
// log.info("缓存中新手引导玩家称呼对应信息" + TimingAcquisition.callNameGuideMap);
log.info("新手引导玩家称呼对应信息缓存完成");
//----------------------缓存副本信息--------------------------
Map<Integer, CopyPetPojo> copyPetPojoMap = new ConcurrentHashMap<>();
List<CopyPetPojo> copyPetPojoList = copyPetMapper.findAll();
for (CopyPetPojo copyPet : copyPetPojoList) {
copyPetPojoMap.put(copyPet.getId(), copyPet);
}
TimingAcquisition.copyPetPojoMap.putAll(copyPetPojoMap);
log.info("副本信息缓存完成");
//----------------------缓存玩家地址对应的地区信息----------------------------
Map<String, Map<String, RegionDto>> addressMap = new ConcurrentHashMap<>();
Map<String, RegionPojo> regionPojoMap = TimingAcquisition.regionIPMap;
......@@ -527,9 +555,6 @@ public class InitSysServlet implements InitializingBean {
List<PlayerTimesDto> friendshipRankingList = RankingUtil.friendshipRankingListSort();
TimingAcquisition.friendshipRankingList.addAll(friendshipRankingList);
//获取所有地区
String fileName = "region.json";
String s = PersistenceUtil.getConfigFromFile(configFilePath, fileName);
Map<String, List<RegionIPDto>> IPRegionsMap = JSON.parseObject(s, new TypeReference<Map<String, List<RegionIPDto>>>(){});
for (Map.Entry<String, List<RegionIPDto>> entry : IPRegionsMap.entrySet()) {
List<RegionIPDto> regionIPList = entry.getValue();
for (RegionIPDto regionIP : regionIPList) {
......@@ -548,6 +573,28 @@ public class InitSysServlet implements InitializingBean {
}
}
//----------------------缓存排行榜信息----------------------------
String copyPetName = "copyPet.json";
Map<Integer, CopyPetDto> copyPetMap = new HashMap<>();
CopyPetDto copyPet = new CopyPetDto();
String copyPetStr = PersistenceUtil.getConfigFromFile(configFilePath, copyPetName);
if (StringUtils.isEmpty(copyPetStr)) {
Map<Integer, CopyPetPojo> copyPetInfoMap = TimingAcquisition.copyPetPojoMap;
for (Map.Entry<Integer, CopyPetPojo> entry : copyPetInfoMap.entrySet()) {
CopyPetPojo copyPetPojo = entry.getValue();
List<Integer> copyPetList = AdviseUtil.updateCopyPet(copyPetPojo, 1);
copyPet.setNum(1);
copyPet.setCopyPetList(copyPetList);
copyPet.setTime(DateUtil.getCurrentTime());
copyPetMap.put(entry.getKey(), copyPet);
}
//保存到json文件中
String copyPetMapStr = JSON.toJSONString(copyPetMap);
PersistenceUtil.saveToFile(configFilePath + "copyPet.json", copyPetMapStr);
} else {
copyPetMap = JSON.parseObject(copyPetStr, new TypeReference<Map<Integer, CopyPetDto>>(){});
}
TimingAcquisition.copyPetMap.putAll(copyPetMap);
//----------------------更新动态词组到bot服务器------------------------
// log.info("开始更新所有动态词组");
......
......@@ -90,6 +90,10 @@ public class TimingAcquisition {
* 敏感词
*/
public volatile static List<String> sensitiveWordList = new ArrayList<>();
/**
* 副本宠物
*/
public volatile static Map<Integer, CopyPetDto> copyPetMap = new ConcurrentHashMap();
/**
......@@ -204,6 +208,10 @@ public class TimingAcquisition {
* 新手引导玩家称呼配置信息
*/
public volatile static Map<Integer, CallNameGuidePojo> callNameGuideMap = new ConcurrentHashMap<>();
/**
* 新手引导玩家称呼配置信息
*/
public volatile static Map<Integer, CopyPetPojo> copyPetPojoMap = new ConcurrentHashMap<>();
/**
......@@ -242,6 +250,10 @@ public class TimingAcquisition {
* 排行榜模块话术
*/
public volatile static Map<String, Map<String, List<String>>> rankingSpeechMap = new ConcurrentHashMap<>();
/**
* 留言模块话术
*/
public volatile static Map<String, Map<String, List<String>>> messageSpeechMap = new ConcurrentHashMap<>();
/**
......@@ -280,6 +292,7 @@ public class TimingAcquisition {
Map<String, Map<String, List<String>>> helpSpeech = new HashMap<>();
Map<String, Map<String, List<String>>> adviseSpeech = new HashMap<>();
Map<String, Map<String, List<String>>> rankingSpeech = new HashMap<>();
Map<String, Map<String, List<String>>> messageSpeech = new HashMap<>();
try {
plantSpeech = YamlUtil.loadSpeechToMap(speechFilePath, "plant.yaml");
gardenerSpeech = YamlUtil.loadSpeechToMap(speechFilePath, "gardener.yaml");
......@@ -290,6 +303,7 @@ public class TimingAcquisition {
helpSpeech = YamlUtil.loadSpeechToMap(speechFilePath, "help.yaml");
adviseSpeech = YamlUtil.loadSpeechToMap(speechFilePath, "advise.yaml");
rankingSpeech = YamlUtil.loadSpeechToMap(speechFilePath, "ranking.yaml");
messageSpeech = YamlUtil.loadSpeechToMap(speechFilePath, "message.yaml");
} catch (Exception e) {
e.printStackTrace();
}
......@@ -303,6 +317,7 @@ public class TimingAcquisition {
helpSpeechMap.putAll(helpSpeech);
adviseSpeechMap.putAll(adviseSpeech);
rankingSpeechMap.putAll(rankingSpeech);
messageSpeechMap.putAll(messageSpeech);
log.info("---------加载话术到缓存的操作完成---------");
}
......@@ -775,7 +790,6 @@ public class TimingAcquisition {
*/
public static Integer getItemIdByName(String itemName) {
Iterator<Map.Entry<Integer, ItemPojo>> iterator = itemConfigMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<Integer, ItemPojo> entry = iterator.next();
ItemPojo item = entry.getValue();
......@@ -1039,6 +1053,32 @@ public class TimingAcquisition {
}
/**
* 获取副本id
*/
public static Integer getCopyId(String copyName) {
for (Map.Entry<Integer, CopyPetPojo> entry : copyPetPojoMap.entrySet()) {
if (entry.getValue().getCopyName().equals(copyName)) {
return entry.getKey();
}
}
return null;
}
/**
* 获取所有副本名称
*/
public static String getCopyNames() {
StringBuilder result = new StringBuilder();
for (Map.Entry<Integer, CopyPetPojo> entry : copyPetPojoMap.entrySet()) {
result.append(entry.getValue().getCopyName()).append("、");
}
if (result.length() > 0) {
result.deleteCharAt(result.length() - 1);
}
return result.toString();
}
/**
* 通过园丁名称找到玩家地址
* @param name
* @return String
......@@ -1801,7 +1841,14 @@ public class TimingAcquisition {
//找到对应的称呼id
List<CallNamePojo> callNamePojoList = callNameMap.values().stream().filter(callNamePojo -> gender.equals(callNamePojo.getGender())).collect(Collectors.toList());
List<String> callNameList = callNamePojoList.stream().map(CallNamePojo::getName).collect(Collectors.toList());
return String.join("、", callNameList);
StringBuilder text = new StringBuilder();
for (String name : callNameList) {
text.append("🅰").append(name).append("🅱").append("、");
}
if (text.length() != 0) {
text.deleteCharAt(text.length() - 1);
}
return text.toString();
}
/**
......
......@@ -20,7 +20,7 @@ public class CacheUtil {
MyCache myCache = CacheGlobal.concurrentMap.get(key);
myCache.setHitCount(myCache.getHitCount() + 1);
myCache.setLastTime(System.currentTimeMillis());
myCache.setExpireTime(System.currentTimeMillis());
myCache.setExpireTime(expire);
myCache.setValue(value);
}
MyCache myCache = new MyCache();
......
package com.qiwuai.garden.common.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@Configuration
public class RedisConfig extends CachingConfigurerSupport {
@Bean
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(redisConnectionFactory);
Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
ObjectMapper om = new ObjectMapper();
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance ,
ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
jackson2JsonRedisSerializer.setObjectMapper(om);
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
// key采用String的序列化方式
redisTemplate.setKeySerializer(stringRedisSerializer);
// hash的key也采用String的序列化方式
redisTemplate.setHashKeySerializer(stringRedisSerializer);
// value序列化方式采用jackson
redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
// hash的value序列化方式采用jackson
redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
@Bean
public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory redisConnectionFactory){
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(redisConnectionFactory);
return stringRedisTemplate;
}
}
......@@ -5,10 +5,9 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.qiwuai.garden.common.Constants;
import com.qiwuai.garden.common.TimingAcquisition;
import com.qiwuai.garden.common.utils.PersistenceUtil;
import com.qiwuai.garden.common.utils.RankingUtil;
import com.qiwuai.garden.common.utils.TypeConvertUtil;
import com.qiwuai.garden.common.utils.*;
import com.qiwuai.garden.dto.*;
import com.qiwuai.garden.pojo.CopyPetPojo;
import com.qiwuai.garden.pojo.ItemPojo;
import com.qiwuai.garden.pojo.PetPojo;
import lombok.extern.slf4j.Slf4j;
......@@ -21,6 +20,8 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors;
......@@ -146,6 +147,34 @@ public class ScheduleTask {
log.info("----------------排行榜更新完成----------------");
}
@Scheduled(cron = "0 0 3 * * 1")
// @Scheduled(cron = "2 * * * * *")
public void updateCopyPet() {
log.info("----------------开始刷新每周副本的宠物----------------");
Map<Integer, CopyPetDto> copyPetMap = new HashMap<>();
CopyPetDto copyPet = new CopyPetDto();
Map<Integer, CopyPetPojo> copyPetInfoMap = TimingAcquisition.copyPetPojoMap;
for (Map.Entry<Integer, CopyPetPojo> entry : copyPetInfoMap.entrySet()) {
CopyPetPojo copyPetPojo = entry.getValue();
int num = TimingAcquisition.copyPetMap.get(entry.getKey()).getNum() + 1;
List<Integer> copyPetList = AdviseUtil.updateCopyPet(copyPetPojo, num);
String[] copyPets = copyPetPojo.getCopyPets().split("\\|");
if (num > copyPets.length) {
num = 1;
}
copyPet.setNum(num);
copyPet.setCopyPetList(copyPetList);
copyPet.setTime(DateUtil.getCurrentTime());
copyPetMap.put(entry.getKey(), copyPet);
}
//更新缓存
TimingAcquisition.copyPetMap.putAll(copyPetMap);
//保存到json文件中
String copyPetMapStr = JSON.toJSONString(copyPetMap);
PersistenceUtil.saveConfigToFile("copyPet.json", copyPetMapStr);
log.info("----------------每周副本的宠物刷新完成----------------");
}
/**
* 喂养宠物栏中的宠物
* @param uid
......
......@@ -5,6 +5,7 @@ import com.qiwuai.garden.common.TimingAcquisition;
import com.qiwuai.garden.common.cache.CacheUtil;
import com.qiwuai.garden.dto.FriendDto;
import com.qiwuai.garden.dto.GardenerDto;
import com.qiwuai.garden.dto.NurseryInfoDto;
import com.qiwuai.garden.dto.base.CommonResponse;
import com.qiwuai.garden.dto.base.ResultVarsResponse;
import com.qiwuai.garden.dto.request.OperationRequest;
......@@ -13,6 +14,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -58,6 +60,19 @@ public class DataTrimUtil {
gardener.setStealTimes(0);
//重置“今日已偷取的陌生人”
gardener.setStrangerMap(null);
//今日问候次数重置为0
Map<String, Integer> helloSignMap = gardener.getHelloSignMap();
if (!StringUtils.isEmpty(helloSignMap)) {
for (Map.Entry<String, Integer> entry : helloSignMap.entrySet()) {
entry.setValue(0);
}
}
//花圃记录的上一次收益比例重置
Map<Integer, NurseryInfoDto> nurseryInfoMap = gardener.getGarden().getNurseryInfos();
for (Map.Entry<Integer, NurseryInfoDto> entry : nurseryInfoMap.entrySet()) {
NurseryInfoDto nurseryInfo = entry.getValue();
nurseryInfo.setLastEarnRate(null);
}
//更新玩家在线状态
statusUpdate(uid);
}
......@@ -124,6 +139,7 @@ public class DataTrimUtil {
Integer moneyNum = TimingAcquisition.gardenerMap.get(uid).getBackPack().getItemBags()
.get(Constants.ITEM_TYPE_MONEY).getItems(moneyId).getItemNum();
data.getVars().set玩家金币数量(moneyNum);
data.getVars().set当前园丁等级(TimingAcquisition.gardenerMap.get(uid).getGardenerInfo().getLevel());
//------------是否有宠物----------
int petCount = TimingAcquisition.getPetNum(uid);
if (petCount > 0) {
......@@ -151,6 +167,7 @@ public class DataTrimUtil {
", 消息提醒:" + data.getVars().get消息提醒() +
", 任务完成:" + data.getVars().get任务完成() +
", 玩家金币数量:" + data.getVars().get玩家金币数量() +
", 当前园丁等级:" + data.getVars().get当前园丁等级() +
", 是否有宠物:" + data.getVars().get是否有宠物() +
", 是否有植物:" + data.getVars().get是否有植物() +
", 是否开启日常任务:" + data.getVars().get是否开启日常任务() +
......
......@@ -135,6 +135,38 @@ public class PersistenceUtil {
}
}
}
/**
* 保存各配置信息到json文件
* @param filePath
* @param data
* @return void
*/
public static void saveToFile(String filePath, String data) {
BufferedWriter writer = null;
File file = new File(filePath);
if (!file.exists()) {
try {
file.createNewFile();
} catch (Exception e) {
e.printStackTrace();
}
}
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, false), "UTF-8"));
writer.write(data);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (writer != null) {
writer.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* 从json文件中读取各配置文件的信息
* @param fileName
......@@ -143,6 +175,10 @@ public class PersistenceUtil {
public static String getConfigFromFile(String configFilePath, String fileName) {
BufferedReader reader = null;
String lastStr = "";
File file = new File(configFilePath + fileName);
if (!file.exists()) {
return lastStr;
}
try {
FileInputStream fileInputStream = new FileInputStream(configFilePath + fileName);
InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");
......
......@@ -325,7 +325,7 @@ public class RankingUtil {
//没有左右子节点,即最后一个叶子节点
if (leftIndex > maxIndex) {
return;
} else if (rightIndex > maxIndex) {
} else if (rightIndex > maxIndex) { //仅存在左节点
resultIndex = minResult(playerTimesList, leftIndex, parentIndex);
} else { //左右节点都存在
resultIndex = minResult(playerTimesList, leftIndex, rightIndex);
......
package com.qiwuai.garden.common.utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.concurrent.TimeUnit;
@Component
public class RedisUtil {
@Value("${expireTime}")
private String expireTime;
@Autowired
private RedisTemplate<String, Object> redisTemplate;
public void setStr(String key, String value) {
//存入redis缓存中,设置过期时间
redisTemplate.opsForValue().set(key, value, Long.parseLong(expireTime), TimeUnit.MILLISECONDS);
}
public String getStr(String key) {
//存redis缓存中根据key取出value
return (String) redisTemplate.opsForValue().get(key);
}
public void setHash(String key, String hk, String hv) {
//存入redis缓存中
redisTemplate.opsForHash().put(key, hk, hv);
//设置过期时间
redisTemplate.opsForHash().getOperations().expire(key, Long.parseLong(expireTime), TimeUnit.MILLISECONDS);
}
public String getHash(String key, String hk) {
//存入redis缓存中
return (String) redisTemplate.opsForHash().get(key, hk);
}
public void delHash(String key, String hk) {
redisTemplate.opsForHash().delete(key, hk);
}
//判断key是否存在
public boolean keyIsExists(String key) {
return Boolean.TRUE.equals(redisTemplate.hasKey(key));
}
//key续期
public void renewalStr(String key, long times, TimeUnit timeUnit) {
if (!StringUtils.isEmpty(getStr(key))) {
//设置过期时间
redisTemplate.opsForValue().getOperations().expire(key, times, timeUnit);
}
}
//key续期
public void renewalHash(String key, String hk, long times, TimeUnit timeUnit) {
if (!StringUtils.isEmpty(getHash(key, hk))) {
//设置过期时间
redisTemplate.opsForHash().getOperations().expire(key, times, timeUnit);
}
}
}
......@@ -26,7 +26,8 @@ public class RequestConversionUtil {
public static OperationRequest request2Operation(CommonRequest commonRequest) {
OperationRequest operationRequest = new OperationRequest();
CallRequest callRequest = commonRequest.getVars();
operationRequest.setUid(commonRequest.getUid());
String uid = commonRequest.getUid();
operationRequest.setUid(uid);
//---------------------存在GB_园丁姓名-----------------------
String gardenerName = callRequest.getGB_园丁姓名();
if (!StringUtils.isEmpty(gardenerName)) {
......@@ -190,7 +191,7 @@ public class RequestConversionUtil {
if (number != Constants.REQ_NON) {
operationRequest.setRank(number);
} else {
Integer callNameId = TimingAcquisition.getCallNameId(commonRequest.getUid(), callName);
Integer callNameId = TimingAcquisition.getCallNameId(uid, callName);
operationRequest.setCallNameId(callNameId);
}
} else {
......@@ -396,9 +397,9 @@ public class RequestConversionUtil {
operationRequest.setEarnRate(rate);
}
//----------存在留言内容----------
String message = callRequest.get留言内容();
if (!StringUtils.isEmpty(message)) {
operationRequest.setMessage(message);
String messageChange = callRequest.get留言内容();
if (!StringUtils.isEmpty(messageChange)) {
operationRequest.setMessageChange(messageChange);
}
//----------存在留言序号-----------
String messageNum = callRequest.get留言序号();
......@@ -533,6 +534,27 @@ public class RequestConversionUtil {
}
operationRequest.setRankNumber(number);
}
//--------存在下注数额-----------
String pay = callRequest.get下注数额();
if (!StringUtils.isEmpty(pay)) {
//找到中文数字对应的阿拉伯数字
Integer number = TypeConvertUtil.change2Integer(pay);
//中文中不包含中文数字时,提取阿拉伯数字
if (number == 0) {
number = TypeConvertUtil.extractNum(pay);
}
operationRequest.setPay(number);
}
//--------存在留言意图-----------
String intention = callRequest.get留言意图();
if (!StringUtils.isEmpty(intention)) {
operationRequest.setIntention(Integer.parseInt(intention));
}
//-------------------存在副本名称---------------
String copyName = callRequest.get副本名称();
if (!StringUtils.isEmpty(copyName)) {
operationRequest.setCopyName(copyName);
}
return operationRequest;
}
}
......@@ -132,6 +132,20 @@ public class SpeechUtil {
}
/**
* 从留言模块话术获取话术
* @param someone
* @param feedText
* @return String
*/
public static String getMessageSpeech(String someone, Integer feedText) {
String result = "";
List<String> speech = TimingAcquisition.messageSpeechMap.get(someone).get(feedText);
Integer i = RandomDropUtil.getRandomNum(0, speech.size());
result = speech.get(i);
return result;
}
/**
* 替换话术中的一个数字
* @param one
* @return String
......
package com.qiwuai.garden.controller;
import com.qiwuai.garden.common.Constants;
import com.qiwuai.garden.common.ProxyFactory;
import com.qiwuai.garden.common.TimingAcquisition;
import com.qiwuai.garden.common.cache.CacheUtil;
import com.qiwuai.garden.common.utils.DataTrimUtil;
import com.qiwuai.garden.common.utils.RequestConversionUtil;
import com.qiwuai.garden.dto.GardenerDto;
......@@ -43,6 +45,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
import java.util.Arrays;
import java.util.List;
@RestController
@RequestMapping("/secretGarden")
......@@ -153,7 +157,6 @@ public class CommonController {
}
OperationRequest operationReq = RequestConversionUtil.request2Operation(commonRequest);
String operateName = commonRequest.getVars().get操作名();
log.info(uid + "开始执行操作:【" + operateName + "】, 请求参数:" + operationReq);
//操作名为null
if (StringUtils.isEmpty(operateName)) {
log.info(uid + "未提供操作名,无法操作");
......@@ -167,9 +170,30 @@ public class CommonController {
result.setData(resultVarsResponse);
return result;
}
log.info(uid + "开始执行操作:【" + operateName + "】, 请求参数:" + operationReq);
//套圈游戏时,需要限制操作
//当前玩家上一轮的请求信息
// List<String> operateNameList = Arrays.asList("总览查询指令", "宠物删除指令", "确认宠物删除指令", "取消宠物删除指令");
// OperationRequest lastReq = (OperationRequest) CacheUtil.get(uid + "#pitchPet#");
// if (!StringUtils.isEmpty(lastReq)) {
// if (Constants.PITCH_PET.equals(lastReq.getOperationLabel())) {
// if (!operateNameList.contains(operateName)) {
// String petName = TimingAcquisition.petConfigMap.get(lastReq.getPetId()).getName();
// ResultVarsResponse resultVarsResponse = new ResultVarsResponse();
// ResultResponse resultResponse = new ResultResponse();
// log.info(uid + "执行操作:" + operateName + ",不是套圈过程运行的操作");
// result.setCode(1);
// result.setMsg("成功");
// resultResponse.set反馈ID(100006);
// resultResponse.set反馈文本("【旁白@正常】您想要放弃获取" + petName + "吗?");
// resultVarsResponse.setVars(resultResponse);
// result.setData(resultVarsResponse);
// return result;
// }
// }
// }
//登录玩家,修改在线状态
DataTrimUtil.AdjustStatus(commonRequest.getUid(), offlineTime);
switch (operateName) {
case "进入游戏":
result = gardenerService.enterGame(operationReq);
......@@ -330,6 +354,12 @@ public class CommonController {
case "分类检索":
result = backPackService.viewBackPackItem(operationReq);
break;
case "确认查看":
result = backPackService.viewSure(operationReq);
break;
case "取消查看":
result = backPackService.viewCancel(operationReq);
break;
case "货币检索":
result = backPackService.viewMoney(operationReq);
break;
......@@ -396,6 +426,27 @@ public class CommonController {
case "升级宠物":
result = petService.updatePet(operationReq);
break;
case "宠物比试":
result = petService.petMatch(operationReq);
break;
case "玩家选定宠物":
result = petService.petChoose(operationReq);
break;
case "宠物比试结果":
result = petService.petMatchResult(operationReq);
break;
case "挑战副本":
result = petService.brushCopy(operationReq);
break;
case "挑战副本成功":
result = petService.brushCopySuccess(operationReq);
break;
case "开始套圈游戏":
result = petService.startRingToss(operationReq);
break;
case "重试套圈游戏":
result = petService.retryRingToss(operationReq);
break;
case "购买指令":
result = marketService.buyCheck(operationReq);
break;
......@@ -556,6 +607,9 @@ public class CommonController {
case "开始留言":
result = socialService.leaveMessageCheck(operationReq);
break;
case "留言指令":
result = socialService.leaveMessageCover(operationReq);
break;
case "确定该留言":
result = socialService.leaveMessage(operationReq);
break;
......
package com.qiwuai.garden.dao;
import com.qiwuai.garden.pojo.CopyPetPojo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface CopyPetMapper {
List<CopyPetPojo> findAll();
}
package com.qiwuai.garden.dto;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class CopyPetDto {
/**
* 序号
*/
private int num;
/**
* 当前副本宠物
*/
private List<Integer> copyPetList = new ArrayList<>();
/**
* 刷新时间
*/
private String time;
}
package com.qiwuai.garden.dto;
import lombok.Data;
@Data
public class CopyTimeDto {
/**
* 该副本通过时间
*/
private String passTime;
/**
* 该副本玩的次数
*/
private int count = 0;
/**
* 该副本的通过次数
*/
private int success = 0;
}
package com.qiwuai.garden.dto;
import com.qiwuai.garden.common.TimingAcquisition;
import com.qiwuai.garden.pojo.CopyPetPojo;
import lombok.Data;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Data
public class GardenerDto implements Cloneable{
......@@ -136,6 +140,14 @@ public class GardenerDto implements Cloneable{
* 修改时间
*/
private String updateTime;
/**
* 玩家是否有给玩家留言过问候。Map<已留言的玩家地址, 标识>
*/
private Map<String, Integer> helloSignMap = new HashMap<>();
/**
* 副本通过时间
*/
private Map<Integer, CopyTimeDto> copyTimeMap = new HashMap<>();
/**
* 深拷贝宠物栏
......@@ -150,4 +162,15 @@ public class GardenerDto implements Cloneable{
throw new AssertionError();
}
}
/**
* 初始化副本通过时间
*/
public void setCopyTimeMap() {
Map<Integer, CopyPetPojo> copyPetInfoMap = TimingAcquisition.copyPetPojoMap;
for (Map.Entry<Integer, CopyPetPojo> entry : copyPetInfoMap.entrySet()) {
CopyTimeDto copyTimeDto = new CopyTimeDto();
this.copyTimeMap.put(entry.getKey(), copyTimeDto);
}
}
}
package com.qiwuai.garden.dto;
import lombok.Data;
@Data
public class ItemNumDto {
/**
* 伙伴物品id
*/
private Integer id;
/**
* 伙伴物品个数
*/
private Integer num;
/**
* 伙伴物品使用次数。-1:次数已用完,0:不限次数,大于0:次数
*/
private int times;
}
......@@ -13,6 +13,10 @@ public class MessageTimeDto {
*/
private String content;
/**
* 留言类型
*/
private Integer type;
/**
* 未读-0,已读-1
*/
private Integer read;
......
......@@ -68,6 +68,10 @@ public class NurseryInfoDto {
*/
private Integer earnRate;
/**
* 记录收益比例更新后,上一次的数据
*/
private Integer lastEarnRate;
/**
* 乐观锁,用于保证该花圃只有一个人操作,操作完必释放: 0-空闲, 1-忙碌
*/
private Integer lock = 0;
......
package com.qiwuai.garden.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
@Data
public class PartnerItemDto implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 数量上限
*/
private int max;
/**
* 背包已有物品
*/
private Map<Integer, ItemNumDto> itemInfoMap = new HashMap<>();
}
package com.qiwuai.garden.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
@Data
public class PlayerSeriesDto implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 关卡等级
*/
private int level = 1;
/**
* 当前等级通关总次数
*/
private int clearanceNum = 0;
/**
* 总货币
*/
private int money;
/**
* 系列总声望值
*/
private ReputationDto totalReputation;
/**
* Map<物品类型, 物品信息>
*/
private Map<Integer, PartnerItemDto> partnerItemMap = new HashMap<>();
}
package com.qiwuai.garden.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class ReputationDto implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 玩家uid
*/
private String uid;
/**
* 声望值
*/
private int reputation = 0;
}
......@@ -42,6 +42,10 @@ public class ResultResponse {
*/
private Integer 玩家金币数量;
/**
* 当前园丁等级,bot话题模块需要该变量
*/
private Integer 当前园丁等级;
/**
* 玩家称呼,bot话题模块需要该变量
*/
@JsonProperty("GB_玩家称呼")
......@@ -81,6 +85,61 @@ public class ResultResponse {
* 建议指令,bot的建议需要该变量
*/
private String 建议指令;
/**
* 宠物1
*/
@JsonProperty("GB_宠物1")
private String GB_宠物1;
/**
* 宠物2
*/
@JsonProperty("GB_宠物2")
private String GB_宠物2;
/**
* 输赢结果
*/
@JsonProperty("GB_输赢结果")
private String GB_输赢结果;
/**
* 副本宠物1
*/
private String 副本宠物1;
/**
* 副本宠物2
*/
private String 副本宠物2;
/**
* 宠物1生命值
*/
private Integer 宠物1生命值;
/**
* 宠物2生命值
*/
private Integer 宠物2生命值;
/**
* 总人数
*/
private Integer 总人数;
/**
* 总金额
*/
private Integer 总金额;
/**
* 人数1
*/
private Integer 人数1;
/**
* 金额1
*/
private Integer 金额1;
/**
* 人数2
*/
private Integer 人数2;
/**
* 金额2
*/
private Integer 金额2;
/***************************用于清空bot端保留的变量***********************************/
/**
......@@ -187,4 +246,9 @@ public class ResultResponse {
* 保存附加返回
*/
private String 保存附加返回;
/**
* GB_周本时间
*/
@JsonProperty("GB_周本时间")
private String GB_周本时间;
}
......@@ -202,4 +202,21 @@ public class CallRequest {
* 名次
*/
private String 名次;
/**
* 下注数额
*/
private String 下注数额;
/**
* 输赢结果
*/
@JsonProperty(value = "GB_输赢结果")
private String GB_输赢结果;
/**
* 留言意图
*/
private String 留言意图;
/**
* 副本名称
*/
private String 副本名称;
}
......@@ -228,4 +228,48 @@ public class OperationRequest {
* 待出售物品
*/
private List<ItemDto> itemList;
/**
* 下注数额
*/
private int pay;
/**
* 宠物1
*/
private Integer pet1;
/**
* 宠物2
*/
private Integer pet2;
/**
* 输赢结果
*/
private int petResult;
/**
* 留言意图
*/
private int intention;
/**
* 留言玩家地址
*/
private String messageAddress;
/**
* 留言类型
*/
private Integer messageType;
/**
* 留言类型
*/
private String messageChange;
/**
* 风国宠物1
*/
private Integer copyPet1;
/**
* 风国宠物2
*/
private Integer copyPet2;
/**
* 副本名称
*/
private String copyName;
}
package com.qiwuai.garden.dto.request;
import lombok.Data;
@Data
public class PlayerRequest {
/**
* uid
*/
private String uid;
}
package com.qiwuai.garden.dto.response;
import lombok.Data;
@Data
public class CallResponse {
private static final long serialVersionUID = 1L;
/**
* 返回状态码
*/
private Integer code;
/**
* 返回信息
*/
private String message;
/**
* 返回内容
*/
private String data;
}
package com.qiwuai.garden.pojo;
import lombok.Data;
@Data
public class CopyPetPojo {
/**
* id唯一标识
*/
private int id;
/**
* 副本名称
*/
private String copyName;
/**
* 副本宠物组
*/
private String copyPets;
}
......@@ -13,6 +13,10 @@ public class RarityPojo {
*/
private String description;
/**
* 套圈命中的概率
*/
private double pitchPro;
/**
* 创建时间
*/
private String createTime;
......
......@@ -16,12 +16,12 @@ public class RegionPojo {
* 地区所在服务器ip
*/
private String serverIP;
/**
* 创建时间
*/
private String createTime;
/**
* 修改时间
*/
private String updateTime;
// /**
// * 创建时间
// */
// private String createTime;
// /**
// * 修改时间
// */
// private String updateTime;
}
......@@ -1566,7 +1566,7 @@ public class AdviseServiceImpl implements AdviseService {
OperationRequest req = new OperationRequest();
req.setUid(uid);
req.setItemId(lackMaterialList.get(0).getItemId());
CommonResponse response = adviseByMoney(req);
CommonResponse response = adviseByItem(req);
//获取对应话术
text = SpeechUtil.mergeSpeech(text, response.getData().getVars().get反馈文本());
commonResponse.setCode(1);
......@@ -2283,9 +2283,22 @@ public class AdviseServiceImpl implements AdviseService {
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
Integer canPlantId = null;
//物品名称
String itemName = TimingAcquisition.itemConfigMap.get(itemId).getName();
//物品为关键物品类型,为bot发放物品
if (TimingAcquisition.itemConfigMap.get(itemId).getItemTypeId() == Constants.ITEM_TYPE_OTHER) {
//获取对应话术
String text = SpeechUtil.getAdviseSpeech(Constants.SPEECH_ASIDE, "item_advise_key_item");
text = SpeechUtil.speechReplaceNum(text, itemName);
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(900412);
resultResponse.set反馈文本(text);
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
Integer canPlantId = null;
//货币配置信息
Integer moneyId = Integer.parseInt(TimingAcquisition.systemConfigMap.get("money").getValue());
//询问物品为货币
......@@ -2661,6 +2674,8 @@ public class AdviseServiceImpl implements AdviseService {
List<Integer> freeNurseryNumList = AdviseUtil.findFreeNurseryNums(uid);
//有空闲花圃
if (freeNurseryNumList.size() != 0) {
text = SpeechUtil.speechReplaceNum(text, TimingAcquisition.petConfigMap.get(canPetId).getName(),
itemName);
//-------------建议:移动宠物,再种植-------------
//玩家目前有的可在空闲花圃种植的植物
int[] freeNurseryNum = {1};
......
......@@ -17,6 +17,18 @@ public interface BackPackService {
*/
CommonResponse viewBackPackItem(OperationRequest operationReq);
/**
* 分类检索。根据物品种类查看背包中物品详情
* @param operationReq
* @return CommonResponse
*/
CommonResponse viewSure(OperationRequest operationReq);
/**
* 确认查看。根据物品种类查看背包中物品详情
* @param operationReq
* @return CommonResponse
*/
CommonResponse viewCancel(OperationRequest operationReq);
/**
* 查看货币
* @param operationReq
* @return CommonResponse
......
......@@ -17,6 +17,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.*;
......@@ -837,11 +840,13 @@ public class HelpServiceImpl implements HelpService {
List<String> petList = new ArrayList<>();
for (Map.Entry<Integer, PetPojo> entry : TimingAcquisition.petConfigMap.entrySet()) {
PetPojo pet = entry.getValue();
String[] favoritePlantIds = pet.getFavoritePlantId().split("\\|");
//String[]转Integer[]
List<Integer> favoritePlantIdList = Stream.of(favoritePlantIds).map(Integer::valueOf).collect(Collectors.toList());
if (favoritePlantIdList.contains(plantId)) {
petList.add(pet.getName());
if (!StringUtils.isEmpty(pet.getFavoritePlantId())) {
String[] favoritePlantIds = pet.getFavoritePlantId().split("\\|");
//String[]转Integer[]
List<Integer> favoritePlantIdList = Stream.of(favoritePlantIds).map(Integer::valueOf).collect(Collectors.toList());
if (favoritePlantIdList.contains(plantId)) {
petList.add(pet.getName());
}
}
}
String plantName = TimingAcquisition.plantMap.get(plantId).getName();
......
......@@ -141,7 +141,8 @@ public class MarketServiceImpl implements MarketService {
ItemPojo moneyConfig = TimingAcquisition.itemConfigMap.get(moneyId);
//园丁等级
Integer level = TimingAcquisition.gardenerMap.get(uid).getGardenerInfo().getLevel();
//最高等级
String levelMax = TimingAcquisition.systemConfigMap.get("gardener_level_max").getValue();
String goodsName = itemConfig.getName();
BigDecimal itemPrice = new BigDecimal(0); //商品价格
//通过物品id找商品时,可能存在多个商品的情况
......@@ -149,6 +150,19 @@ public class MarketServiceImpl implements MarketService {
for (Map.Entry<Integer, GoodsPojo> entry : goodsConfigMap.entrySet()) {
GoodsPojo goods = entry.getValue();
if (goods.getItemId().equals(itemId)) {
if (goods.getLevel() > Integer.parseInt(levelMax)) {
//获取对应话术
String text = SpeechUtil.getMarketSpeech(Constants.SPEECH_ASIDE, "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.setMsg("成功");
resultResponse.set反馈ID(400109);
resultResponse.set反馈文本(text);
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
//园丁等级不足以购买该物品
if (level < goods.getLevel()) {
log.info(uid + "等级为" + level + ",购买" + goodsName + "所需等级" + goods.getLevel() + ",不能购买");
......@@ -560,6 +574,21 @@ public class MarketServiceImpl implements MarketService {
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
//该物品不能出售
if (itemConfig.getSalable() == 0) {
log.info(uid + "的" + itemConfig.getName() + "不能出售");
//获取对应话术
String text = SpeechUtil.getMarketSpeech(Constants.SPEECH_ASIDE, "sell_check_fail_salable");
text = SpeechUtil.speechReplaceNum(text, itemConfig.getName());
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(400217);
resultResponse.set反馈文本(text);
resultResponse.set后台附加返回("出售物品回复2");
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
//玩家还没有提供数量
if (StringUtils.isEmpty(number)) {
log.info(uid + "玩家没提供出售的物品数量");
......@@ -807,6 +836,18 @@ public class MarketServiceImpl implements MarketService {
return commonResponse;
}
log.info(uid + "开始查询出售所有物品的收益,物品种类id:" + itemTypeId);
if (itemTypeId == Constants.ITEM_TYPE_OTHER) {
log.info(uid + "的关键物品不能出售");
//获取对应话术
String text = SpeechUtil.getMarketSpeech(Constants.SPEECH_ASIDE, "sell_all_check_fail_salable");
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈文本(text);
resultResponse.set反馈ID(400218);
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
//园丁性别
String gender = TimingAcquisition.getGardenerGender(uid);
//物品配置信息
......
......@@ -118,4 +118,46 @@ public interface PetService {
* @return CommonResponse
*/
CommonResponse updatePet(OperationRequest operationReq);
/**
* 宠物比试,返回给bot的每日任务显示
* @param operationReq
* @return CommonResponse
*/
CommonResponse petMatch(OperationRequest operationReq);
/**
* 玩家选定宠物,返回给bot的每日任务显示
* @param operationReq
* @return CommonResponse
*/
CommonResponse petChoose(OperationRequest operationReq);
/**
* 宠物比试结果,返回给bot的每日任务显示
* @param operationReq
* @return CommonResponse
*/
CommonResponse petMatchResult(OperationRequest operationReq);
/**
* 挑战副本
* @param operationReq
* @return CommonResponse
*/
CommonResponse brushCopy(OperationRequest operationReq);
/**
* 挑战副本成功
* @param operationReq
* @return CommonResponse
*/
CommonResponse brushCopySuccess(OperationRequest operationReq);
/**
* 开始套圈游戏
* @param operationReq
* @return CommonResponse
*/
CommonResponse startRingToss(OperationRequest operationReq);
/**
* 重试套圈游戏
* @param operationReq
* @return CommonResponse
*/
CommonResponse retryRingToss(OperationRequest operationReq);
}
......@@ -241,6 +241,12 @@ public interface SocialService {
*/
CommonResponse leaveMessageCheck(OperationRequest operationReq);
/**
* 留言指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse leaveMessageCover(OperationRequest operationReq) throws ParseException;
/**
* 确定该留言
* @param operationReq
* @return CommonResponse
......
......@@ -10,7 +10,7 @@ spring:
name: secret-garden
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/secret_garden?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
url: jdbc:mysql://localhost:3306/secret_garden_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username: root
password: root
type: com.alibaba.druid.pool.DruidDataSource
......@@ -27,6 +27,16 @@ spring:
inetutils:
#设置主机ip超时时间,默认1秒
timeout-seconds: 10
#redis配置
redis:
host: localhost
port: 6379
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 5000
mybatis:
type-aliases-package: com.qiwuai.garden.pojo
......
......@@ -12,7 +12,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/secret_garden?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username: root
password: R91jKARPj23dtqZ4wfc2F
password: dgKNTmt2iLHNjEQajkDEZkq8
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 5
......@@ -27,6 +27,16 @@ spring:
inetutils:
#设置主机ip超时时间,默认1秒
timeout-seconds: 10
#redis配置
redis:
host: localhost
port: 6379
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 5000
mybatis:
type-aliases-package: com.qiwuai.garden.pojo
......
......@@ -27,6 +27,16 @@ spring:
inetutils:
#设置主机ip超时时间,默认1秒
timeout-seconds: 10
#redis配置
redis:
host: localhost
port: 6379
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 5000
mybatis:
type-aliases-package: com.qiwuai.garden.pojo
......
<?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.CopyPetMapper">
<select id="findAll" resultType="com.qiwuai.garden.pojo.CopyPetPojo">
select * from copy_pet
</select>
</mapper>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<select id="findAll" resultType="com.qiwuai.garden.pojo.RarityPojo">
select
id, description, create_time, update_time
id, description, pitch_pro, create_time, update_time
from
rarity
</select>
......
......@@ -195,6 +195,8 @@ aside:
- 【旁白@正常】还有空闲{花圃称呼},【1】可在【2】号{花圃称呼},要种植吗?
item_advise_fail_no_pet_drop_item:
- 【旁白@正常】目前还没有宠物可以掉落【1】。
item_advise_key_item:
- 【旁白@正常】【1】是花仙升级的剧情道具,必须完成对应的剧情才可以获得噢。
#9005:指定花圃建议
nursery_advise_no_nursery_name:
- 【旁白@正常】你还没有告诉我花圃类型,暂时不能提供建议。
......
......@@ -95,13 +95,15 @@ aside:
view_back_pack_fail_none:
- 【旁白@正常】目前背包空空如也。
view_back_pack_item:
- 【旁白@正常】目前拥有的【1】,一共有【2】。
- 【旁白@正常】目前拥有的【1】,一共有【2】种,现有【3】。
view_back_pack_item_none:
- 【旁白@正常】目前背包还没有【1】。
view_back_pack_item_fail_no_type:
- 【旁白@正常】你还未提供物品种类,目前有【1】。
view_back_pack_item_fail_not_exist:
- 【旁白@正常】物品种类不存在,目前有【1】。
view_back_pack_item_more:
- 【旁白@正常】还有其他物品是否要继续播报。
#查看货币
view_money:
- 【旁白@正常】目前拥有的【1】数量为【2】。
......@@ -114,6 +116,8 @@ aside:
- 【旁白@正常】【1】【2】,目前背包里还没有。【3】可以掉落该物品。
search_item_info_none_to_plant_or_pet:
- 【旁白@正常】【1】【2】,目前背包里还没有。可以通过种植【3】或者【4】掉落获得。
search_item_info_none:
- 【旁白@正常】【1】【2】,目前背包里没有这个物品哦。
search_item_info_no_exist:
- 【旁白@正常】该物品不存在。
......@@ -135,7 +139,7 @@ man:
gardener_upgrade_fail:
- 【男园丁@正常】很抱歉【1】,我这次升级失败了……
gardener_upgrade_fail_had:
- 【男园丁@正常】谢谢【1】,满级了。
- 【男园丁@正常】谢谢【1】,目前到最大等级了。
gardener_upgrade_fail_task:
- 【男园丁@正常】【1】升级不了的话,要了解一下任务详情吗?
gardener_upgrade_cancel:
......@@ -210,7 +214,7 @@ man:
view_back_pack_item_lot:
- 【男园丁@正常】这么多东西,把背包都塞得满满当当啊!
view_back_pack_item_few:
- 【男园丁@正常】这也太少了点吧……【1】,我们再去多种一点植物吧!
- 【男园丁@正常】这也太少了点吧……【1】
view_back_pack_item_fail_no_type:
- 【男园丁@正常】【1】,【2】还没告诉我想看的种类。
view_back_pack_item_fail_not_exist:
......@@ -253,7 +257,7 @@ woman:
gardener_upgrade_fail:
- 【女园丁@正常】啊……我无法获得更强大的力量升级了吗……
gardener_upgrade_fail_had:
- 【女园丁@正常】厉害了【1】,我满级可以帮【1】更多的忙。
- 【女园丁@正常】谢谢【1】,目前到最大等级了。
gardener_upgrade_fail_task:
- 【女园丁@正常】升级不了呢,要不我们去看一下任务详情吧。
gardener_upgrade_cancel:
......
......@@ -28,6 +28,8 @@ aside:
- 【旁白@正常】不存在该物品。
sell_check_fail_none:
- 【旁白@正常】背包还没有【1】。
sell_check_fail_salable:
- 【旁白@正常】【1】为重要物品,暂不能出售。
sell_check_item_success:
- 【旁白@正常】当前一共有【1】个【2】,请问想要出售多少个?
sell_success:
......@@ -42,6 +44,8 @@ aside:
- 【旁白@正常】背包里已经没有【1】了。
sell_all_check_fail_no_exist:
- 【旁白@正常】不存在这类物品。
sell_all_check_fail_salable:
- 【旁白@正常】抱歉,关键物品无法出售。
sell_all_success:
- 【旁白@正常】已完成出售,本次出售共获得【1】【2】。
sell_all_cancel:
......
aside:
#1200100:留言模板
1200100:
- 【旁白@正常】你将要给【1】留言,留言内容:“【2】”,确定吗?
#1200101:问候
1200101:
- 你好,很高兴和你成为好友,以后还请多多关照!
1200102:
- 你好,祝你今日好心情,一切顺利!
1200103:
- 【旁白@正常】你今日已发送过问候留言,每个好友每天只能发送一次问候留言。
#1200201:请求种植
1200201:
- 请您种植一些【1】可以吗?感激不尽!
1200202:
- 【旁白@正常】你提供的植物名称无效,请重新提供一遍植物名称,可以说1个想要对方种植的植物名称。
1200203:
- 【旁白@正常】你还没有说请求种植的植物名称呢,可以说1个想要对方种植的植物名称。
1200204:
- 【旁白@正常】【1】还不是你的好友,暂时不能让他种植。
1200205:
- 【旁白@正常】不能给自己留言协助攻打自己,请重新提供一个有效的玩家地址。
#1200301:请求帮助
1200301:
- 我最近太忙了,可以帮我收取果实吗?【1】号{花圃称呼}的帮助受益是【2】%,感激不尽!
1200302:
- 我最近太忙了,可以帮我收取一下果实吗?感激不尽!
1200303:
- 【旁白@正常】你目前还有没有这个{花圃称呼}编号。请您重新留言。目前有【1】。
1200304:
- 【旁白@正常】【1】还不是你的好友,暂时不能请他帮忙。
#1200401:请求协助攻打
1200401:
- 【1】攻打了我,能请你协助我攻打他吗
1200402:
- 【旁白@正常】找不到这个玩家地址,请重新提供一个有效的玩家地址。
1200403:
- 【旁白@正常】你没有提供一个玩家地址,请提供一个有效的玩家地址作为协助攻打对象。
1200404:
- 【旁白@正常】【1】还不是你的好友,暂时不能请他帮你攻打。
#1200501:问候回复
1200501:
- 你好,我也很高兴和你成为好友,以后互相关照!
1200502:
- 你好,祝你今日好心情,一切顺利!
#1200601:请求种植回复
1200601:
- 好的,下一次我会种植你想要的这些植物,记得过来帮助收取。
1200602:
- 不好意思,我暂时没办法种植你需要的这些植物,下次再说吧。
#1200701:请求帮助回复
1200701:
- 好的,我会想着帮你收取果实的,放心吧!
1200702:
- 抱歉,我这几天可能没空,没办法帮到你了。
#1200801:请求协助攻打回复
1200801:
- 好的,我会协助你攻打他。
1200802:
- 不好意思,我的宠物能力不足,可能帮不到你了。
#1200901:种植感谢
1200901:
- 感谢你满足了我的种植请求。
1200902:
- 【旁白@正常】【1】还不是你的好友,暂时不能感谢种植。
#1201001:帮助感谢
1201001:
- 感谢你帮我收取了果实。
1201002:
- 【旁白@正常】【1】还不是你的好友,暂时不能感谢帮助。
#1201101:协助攻打感谢
1201101:
- 感谢你协助我攻打。
1201102:
- 【旁白@正常】【1】还不是你的好友,暂时不能感谢攻打。
#1201201:感谢回复
1201201:
- 不客气,有需要帮忙的尽管提。
1201202:
- 【旁白@正常】【1】还不是你的好友,暂时不能回复感谢。
#1201301:请求放置宠物
1201301:
- 可以请你在{花圃称呼}中放置【1】吗?感激不尽。
1201302:
- 【旁白@正常】你提供的宠物名称无效,请重新提供一遍宠物名称,可以说1个想要对方放置的宠物名称。
1201303:
- 【旁白@正常】你还没有说请求放置的宠物名称呢,可以说1个想要对方放置的宠物名称。
1201304:
- 【旁白@正常】【1】还不是你的好友,暂时不能请求放置宠物。
#1201401:请求宠物回复
1201401:
- 好的,下一次种植时我会放置你需要的宠物。
1201402:
- 不好意思,我没有你说的宠物,暂时不能满足你的请求。
#1201501:宠物感谢
1201501:
- 感谢你放置了我需要的宠物。
1201502:
- 【旁白@正常】【1】还不是你的好友,暂时不能感谢放置宠物。
#1201601:通知种植情况
1201601:
- 我在【1】号{花圃称呼}上种植了【2】,距离成熟还有【3】,有空可以帮我收一下果实哦,有回报的。
120160101:
- 我在【1】号{花圃称呼}上种植了【2】,已经成熟了,有空可以帮我收一下果实哦,有回报的。
1201602:
- 【旁白@正常】你提供的苗圃上还没有种植植物,请提供一个已经种植植物的苗圃编号。
1201603:
- 【旁白@正常】你还没有提供一个苗圃编号,请提供一个已经种植植物的苗圃编号。
1201604:
- 【旁白@正常】你目前还有没有这个{花圃称呼}编号。请您重新留言。目前有【1】。
1201605:
- 【旁白@正常】【1】还不是你的好友,暂时不能通知他种植情况。
#1201701:通知宠物放置情况
1201701:
- 我在【1】号{花圃称呼}放置了【2】。
120170101:
- 我在【1】号{花圃称呼}放置了【2】,目前正在种植【3】,距离成熟还有【4】,有空可以帮我收一下果实哦,有回报的。。
120170102:
- 我在【1】号{花圃称呼}放置了【2】,目前正在种植【3】,已经成熟了,有空可以帮我收一下果实哦,有回报的。。
1201702:
- 【旁白@正常】你提供的苗圃上还没有放置宠物,请提供一个放置了宠物的苗圃编号。
1201703:
- 【旁白@正常】你还没有提供一个苗圃编号,请提供一个放置了宠物的苗圃编号。
1201704:
- 【旁白@正常】你目前还有没有这个{花圃称呼}编号。请您重新留言。目前有【1】。
1201705:
- 【旁白@正常】【1】还不是你的好友,暂时不能通知他宠物放置情况。
#1201801:通知帮助情况
1201801:
- 我今天帮你收取了果实,感谢你的酬劳。
1201802:
- 【旁白@正常】你今天还没有帮助过他,帮助他收取果实后再通知他这件事吧。
1201803:
- 【旁白@正常】【1】还不是你的好友,不能帮助,暂时不能通知。
#1201901:通知攻打情况
1201901:
- 我今天已经协助你攻打了【1】。
1201902:
- 【旁白@正常】你今天并没有协助过他攻打,攻打【1】后再通知他这件事吧。
1201903:
- 【旁白@正常】你还没有提供一个玩家地址,请提供一个今天攻打过的玩家地址。
1201904:
- 【旁白@正常】【1】还不是你的好友,暂时不能通知攻打情况。
#1202001:请求提升/降低帮助收益
1202001:
- 请您【1】帮助收益到【2】%好吗?感激不尽!
1202002:
- 【旁白@正常】你提供的收益比例无效,请重新提供一下收益比例参数,可以选择在【1】%至【2】%之间的任意整数参数。
1202003:
- 请您【1】一下帮助收益好吗?感激不尽!
1202004:
- 【旁白@正常】请问你是想要【1】提升收益比例还是降低收益比例呢?
1202005:
- 【旁白@正常】【1】还不是你的好友,暂时不能请求改变收益比例。
#1202101:回复请求提升帮助收益
1202101:
- 好的,我会【1】帮助收益。
1202102:
- 不好意思,暂时不能【1】帮助收益
#1202201:通知提升/降低帮助收益
1202201:
- 我已经把【1】号{花圃称呼}的帮助收益【2】到了【3】,欢迎你随时来帮助我收取果实。
1202202:
- 【旁白@正常】你提供的【1】号{花圃称呼}今天还没有变更过帮助收益,请提供一个今日内变更过帮助收益的苗圃。
1202203:
- 【旁白@正常】你还没有提供{花圃称呼}编号哦。目前有【1】。
1202204:
- 【旁白@正常】你目前还有没有这个{花圃称呼}编号。请您重新留言。目前有【1】。
1202205:
- 【旁白@正常】【1】还不是你的好友,暂时不能通知改变收益比例。
#1202301:提升/降低帮助请求感谢
1202301:
- 感谢你更改了帮助收益。
1202302:
- 【旁白@正常】【1】还不是你的好友,暂时不能感谢改变收益比例。
#1202401:请求休战
1202401:
- 苗圃种植不易,请您高抬贵手,不要再攻打我了。
1202402:
- 【旁白@正常】您的留言对象从来没有攻打过你,换一个人留言吧。
1202403:
- 【旁白@正常】【1】是你的好友,不能攻打你。
#1202501:请求休战回复
1202501:
- 好吧,冤家宜解不宜结,咱们就此休战。
1202502:
- 不好意思,暂时无法满足你的请求。
#1202601:休战感谢
1202601:
- 感谢你的休战承诺。
1202602:
- 【旁白@正常】【1】是你的好友,不能攻打你的。
#1202701:问候(陌生人)
1202701:
- 你好,你的苗圃被照顾的不错。
1202702:
- 今天又是美好的一天,希望你的苗圃生长旺盛!
1202703:
- 【旁白@正常】你今日已发送过问候留言,每个陌生人每天只能发送一次问候留言。
#1202801:邀请攻打
1202801:
- 我的宠物阵容很强大,要来挑战一下吗?如果能赢我,苗圃的收益任选。
1202802:
- 【旁白@正常】【1】是你的好友,不能攻打你。
#1202901:邀请攻打回复
1202901:
- 这么有自信?我这就来试试你的阵容。
1202902:
- 我的阵容还不够强大,就不挑战了吧。
#1203001:模糊感谢
1203001:
- 谢谢你对我的所有帮助。
\ No newline at end of file
......@@ -12,7 +12,7 @@ aside:
pet_view_both:
- 【旁白@正常】【1】【2】,属性:【3】,生命值:【4】,攻击值:【5】,目前有【6】只该宠物正在宠物栏里,有【7】只该宠物正养在【8】中。
pet_view_no_pet:
- 【旁白@正常】{花圃称呼}、宠物栏内没有该宠物。我们还没有这个宠物,可以通过种植【1】,以一定几率获得
- 【旁白@正常】{花圃称呼}、宠物栏内没有该宠物。可以通过种植【1】,以一定几率获得
pet_view_no_exist:
- 【旁白@正常】不存在该宠物。
#宠物移动
......@@ -146,6 +146,29 @@ aside:
#升级宠物
upgrade_pet:
- 【旁白@正常】宠物不支持升级。可以去看看有哪些宠物。
#玩家选定宠物
pet_choose:
- 【旁白@正常】没有你说的宠物哦,你可以在【1】和【2】中选择。
#宠物比试结果
pet_match_fail:
- 【旁白@正常】很抱歉,你目前只有【1】【2】,不够下注。
pet_match_win:
- 【旁白@正常】恭喜你,这次共赢得【1】【2】,现有【3】【2】。
pet_match_win_cost:
- 【旁白@正常】恭喜你,这次共赢得【1】【2】,现有【3】【2】,还了对方【4】【2】。
pet_match_lose:
- 【旁白@正常】很遗憾,这次你押的【1】【2】全输掉了,目前还剩下【3】【2】。
#宠物比试结果
copy_pet_no_name:
- 【旁白@正常】没有这个副本哦,现在有【1】。
copy_pet_finished:
- 【旁白@正常】天选者,本周你已经成功的战胜了【1】里的邪灵。若想再次挑战需等待至下周一的平旦之时。
copy_pet_lack_one:
- 【旁白@正常】抱歉,本周【1】需要【2】和【3】才可以挑战,您目前缺少【4】,快去种植与之对应的植物吧,快去种植与之对应的植物吧。如果不清楚怎么吸引,可以问问花仙“怎么吸引【4】”。
copy_pet_lack_two:
- 【旁白@正常】抱歉,本周【1】需要【2】和【3】才可以挑战,您目前两只宠物都没有,快去种植与之对应的植物吧。如果不清楚怎么吸引,可以问问花仙“怎么吸引【2】”。
copy_pet_lack_success:
- 【旁白@平静】►打开:当前作品:绫华不歪玩到关服◄
......
......@@ -94,7 +94,7 @@ aside:
check_nursery_fail_wrong_num:
- 【旁白@正常】该{花圃称呼}编号不存在,还无法查看。目前有【1】。
check_nursery_info:
- 【旁白@正常】【1】号{花圃称呼}当前等级为【2】,类型:【3】
- 【旁白@正常】🅰【1】号🅱{花圃称呼}当前等级为🅰【2】🅱,类型:🅰【3】🅱
check_nursery_info_have_plant_pet:
- ,正在种植【1】,【2】【3】在这个{花圃称呼}中。
check_nursery_info_have_plant_no_pet:
......@@ -105,38 +105,38 @@ aside:
- ,这里还没有种植植物,也没有宠物。
#查看花圃状态
nursery_seeding:
- 【旁白@正常】【1】号{花圃称呼}的植物果实刚种下还没发芽。
- 【旁白@正常】🅰【1】号🅱{花圃称呼}的植物果实刚种下还没发芽。
nursery_sowing:
- 【旁白@正常】【1】号{花圃称呼}的植物新抽出了绿芽,看起来是在茁壮成长;
- 【旁白@正常】🅰【1】号🅱{花圃称呼}的植物新抽出了绿芽,看起来是在茁壮成长;
nursery_growing:
- 【旁白@正常】【1】号{花圃称呼}的植物距离成熟期还有一段时间,看来还需要耐心等待啊……
- 【旁白@正常】🅰【1】号🅱{花圃称呼}的植物距离成熟期还有一段时间,看来还需要耐心等待啊……
nursery_blooming:
- 【旁白@正常】【1】号{花圃称呼}的【2】已经结了花苞,离成熟还有一段时间。
- 【旁白@正常】🅰【1】号🅱{花圃称呼}的🅰【2】🅱已经结了花苞,离成熟还有一段时间。
nursery_mature:
- 【旁白@正常】【1】号{花圃称呼}的果实已经成熟可以摘取!
- 【旁白@正常】【1】号{花圃称呼}硕果累累,可以摘取了!
- 【旁白@正常】🅰【1】号🅱{花圃称呼}的果实已经成熟可以摘取!
- 【旁白@正常】🅰【1】号🅱{花圃称呼}硕果累累,可以摘取了!
nursery_pet:
- 【1】种植过的植物吸引来了【2】只神秘的动物。
- 【1】种植过的植物吸引来了🅰【2】只🅱神秘的动物。
nursery_level:
- 【旁白@正常】【1】号{花圃称呼}的等级目前为【2】级,类型为【3】。
- 【旁白@正常】🅰【1】号🅱{花圃称呼}的等级目前为🅰【2】级🅱,类型为🅰【3】🅱。
nursery_fail_no_nursery:
- 【旁白@正常】你还提供没有{花圃称呼}编号,目前有【1】。
nursery_all_fail_no_plant:
- 【旁白@正常】所有{花圃称呼}还未种植。
nursery_all_check:
- 【旁白@正常】一共有【1】个苗圃,【2】。
- 【旁白@正常】一共有🅰【1】个🅱苗圃,【2】。
nursery_all_seeding:
- 中的【1】刚刚播种了,
- 中的🅰【1】🅱刚刚播种了,
nursery_all_sowing:
- 中的【1】刚刚发出嫩芽,
- 中的🅰【1】🅱刚刚发出嫩芽,
nursery_all_growing:
- 中的【1】正在茁壮成长,
- 中的🅰【1】🅱正在茁壮成长,
nursery_all_blooming:
- 中的【1】已经开花,
- 中的🅰【1】🅱已经开花,
nursery_all_mature:
- 中的【1】已经成熟,可以收取果实了。
- 中的🅰【1】🅱已经成熟,可以收取果实了。
nursery_have_free:
- 有【1】个{花圃称呼}还空闲着。
- 有🅰【1】🅱个{花圃称呼}还空闲着。
#铲除植物
clear_plant_check:
- 【旁白@正常】确定消耗【1】个【2】,铲除【3】号{花圃称呼}上的植物吗?
......@@ -497,7 +497,7 @@ woman:
- 【女园丁@正常】【1】不要灰心!我们再去找找材料吧!
- 【女园丁@正常】没再【1】的背包里看到这种材料呢……我陪【1】再去外面找找吧。
- 【女园丁@正常】没关系,找到材料后我们还可以回来种植的。
plant_fail_no_near_plant:
plant_fail_near_plant:
- 【女园丁@正常】这种植物需要先种植另一种植物才可以呢。
- 【女园丁@正常】这两种植物是伴生关系,缺一不可的。
- 【女园丁@正常】种植完伴生植物后,再来种植对应的植物吧!
......
......@@ -200,15 +200,17 @@ aside:
- 【旁白@正常】已为你取消留言,要继续留言吗?
#查看留言
check_message:
- 【旁白@正常】【1】给你留了信息,需要查看一下吗?
- 【旁白@正常】【1】信息,需要查看一下吗?
check_message_fail:
- 【旁白@正常】当前没有好友留言。
- 【旁白@正常】当前没有玩家留言。
read_message_pre:
- 【旁白@正常】你的好友【1】在你的留言板上写下了这样一段话。
- 【旁白@正常】【1】在你的留言板上写下了这样一段话。
read_message_content:
- 【旁白@正常】【1】。
- 【旁白@正常】【1】
read_message_end:
- 【旁白@正常】留言播报结束,您可以选择重播或者播放下一条留言,播放下一条留言时会删除已读留言。
- 【旁白@正常】留言播报结束,您可以选择重播或者播放下一条留言。
read_message_end_answer:
- 【旁白@正常】留言播报结束,您可以选择重播或者播放下一条留言。当然你也可以说“回复留言”来快速回复该留言。
read_message_fail_no_pre:
- 【旁白@正常】请先检查有哪些好友有留言再查看留言。
read_message_fail_over:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment