Commit c9096bbd by 周君强

1.反馈问题修复

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