Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
da43de4742
File diff suppressed because it is too large
Load Diff
|
|
@ -15,6 +15,8 @@ public class SDifferDemonsConfig implements BaseConfig {
|
|||
|
||||
private int[] comonpentList;
|
||||
|
||||
private String name;
|
||||
|
||||
public static Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMap;
|
||||
|
||||
|
||||
|
|
@ -39,5 +41,7 @@ public class SDifferDemonsConfig implements BaseConfig {
|
|||
return comonpentList;
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
|
@ -25,6 +25,8 @@ public class SItem implements BaseConfig {
|
|||
private String resolveReward;
|
||||
private int itemNumlimit;
|
||||
|
||||
private String name;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sItemMap = STableManager.getConfig(SItem.class);
|
||||
|
|
@ -93,4 +95,8 @@ public class SItem implements BaseConfig {
|
|||
public int getItemNumlimit() {
|
||||
return itemNumlimit;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class SRingFireConfig implements BaseConfig {
|
|||
|
||||
private int ringId;
|
||||
|
||||
private String ringQuality;
|
||||
private int ringQuality;
|
||||
|
||||
private int ringLevel;
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public class SRingFireConfig implements BaseConfig {
|
|||
return ringId;
|
||||
}
|
||||
|
||||
public String getRingQuality() {
|
||||
public int getRingQuality() {
|
||||
return ringQuality;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="WorkShopTechnology")
|
||||
public class SWorkShopTechnology implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int techId;
|
||||
|
||||
private int level;
|
||||
|
||||
private int[][] values;
|
||||
|
||||
private int rankNum;
|
||||
|
||||
private int profession;
|
||||
|
||||
private int[][] limits;
|
||||
|
||||
private int[][] consume;
|
||||
|
||||
private static Map<Integer,Map<Integer,SWorkShopTechnology>> sWorkTechMapByTechIdAndLevel;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SWorkShopTechnology> config = STableManager.getConfig(SWorkShopTechnology.class);
|
||||
Map<Integer,Map<Integer,SWorkShopTechnology>> sWorkTechMapByTechIdAndLevelTmp = new HashMap<>();
|
||||
for(SWorkShopTechnology sWorkShopTechnology : config.values()){
|
||||
int techId = sWorkShopTechnology.getTechId();
|
||||
int level = sWorkShopTechnology.getLevel();
|
||||
if(!sWorkTechMapByTechIdAndLevelTmp.containsKey(techId)){
|
||||
sWorkTechMapByTechIdAndLevelTmp.put(techId,new HashMap<>());
|
||||
}
|
||||
sWorkTechMapByTechIdAndLevelTmp.get(techId).put(level,sWorkShopTechnology);
|
||||
}
|
||||
sWorkTechMapByTechIdAndLevel =sWorkTechMapByTechIdAndLevelTmp;
|
||||
}
|
||||
|
||||
public static SWorkShopTechnology getsWorkTechMapByTechIdAndLevel(int techId,int level) {
|
||||
if(!sWorkTechMapByTechIdAndLevel.containsKey(techId)){
|
||||
return null;
|
||||
}
|
||||
return sWorkTechMapByTechIdAndLevel.get(techId).get(level);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getTechId() {
|
||||
return techId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int[][] getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
public int getRankNum() {
|
||||
return rankNum;
|
||||
}
|
||||
|
||||
public int getProfession() {
|
||||
return profession;
|
||||
}
|
||||
|
||||
public int[][] getLimits() {
|
||||
return limits;
|
||||
}
|
||||
|
||||
public int[][] getConsume() {
|
||||
return consume;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -59,6 +59,7 @@ public interface BIReason {
|
|||
int WORKSHOP_REBUILD_EQUIP_CONSUME = 1004;
|
||||
int WORKSHOP_CREATEMATERIAL_CONSUME = 1005;
|
||||
int WORKSHOP_EQUIP_CONSUME = 1005;
|
||||
int WORKSHOP_TECHNOLOGY_CONSUME = 1005;
|
||||
int ACTIVE_BLUE_CONSUME = 1006;
|
||||
int STORE_HAND_REFRESH = 1007;//手动刷新商店
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ public interface GlobalItemType {
|
|||
int RUNNE = 6; //符文
|
||||
int BLUE_IMAGE=7; // 蓝图
|
||||
int MINERAL=8; // 矿石
|
||||
int RINGTYPE=9; // 矿石
|
||||
|
||||
//物品使用类型
|
||||
int NO_USE = 0 ; //不使用
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.ljsd.jieling.handler.workshop;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.item.WorkShopLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class WorkShopTechnologyLevelHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.WORKSHOP_TECHNOLOGY_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
PlayerInfoProto.WorkTechnologyLevelRequest workTechnologyLevelRequest = PlayerInfoProto.WorkTechnologyLevelRequest.parseFrom(netData.parseClientProtoNetData());
|
||||
WorkShopLogic.getInstance().workShopTechnogyLevel(iSession,workTechnologyLevelRequest.getId());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -8,13 +8,11 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.util.MathUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class WorkShopController extends MongoBase {
|
||||
private Map<Integer, List<Integer>> openBlueStateMap;
|
||||
private Map<Integer,Integer> technologyMap = new HashMap<>();
|
||||
private int workShopLevel;
|
||||
|
||||
private int workShopExp;
|
||||
|
|
@ -38,6 +36,11 @@ public class WorkShopController extends MongoBase {
|
|||
updateString("openBlueStateMap." + type, openBlueStateMap.get(type));
|
||||
}
|
||||
|
||||
public void updateTechLevel(int techId,int level){
|
||||
this.technologyMap.put(techId,level);
|
||||
updateString("technologyMap." + techId,level);
|
||||
}
|
||||
|
||||
public int getWorkShopLevel() {
|
||||
return workShopLevel;
|
||||
}
|
||||
|
|
@ -78,4 +81,7 @@ public class WorkShopController extends MongoBase {
|
|||
return cookExp;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getTechnologyMap() {
|
||||
return technologyMap;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -562,6 +562,10 @@ public class HeroLogic {
|
|||
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
||||
|
||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,null,true);
|
||||
if(targetHero.getStar()>=7){
|
||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_hero_content", new Object[]{user.getPlayerInfoManager().getNickName(), scHero.getReadingName(),targetHero.getStar()});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,targetHero.getTemplateId(),0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1124,7 +1128,6 @@ public class HeroLogic {
|
|||
int msgId = MessageTypeProto.MessageType.HERO_COMPOSE_RESPONSE_VALUE;
|
||||
int uid = iSession.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
int hasHeroNum = user.getHeroManager().getHeroMap().size();
|
||||
int itemId = item.getItemId();
|
||||
int itemNum = item.getItemNum();
|
||||
|
|
@ -1279,7 +1282,17 @@ public class HeroLogic {
|
|||
|
||||
//发送成功消息
|
||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.POKEMON_ADVANCED_RESPONSE_VALUE,null,true);
|
||||
String message=null;
|
||||
if(pokemon.getAllStage()==1){
|
||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_activate_differ_golden_content", new Object[]{user.getPlayerInfoManager().getNickName(),sDifferDemonsConfig.getName() });
|
||||
|
||||
}else{
|
||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_differ_golden_content", new Object[]{user.getPlayerInfoManager().getNickName(), sDifferDemonsConfig.getName(),pokemon.getAllStage()});
|
||||
}
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,sDifferDemonsConfig.getId(),0,0,0,0,0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,33 @@ public class WorkShopLogic {
|
|||
|
||||
private WorkShopLogic(){}
|
||||
|
||||
public void workShopTechnogyLevel(ISession iSession, int techId) throws Exception {
|
||||
int uid = iSession.getUid();
|
||||
int msgId = MessageTypeProto.MessageType.WORKSHOP_TECHNOLOGY_RESPONSE_VALUE;
|
||||
User user = UserManager.getUser(uid);
|
||||
WorkShopController workShopController = user.getWorkShopController();
|
||||
Map<Integer, Integer> technologyMap = workShopController.getTechnologyMap();
|
||||
int oldLevl = 0;
|
||||
if(technologyMap.containsKey(techId)){
|
||||
oldLevl = technologyMap.get(techId);
|
||||
}
|
||||
SWorkShopTechnology sWorkShopTechnology = SWorkShopTechnology.getsWorkTechMapByTechIdAndLevel(techId, oldLevl + 1);
|
||||
if(sWorkShopTechnology == null){
|
||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"maxLevel");
|
||||
return;
|
||||
}
|
||||
workShopController.updateTechLevel(techId,oldLevl + 1);
|
||||
int[][] consume = sWorkShopTechnology.getConsume();
|
||||
boolean enough = ItemUtil.itemCost(user, consume, BIReason.WORKSHOP_TECHNOLOGY_CONSUME, sWorkShopTechnology.getId());
|
||||
if(!enough){
|
||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"道具不足");
|
||||
return;
|
||||
}
|
||||
MessageUtil.sendMessage(iSession,1, msgId,null,true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static class Instance {
|
||||
public final static WorkShopLogic instance = new WorkShopLogic();
|
||||
}
|
||||
|
|
@ -216,6 +243,7 @@ public class WorkShopLogic {
|
|||
CommonProto.Equip equipProto = CBean2Proto.getEquipProto(unDetermined);
|
||||
builder.setUnDetermined(equipProto);
|
||||
}
|
||||
builder.addAllTechnologyInfo(CBean2Proto.getTechInfo(workShopController.getTechnologyMap()));
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_WORKSHOP_INFO_RESPONSE_VALUE,builder.build(),true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -289,4 +289,14 @@ public class CBean2Proto {
|
|||
public static CommonProto.RingFireInfo getRingFire(Pokemon pokemon) {
|
||||
return CommonProto.RingFireInfo.newBuilder().addAllComonpentId(pokemon.getComonpentsLevelMap().keySet()).setStage(pokemon.getAllStage()).setId(pokemon.getId()).build();
|
||||
}
|
||||
|
||||
public static List<CommonProto.TechnologyInfo> getTechInfo(Map<Integer,Integer> techInfoMap){
|
||||
List<CommonProto.TechnologyInfo> result = new ArrayList<>(techInfoMap.size());
|
||||
for(Map.Entry<Integer,Integer> item : techInfoMap.entrySet()){
|
||||
result.add(CommonProto.TechnologyInfo.newBuilder().setTechId(item.getKey()).setLevle(item.getValue()).build());
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,12 +24,16 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||
|
||||
public class ItemUtil {
|
||||
private static Map<Integer,String> dropRewardMap = new ConcurrentHashMap<>();
|
||||
private static Map<Integer,String> equipQulityNameMap = new HashMap<>(2);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ItemUtil.class);
|
||||
private static Set<Integer> notDelete = new HashSet<>();
|
||||
|
||||
static {
|
||||
notDelete.add(Global.STAMINA);
|
||||
notDelete.add(Global.HEROSTORY_TICKET);
|
||||
notDelete.add(Global.GENERALSTORY_TICKET);
|
||||
equipQulityNameMap.put(5,"传说");
|
||||
equipQulityNameMap.put(6,"史诗");
|
||||
}
|
||||
|
||||
//指定道具掉落(如:邮件,初始化物品)
|
||||
|
|
@ -332,6 +336,7 @@ public class ItemUtil {
|
|||
case GlobalItemType.RUNNE:
|
||||
case GlobalItemType.CARD_FRAGMENT:
|
||||
case GlobalItemType.BLUE_IMAGE:
|
||||
case GlobalItemType.RINGTYPE:
|
||||
case GlobalItemType.MINERAL:
|
||||
itemType = GlobalItemType.ITEM;
|
||||
break;
|
||||
|
|
@ -392,6 +397,11 @@ public class ItemUtil {
|
|||
if (entry.getKey() == Global.STAMINA){
|
||||
LOGGER.info("增加的=========num={}, 操作后={}, 时间={}",itemNum,user.getItemManager().getItemMap().get(Global.STAMINA).getItemNum(),user.getItemManager().getItemMap().get(Global.STAMINA).getEndingTime());
|
||||
}
|
||||
if(sItem.getItemType() == GlobalItemType.POKENMON_COMONPENT){
|
||||
String nickName = user.getPlayerInfoManager().getNickName();
|
||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_differ_content", new Object[]{nickName,sItem.getName()});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,sItem.getId(),0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
if (dropBuilder != null) {
|
||||
dropBuilder.addAllItemlist(itemProtoList);
|
||||
|
|
@ -650,6 +660,13 @@ public class ItemUtil {
|
|||
Equip equip = new Equip(user.getId(),equipId);
|
||||
equipManager.addEquip(user,equip);
|
||||
equipList.add(CBean2Proto.getEquipProto(equip));
|
||||
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equipId);
|
||||
if (sEquipConfig.getQuality() >= 5) {
|
||||
String nickName = user.getPlayerInfoManager().getNickName();
|
||||
|
||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_equip_content", new Object[]{nickName, equipQulityNameMap.get(sEquipConfig.getQuality()),SItem.getsItemMap().get(equipId).getName()});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,equipId,0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue