back_recharge
parent
aaf700ca6c
commit
0bc5d8fb90
|
@ -0,0 +1,83 @@
|
|||
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 = "EquipSign")
|
||||
public class SEquipSign implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int quality;
|
||||
|
||||
private int type;
|
||||
|
||||
private int level;
|
||||
|
||||
private int[][] property;
|
||||
|
||||
private int experience;
|
||||
|
||||
private int resolve;
|
||||
|
||||
public static Map<Integer, SEquipSign> sEquipSignMap;
|
||||
private static Map<Integer, Integer> equipExpMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sEquipSignMap = STableManager.getConfig(SEquipSign.class);
|
||||
int sum = 0;
|
||||
for (Map.Entry<Integer, SEquipSign> entry : sEquipSignMap.entrySet()) {
|
||||
sum += entry.getValue().getExperience();
|
||||
equipExpMap.put(entry.getKey(), sum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getQuality() {
|
||||
return quality;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int[][] getProperty() {
|
||||
return property;
|
||||
}
|
||||
|
||||
public int getExperience() {
|
||||
return experience;
|
||||
}
|
||||
|
||||
public int getResolve() {
|
||||
return resolve;
|
||||
}
|
||||
|
||||
public static Map<Integer, SEquipSign> getsEquipSignMap() {
|
||||
return sEquipSignMap;
|
||||
}
|
||||
|
||||
public static void setsEquipSignMap(Map<Integer, SEquipSign> sEquipSignMap) {
|
||||
SEquipSign.sEquipSignMap = sEquipSignMap;
|
||||
}
|
||||
|
||||
public static Map<Integer, Integer> getEquipExpMap() {
|
||||
return equipExpMap;
|
||||
}
|
||||
|
||||
public static void setEquipExpMap(Map<Integer, Integer> equipExpMap) {
|
||||
SEquipSign.equipExpMap = equipExpMap;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="EquipSignSetting")
|
||||
public class SEquipSignSetting implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int slotPosition;
|
||||
|
||||
private int[] openRules;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getSlotPosition() {
|
||||
return slotPosition;
|
||||
}
|
||||
|
||||
public int[] getOpenRules() {
|
||||
return openRules;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
import com.ljsd.jieling.util.StringUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name = "EquipTalismanaLottery")
|
||||
public class SEquipTalismanaLottery implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int[][] drop;
|
||||
|
||||
private int[][] probability;
|
||||
|
||||
private int[] costItem;
|
||||
|
||||
private int[] repeatedlyCost;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int[][] getDrop() {
|
||||
return drop;
|
||||
}
|
||||
|
||||
public int[][] getProbability() {
|
||||
return probability;
|
||||
}
|
||||
|
||||
public int[] getCostItem() {
|
||||
return costItem;
|
||||
}
|
||||
|
||||
public int[] getRepeatedlyCost() {
|
||||
return repeatedlyCost;
|
||||
}
|
||||
|
||||
}
|
|
@ -17,6 +17,8 @@ public class SSpecialConfig implements BaseConfig {
|
|||
private String value;
|
||||
|
||||
public static final String PHONE_BINDING = "Phone_Binding";
|
||||
public static final String MANDATORY_ASTROLOGICAL = "Mandatory_Astrological";
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
|
|
@ -80,6 +80,9 @@ public interface BIReason {
|
|||
int BIND_PHONE = 49; // 修改手机号
|
||||
|
||||
int ENDLESS_REASON_CHANGE = 50;//无尽副本赛季更换
|
||||
int RANDOM_SOULEQUIP = 51;//占星
|
||||
|
||||
|
||||
//道具消耗原因 1000开头
|
||||
int ADVENTURE_UPLEVEL_CONSUME = 1000; //秘境升级
|
||||
int SECRETBOX_CONSUME = 1001; //秘盒抽卡
|
||||
|
@ -141,4 +144,7 @@ public interface BIReason {
|
|||
|
||||
int ESPECIAL_EQUIP_UP_LEVEL_CONSUME = 1035;//法宝进阶消耗
|
||||
|
||||
|
||||
int RANDOM_SOULEQUIP_CONSUME = 1036;//占星
|
||||
|
||||
}
|
|
@ -117,7 +117,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
goodsTypeDurations.add(CommonProto.GoodsTypeDuration.newBuilder().setGoodsType(sRechargeCommodityConfig.getType()).setEndTime(goodsEndTime).build());
|
||||
}
|
||||
//问卷状态
|
||||
int questState =0;
|
||||
int questState =-1;
|
||||
if(user.getQuestionManager().getQuestId()!=0){
|
||||
questState=user.getQuestionManager().getQuestState();
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class UseAndPriceItemHandler extends BaseHandler {
|
||||
public class UseAndPriceItemHandler extends BaseHandler<PlayerInfoProto.UseAndPriceItemRequest> {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(UseAndPriceItemHandler.class);
|
||||
|
||||
|
@ -22,10 +22,9 @@ public class UseAndPriceItemHandler extends BaseHandler {
|
|||
return MessageTypeProto.MessageType.USER_AND_PRICE_ITEM_REQUEST;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
PlayerInfoProto.UseAndPriceItemRequest useAndPriceItemRequest
|
||||
= PlayerInfoProto.UseAndPriceItemRequest.parseFrom(netData.parseClientProtoNetData());
|
||||
public void processWithProto(ISession iSession, PlayerInfoProto.UseAndPriceItemRequest useAndPriceItemRequest) throws Exception {
|
||||
int type = useAndPriceItemRequest.getType();
|
||||
List<CommonProto.Item> itemList = useAndPriceItemRequest.getItemsList();
|
||||
List<String> equipIdsList = useAndPriceItemRequest.getEquipIdsList();
|
||||
|
@ -39,8 +38,10 @@ public class UseAndPriceItemHandler extends BaseHandler {
|
|||
} else if(type==3){
|
||||
CommonProto.Drop.Builder baseBuilder =ItemLogic.getInstance().decomposeHero(iSession,heroIdsList,null, MessageTypeProto.MessageType.USER_AND_PRICE_ITEM_RESPONSE_VALUE);
|
||||
ItemLogic.sendUseAndPriceItemMessage(iSession, MessageTypeProto.MessageType.USER_AND_PRICE_ITEM_RESPONSE_VALUE, baseBuilder);
|
||||
}else {//分解法宝
|
||||
}else if(type==4){//分解法宝
|
||||
ItemLogic.getInstance().decomposeEspecialEquip(iSession, equipIdsList);
|
||||
}else if(type==5){//分解魂印
|
||||
ItemLogic.getInstance().decomposeSoulEquip(iSession, equipIdsList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
package com.ljsd.jieling.handler;
|
||||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class EquipWearHandler extends BaseHandler{
|
||||
public class EquipWearHandler extends BaseHandler<HeroInfoProto.EquipWearRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.EQUIP_WEAR_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
HeroInfoProto.EquipWearRequest equipWearRequest = HeroInfoProto.EquipWearRequest.parseFrom(netData.parseClientProtoNetData());
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.EquipWearRequest equipWearRequest) throws Exception {
|
||||
HeroLogic.getInstance().wearEquipOpt(iSession,equipWearRequest.getHeroId(),equipWearRequest.getEquipIdList(),equipWearRequest.getType());
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.config.SSpecialConfig;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ForceRandSoulEquipHandler extends BaseHandler<HeroInfoProto.SoulForceRandRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.SOUL_FORCE_RAND_EQUIP_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.SoulForceRandRequest proto) throws Exception {
|
||||
int uid = iSession.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
String err = StoreLogic.checkBuyGoodsAndUpdate(user,7,10019,1);
|
||||
if (!"".equals(err)){
|
||||
MessageUtil.sendErrorResponse(iSession,0,MessageTypeProto.MessageType.SOUL_FORCE_RAND_EQUIP_RESPONSE_VALUE,err);
|
||||
return;
|
||||
}
|
||||
int pos= SSpecialConfig.getIntegerValue(SSpecialConfig.MANDATORY_ASTROLOGICAL);
|
||||
user.getEquipManager().setSoulEquipPool(pos);
|
||||
HeroInfoProto.SoulForceRandResponse.Builder builder = HeroInfoProto.SoulForceRandResponse.newBuilder();
|
||||
builder.setPos(pos);
|
||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.SOUL_FORCE_RAND_EQUIP_RESPONSE_VALUE,builder.build(),true);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.handler;
|
||||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
@ -8,17 +9,14 @@ import com.ljsd.jieling.protocols.MessageTypeProto;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class GetAllEquipHandler extends BaseHandler{
|
||||
public class GetAllEquipHandler extends BaseHandler<HeroInfoProto.GetAllEquipRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.GET_ALL_EQUIP_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
byte[] message = netData.parseClientProtoNetData();
|
||||
HeroInfoProto.GetAllEquipRequest getAllEquipRequest
|
||||
= HeroInfoProto.GetAllEquipRequest.parseFrom(message);
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.GetAllEquipRequest getAllEquipRequest) throws Exception {
|
||||
int index = getAllEquipRequest.getIndex();
|
||||
int type = getAllEquipRequest.getType();
|
||||
HeroLogic.getInstance().getAllEquipInfo(iSession,index,type);
|
|
@ -0,0 +1,21 @@
|
|||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class RandSoulEquipHandler extends BaseHandler<HeroInfoProto.SoulRandRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.SOUL_RAND_EQUIP_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.SoulRandRequest proto) throws Exception {
|
||||
ItemLogic.getInstance().soulEquipRand(iSession, proto.getTime());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class SoulEquipUnLoadOptHandler extends BaseHandler<HeroInfoProto.SoulEquipUnLoadWearRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.SOUL_EQUIP_UNLOAD_OPT_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.SoulEquipUnLoadWearRequest equipUnLoadOptRequest) throws Exception {
|
||||
|
||||
List<HeroInfoProto.SoulEquipPos> equipIdsList = equipUnLoadOptRequest.getSoulEquipIdsList();
|
||||
String heroId = equipUnLoadOptRequest.getHeroId();
|
||||
HeroLogic.getInstance().unloadSoulEquipOpt(iSession,heroId,equipIdsList);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class SoulEquipWearHandler extends BaseHandler<HeroInfoProto.SoulEquipWearRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.SOUL_EQUIP_WEAR_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.SoulEquipWearRequest equipWearRequest) throws Exception {
|
||||
List<HeroInfoProto.SoulEquipPos> equipIdsList = equipWearRequest.getSoulEquipIdsList();
|
||||
HeroLogic.getInstance().wearSoulEquipOpt(iSession,equipWearRequest.getHeroId(),equipIdsList);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.config.SEquipSign;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.SoulEquip;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.ljsd.jieling.util.StringUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class UpSoulEquipQuiickHandler extends BaseHandler<HeroInfoProto.UpQuickSoulEquipRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.UP_SOUL_EQUIP_QUICK_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.UpQuickSoulEquipRequest upQuickSoulEquipRequest) throws Exception {
|
||||
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
SoulEquip soulEquip = user.getEquipManager().getSoulEquipMap().get(upQuickSoulEquipRequest.getEquipId());
|
||||
if (null == soulEquip) {
|
||||
throw new Exception("装备不存在");
|
||||
}
|
||||
int addleve = 1;
|
||||
SEquipSign sEcfg = SEquipSign.getsEquipSignMap().get(soulEquip.getCfgId());
|
||||
if (null == sEcfg ) {
|
||||
throw new Exception("装备配置不存在" + soulEquip.getCfgId());
|
||||
}
|
||||
SEquipSign nextEcfg = SEquipSign.getsEquipSignMap().get(soulEquip.getCfgId()+addleve);
|
||||
if ( null == nextEcfg) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.UP_SOUL_EQUIP_RESPONSE_VALUE, "最高等级");
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> consumIds = new LinkedList<>();
|
||||
|
||||
int nextNeedExp = SEquipSign.getEquipExpMap().get(nextEcfg.getId());
|
||||
|
||||
int sumExp = soulEquip.getExp();
|
||||
int leve = soulEquip.getLevel();
|
||||
for (String equipId : upQuickSoulEquipRequest.getSoulEquipIdsList()) {
|
||||
SoulEquip equip = user.getEquipManager().getSoulEquipMap().get(equipId);
|
||||
if (null == equip || !StringUtil.isEmpty(equip.getHeroId())) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.UP_SOUL_EQUIP_RESPONSE_VALUE, "");
|
||||
return;
|
||||
}
|
||||
SEquipSign sEquipSign1 = SEquipSign.getsEquipSignMap().get(equip.getCfgId());
|
||||
if (null == sEquipSign1) {
|
||||
throw new Exception("装备配置不存在" + equip.getCfgId());
|
||||
}
|
||||
sumExp += sEquipSign1.getResolve();
|
||||
consumIds.add(equipId);
|
||||
if (sumExp > nextNeedExp) {
|
||||
leve+=1;
|
||||
addleve+=1;
|
||||
SEquipSign nextEcfg1 = SEquipSign.getsEquipSignMap().get(equip.getCfgId()+addleve);
|
||||
if (null == nextEcfg1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
consumIds.forEach(id->user.getEquipManager().removeSoulEquip(id));
|
||||
soulEquip.setExp(sumExp);
|
||||
soulEquip.setLevel(leve);
|
||||
HeroInfoProto.UpSoulEquipResponse.Builder builder = HeroInfoProto.UpSoulEquipResponse.newBuilder();
|
||||
builder.setExp(sumExp);
|
||||
builder.setLeve(leve);
|
||||
builder.addAllSoulEquipIds(consumIds);
|
||||
builder.setEquipId(upQuickSoulEquipRequest.getEquipId());
|
||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.UP_SOUL_EQUIP_RESPONSE_VALUE,builder.build(),true);
|
||||
}
|
||||
|
||||
}
|
|
@ -17,15 +17,21 @@ public class EquipManager extends MongoBase {
|
|||
|
||||
private Map<String,EspecialEquip> especialEquipMap;
|
||||
|
||||
private Map<String,SoulEquip> soulEquipMap;
|
||||
|
||||
private Equip unDetermined;
|
||||
|
||||
private Map<Integer,Integer> equipHandBook;
|
||||
|
||||
private int soulEquipPool;//占星装备卡池
|
||||
|
||||
public EquipManager() {
|
||||
|
||||
this.equipHandBook = new HashMap<>();
|
||||
this.equipMap = new HashMap<>();
|
||||
this.especialEquipMap = new HashMap<>();
|
||||
this.soulEquipMap = new HashMap<>();
|
||||
this.soulEquipPool = 1;
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
}
|
||||
|
||||
|
@ -47,8 +53,8 @@ public class EquipManager extends MongoBase {
|
|||
removeString(getMongoKey()+".especialEquipMap."+equip);
|
||||
especialEquipMap.remove(equip);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void remove(String equipId){
|
||||
if (equipMap.containsKey(equipId)){
|
||||
removeString(getMongoKey()+".equipMap." + equipId);
|
||||
|
@ -56,6 +62,18 @@ public class EquipManager extends MongoBase {
|
|||
}
|
||||
}
|
||||
|
||||
public void addSoulEquip(SoulEquip soulEquip){
|
||||
updateString("soulEquipMap." + soulEquip.getId(), soulEquip);
|
||||
soulEquipMap.put(soulEquip.getId(), soulEquip);
|
||||
}
|
||||
|
||||
public void removeSoulEquip(String id){
|
||||
if(soulEquipMap.containsKey(id)){
|
||||
removeString(getMongoKey()+".soulEquipMap." + id);
|
||||
soulEquipMap.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Equip> getEquipMap() {
|
||||
return equipMap;
|
||||
}
|
||||
|
@ -64,6 +82,10 @@ public class EquipManager extends MongoBase {
|
|||
return especialEquipMap;
|
||||
}
|
||||
|
||||
public Map<String, SoulEquip> getSoulEquipMap() {
|
||||
return soulEquipMap;
|
||||
}
|
||||
|
||||
public Equip getUnDetermined() {
|
||||
return unDetermined;
|
||||
}
|
||||
|
@ -80,6 +102,17 @@ public class EquipManager extends MongoBase {
|
|||
updateString("equipHandBook." + equipId, 0);
|
||||
}
|
||||
|
||||
public int getSoulEquipPool() {
|
||||
if (soulEquipPool==0)
|
||||
setSoulEquipPool(1);
|
||||
return soulEquipPool;
|
||||
}
|
||||
|
||||
public void setSoulEquipPool(int soulEquipPool) {
|
||||
updateString("soulEquipPool", soulEquipPool);
|
||||
this.soulEquipPool = soulEquipPool;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getEquipHandBook() {
|
||||
return equipHandBook;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,8 @@ public class Hero extends MongoBase {
|
|||
|
||||
private Map<Integer,String> equipByPositionMap;
|
||||
|
||||
private Map<Integer,String> soulEquipByPositionMap;
|
||||
|
||||
private int breakId;
|
||||
|
||||
private int starBreakId;
|
||||
|
@ -167,6 +169,26 @@ public class Hero extends MongoBase {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public Map<Integer, String> getSoulEquipByPositionMap() {
|
||||
return equipByPositionMap;
|
||||
}
|
||||
|
||||
public void updateSoulEquipPositionMap(int position,String equipId) throws Exception {
|
||||
updateString("soulEquipByPositionMap." + position ,equipId);
|
||||
this.soulEquipByPositionMap.put(position,equipId);
|
||||
}
|
||||
|
||||
public void removeSoulEquip(int position){
|
||||
String value = this.soulEquipByPositionMap.get(position);
|
||||
if (value!=null){
|
||||
removeString(getMongoKey()+".soulEquipByPositionMap." + position);
|
||||
this.soulEquipByPositionMap.remove(position);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getBreakId() {
|
||||
return breakId;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.util.KeyGenUtils;
|
||||
import com.ljsd.jieling.util.UUIDEnum;
|
||||
|
||||
/**
|
||||
* 魂印
|
||||
*/
|
||||
public class SoulEquip extends PropertyItem {
|
||||
|
||||
private int exp;
|
||||
|
||||
public SoulEquip(int uid, int equipTid) {
|
||||
super();
|
||||
super.setId(KeyGenUtils.produceIdByModule(UUIDEnum.SOUL_EQUIP, uid));
|
||||
super.setEquipId(equipTid);
|
||||
setLevel(1);
|
||||
}
|
||||
public SoulEquip() {
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
}
|
||||
|
||||
public int getExp() {
|
||||
return exp;
|
||||
}
|
||||
|
||||
public int getCfgId() {
|
||||
return getEquipId()*100+getLevel();
|
||||
}
|
||||
|
||||
public void setExp(int exp) {
|
||||
updateString("exp",exp);
|
||||
this.exp = exp;
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ import com.ljsd.jieling.core.HandlerLogicThread;
|
|||
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.activity.event.HeroUpStarEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
|
@ -91,7 +92,7 @@ public class HeroLogic {
|
|||
private static final String DIVISION = "#";
|
||||
|
||||
/**
|
||||
* 获取装备、法宝信息
|
||||
* 获取装备、法宝信息、魂印
|
||||
* @param iSession
|
||||
* @param index
|
||||
* @param type
|
||||
|
@ -106,12 +107,20 @@ public class HeroLogic {
|
|||
for(Equip equipInfo: equipMap.values()){
|
||||
equipList.add(CBean2Proto.getEquipProto(equipInfo));
|
||||
}
|
||||
}else{
|
||||
}else if(type==2){
|
||||
Map<String, EspecialEquip> especialEquipMap = user.getEquipManager().getEspecialEquipMap();
|
||||
for(EspecialEquip especialEquipInfo: especialEquipMap.values()){
|
||||
equipList.add(CBean2Proto.getEquipProto(especialEquipInfo));
|
||||
}
|
||||
}else if(type==3){
|
||||
//魂印
|
||||
Map<String, SoulEquip> stringSoulEquipMap = user.getEquipManager().getSoulEquipMap();
|
||||
for(SoulEquip soulEquip: stringSoulEquipMap.values()){
|
||||
equipList.add(CBean2Proto.getEquipProto(soulEquip));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
boolean isSendFinish = false;
|
||||
int endIndex = index + Global.SEND_EQUIP_COUNT;
|
||||
if (index < equipList.size()) {
|
||||
|
@ -1350,6 +1359,7 @@ public class HeroLogic {
|
|||
hero.updateEspecial(equipIds.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
// Map<Integer, Integer> heroNotBufferAttribute = calHeroNotBufferAttribute(user, hero);
|
||||
// int force = calForce(heroNotBufferAttribute) + heroNotBufferAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId());
|
||||
// LOGGER.info("the heroTid={},the force={}",hero.getTemplateId(),force);
|
||||
|
@ -1360,6 +1370,114 @@ public class HeroLogic {
|
|||
|
||||
}
|
||||
|
||||
|
||||
// 安装魂印
|
||||
public void wearSoulEquipOpt(ISession session,String heroId, List<HeroInfoProto.SoulEquipPos> equipIds) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
Hero hero = user.getHeroManager().getHeroMap().get(heroId);
|
||||
|
||||
if (hero == null || equipIds.isEmpty()) {
|
||||
MessageUtil.sendErrorResponse(session, 0, MessageTypeProto.MessageType.SOUL_EQUIP_WEAR_RESPONSE_VALUE, "");
|
||||
return;
|
||||
}
|
||||
|
||||
Map<Integer,Integer> currentType = new HashMap<>(); //pos2type
|
||||
|
||||
for (Map.Entry<Integer, String> entry: hero.getSoulEquipByPositionMap().entrySet()) {
|
||||
|
||||
SoulEquip equip = user.getEquipManager().getSoulEquipMap().get(entry.getValue());
|
||||
if(null == equip){
|
||||
throw new Exception("装备不存在" + entry.getValue());
|
||||
}
|
||||
SEquipSign cfg = SEquipSign.getsEquipSignMap().get(equip.getCfgId());
|
||||
if (null == cfg ) {
|
||||
throw new Exception("装备配置不存在" + equip.getCfgId());
|
||||
}
|
||||
currentType.put(entry.getKey(),cfg.getType());
|
||||
}
|
||||
|
||||
|
||||
//check same type
|
||||
//check pos 开启
|
||||
//条件不足 放过
|
||||
for (HeroInfoProto.SoulEquipPos soulEquipPos : equipIds) {
|
||||
if(!checkPosAccess(soulEquipPos.getPosition(),user,hero)){
|
||||
continue;
|
||||
}
|
||||
SoulEquip soulEquip = user.getEquipManager().getSoulEquipMap().get(soulEquipPos.getEquipId());
|
||||
if (null == soulEquip) {
|
||||
throw new Exception("装备不存在" + soulEquipPos.getEquipId());
|
||||
}
|
||||
SEquipSign cfg = SEquipSign.getsEquipSignMap().get(soulEquip.getCfgId());
|
||||
if (null == cfg ) {
|
||||
throw new Exception("装备配置不存在" + soulEquip.getCfgId());
|
||||
}
|
||||
|
||||
if(currentType.keySet().contains(soulEquipPos.getPosition())&¤tType.get(soulEquipPos.getEquipId())!=cfg.getType()){
|
||||
if(currentType.values().contains(cfg.getType())){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
currentType.put(soulEquipPos.getPosition(),cfg.getType());
|
||||
}
|
||||
|
||||
for (HeroInfoProto.SoulEquipPos soulEquipPos : equipIds) {
|
||||
hero.updateSoulEquipPositionMap(soulEquipPos.getPosition(),soulEquipPos.getEquipId());
|
||||
}
|
||||
|
||||
//发送成功消息
|
||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.SOUL_EQUIP_WEAR_RESPONSE_VALUE,null,true);
|
||||
|
||||
}
|
||||
|
||||
private boolean checkPosAccess(int pos, User user, Hero hero) throws Exception {
|
||||
|
||||
SEquipSignSetting cfg = STableManager.getConfig(SEquipSignSetting.class).get(pos);
|
||||
if (null == cfg) {
|
||||
return false;
|
||||
}
|
||||
if(user.getPlayerInfoManager().getLevel()<cfg.getOpenRules()[0]){
|
||||
return false;
|
||||
}
|
||||
if(hero.getStar()<cfg.getOpenRules()[1]){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void unloadSoulEquipOpt(ISession session, String heroId, List<HeroInfoProto.SoulEquipPos> equips) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
Hero hero = user.getHeroManager().getHero(heroId);
|
||||
|
||||
if( hero == null || equips.isEmpty()){
|
||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.SOUL_EQUIP_UNLOAD_OPT_REQUEST_VALUE,"");
|
||||
return;
|
||||
}
|
||||
List<Integer> positions = new ArrayList<>();
|
||||
for(HeroInfoProto.SoulEquipPos soulEquipPos : equips){
|
||||
|
||||
SoulEquip soulEquip = user.getEquipManager().getSoulEquipMap().get(soulEquipPos.getEquipId());
|
||||
if(null == soulEquip || StringUtil.isEmpty(soulEquip.getHeroId())){
|
||||
//未装备
|
||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.SOUL_EQUIP_UNLOAD_OPT_REQUEST_VALUE,"");
|
||||
return;
|
||||
}
|
||||
soulEquip.setHeroId("");
|
||||
positions.add(soulEquipPos.getPosition());
|
||||
}
|
||||
|
||||
for(Integer position : positions){
|
||||
hero.removeSoulEquip(position);
|
||||
}
|
||||
//发送成功消息
|
||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.SOUL_EQUIP_UNLOAD_OPT_REQUEST_VALUE,null,true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void unloadEquipOpt(ISession session,String heroId,List<String> equipIds,int type) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.ljsd.jieling.config.*;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.handler.map.MapManager;
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
|
@ -12,10 +13,7 @@ import com.ljsd.jieling.protocols.CommonProto;
|
|||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.ljsd.jieling.util.StringUtil;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -208,6 +206,36 @@ public class ItemLogic {
|
|||
sendUseAndPriceItemMessage(iSession, msgId, drop);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分解魂印
|
||||
* @param iSession
|
||||
* @param equipIdsList
|
||||
*/
|
||||
public void decomposeSoulEquip(ISession iSession, List<String> equipIdsList) throws Exception {
|
||||
int msgId = MessageTypeProto.MessageType.USER_AND_PRICE_ITEM_RESPONSE_VALUE;
|
||||
int uid = iSession.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
StringBuilder reward = new StringBuilder();
|
||||
String erroMags = checkSoulEquipResolve(equipIdsList,equipManager);
|
||||
if (!erroMags.isEmpty()){
|
||||
MessageUtil.sendErrorResponse(iSession,0,msgId,erroMags);
|
||||
return;
|
||||
}
|
||||
for (String equipId : equipIdsList) {
|
||||
SoulEquip soulEquip = equipManager.getSoulEquipMap().get(equipId);
|
||||
SItem sItem = SItem.getsItemMap().get(soulEquip.getEquipId());
|
||||
equipManager.remove(equipId);
|
||||
if (reward.length() == 0) {
|
||||
reward = new StringBuilder(sItem.getResolveReward());
|
||||
} else {
|
||||
reward.append("#").append(sItem.getResolveReward());
|
||||
}
|
||||
}
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user,StringUtil.parseFiledInt(reward.toString()),1,0,BIReason.DECOMPOS_EQUIP_REWARD);
|
||||
sendUseAndPriceItemMessage(iSession, msgId, drop);
|
||||
}
|
||||
|
||||
private String checkEquipResolve(List<String> equipIdsList,EquipManager equipManager) {
|
||||
if (equipIdsList.size() == 0){
|
||||
return "无可分解装备";
|
||||
|
@ -228,6 +256,27 @@ public class ItemLogic {
|
|||
return "";
|
||||
}
|
||||
|
||||
private String checkSoulEquipResolve(List<String> equipIdsList,EquipManager equipManager) {
|
||||
|
||||
if (equipIdsList.size() == 0){
|
||||
return "无可分解装备";
|
||||
}
|
||||
for (String equipId :equipIdsList){
|
||||
SoulEquip equip = equipManager.getSoulEquipMap().get(equipId);
|
||||
if (equip == null){
|
||||
return "无该装备";
|
||||
}
|
||||
if (!StringUtil.isEmpty(equip.getHeroId())){
|
||||
return "已穿戴";
|
||||
}
|
||||
SItem sItem = SItem.getsItemMap().get(equip.getEquipId());
|
||||
if (sItem.getIfResolve() ==0){
|
||||
return "不可分解";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分解卡牌|进阶消耗
|
||||
* @param iSession
|
||||
|
@ -442,4 +491,50 @@ public class ItemLogic {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 占星
|
||||
* @param session session
|
||||
* @param time 次数 50一档
|
||||
* @throws Exception
|
||||
*/
|
||||
public void soulEquipRand(ISession session,int time) throws Exception{
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
int currentPool = user.getEquipManager().getSoulEquipPool();
|
||||
|
||||
int[][] cost = time == 50 ? new int[1][]:new int[time][];
|
||||
int[] droplist = new int[time];
|
||||
for (int i = 0; i < time; i++) {
|
||||
SEquipTalismanaLottery lottery = STableManager.getConfig(SEquipTalismanaLottery.class).get(currentPool);
|
||||
if (null == lottery) {
|
||||
throw new Exception("SEquipTalismanaLottery 配置不存在" + currentPool);
|
||||
}
|
||||
droplist[i]=(MathUtils.randomFromWeight(lottery.getDrop()));
|
||||
currentPool = MathUtils.randomFromWeight(lottery.getProbability());
|
||||
if(time!=50){
|
||||
cost[i] = lottery.getCostItem();
|
||||
}
|
||||
}
|
||||
|
||||
boolean enoughCost = ItemUtil.itemCost(user, cost, BIReason.RANDOM_SOULEQUIP_CONSUME, 0);
|
||||
if (!enoughCost) {
|
||||
MessageUtil.sendErrorResponse(session, 0, MessageTypeProto.MessageType.SOUL_RAND_EQUIP_RESPONSE_VALUE, "道具不足");
|
||||
return;
|
||||
}
|
||||
|
||||
user.getEquipManager().setSoulEquipPool(currentPool);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, droplist,1,0,BIReason.RANDOM_SOULEQUIP);
|
||||
|
||||
HeroInfoProto.SoulRandResponse.Builder builder = HeroInfoProto.SoulRandResponse.newBuilder();
|
||||
builder.setDrop(drop);
|
||||
builder.setPos(currentPool);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.SOUL_RAND_EQUIP_RESPONSE_VALUE, builder.build(), true);
|
||||
|
||||
}
|
||||
|
||||
public static int getSoulCfgIdByEquipId(int equipId,int leve){
|
||||
return equipId*100+leve;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -100,6 +100,9 @@ public class QuestionLogic {
|
|||
user.getQuestionManager().setQuestId(0);
|
||||
user.getQuestionManager().setQuestState(0);
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
|
||||
if(null ==sessionByUid){
|
||||
return;
|
||||
}
|
||||
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.PLAYER_BACKCINFO_INDICATION_VALUE, builder, true);
|
||||
}
|
||||
}, new ArrayList<>(OnlineUserManager.sessionMap.keySet()), 120);
|
||||
|
|
|
@ -71,6 +71,16 @@ public class CBean2Proto {
|
|||
List<String> equipList = new ArrayList<>();
|
||||
if(equipByPositionMap!=null && !equipByPositionMap.isEmpty()){
|
||||
equipList.addAll(equipByPositionMap.values());
|
||||
}
|
||||
List<CommonProto.SoulPos> soulPoss = new ArrayList<>();
|
||||
Map<Integer, String> soulEquipMap = hero.getSoulEquipByPositionMap();
|
||||
if(soulEquipMap!=null&&!soulEquipMap.isEmpty()){
|
||||
for (Map.Entry<Integer,String> entry:soulEquipMap.entrySet()){
|
||||
CommonProto.SoulPos.Builder builder = CommonProto.SoulPos.newBuilder();
|
||||
builder.setEquipId(entry.getValue());
|
||||
builder.setPosition(entry.getKey());
|
||||
soulPoss.add(builder.build());
|
||||
}
|
||||
}
|
||||
return CommonProto.Hero
|
||||
.newBuilder()
|
||||
|
@ -84,6 +94,7 @@ public class CBean2Proto {
|
|||
.addAllSkillIdList(hero.getSkillList())
|
||||
.addAllEquipIdList(equipList)
|
||||
.addEspecialEquip(hero.getEspecialEquip())
|
||||
.addAllSoulPos(soulPoss)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -123,6 +134,10 @@ public class CBean2Proto {
|
|||
EspecialEquip tempEquip =(EspecialEquip)equip;
|
||||
equipProto.setRebuildLevel(tempEquip.getStar());
|
||||
}
|
||||
if(equip instanceof SoulEquip){
|
||||
equipProto.setRebuildLevel(((SoulEquip) equip).getLevel());
|
||||
equipProto.setExp(((SoulEquip) equip).getExp());
|
||||
}
|
||||
return equipProto.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -386,6 +386,7 @@ public class ItemUtil {
|
|||
break;
|
||||
case GlobalItemType.EQUIP:
|
||||
case GlobalItemType.ESPECIAL_EQUIP:
|
||||
case GlobalItemType.SOUL_MARK:
|
||||
putcountMap(itemId, itemNum, equipMap);
|
||||
break;
|
||||
case GlobalItemType.RANDOM_ITME:
|
||||
|
@ -408,7 +409,6 @@ public class ItemUtil {
|
|||
case GlobalItemType.HEAD_FRAME:
|
||||
case GlobalItemType.SecretBox:
|
||||
case GlobalItemType.CHANGE_NAME_CARD:
|
||||
case GlobalItemType.SOUL_MARK:
|
||||
itemType = GlobalItemType.ITEM;
|
||||
break;
|
||||
case GlobalItemType.RANDOM_ITME:
|
||||
|
@ -787,6 +787,9 @@ public class ItemUtil {
|
|||
}else if(itemType==GlobalItemType.ESPECIAL_EQUIP){
|
||||
EspecialEquip especialEquip = new EspecialEquip(user.getId(),equipId);
|
||||
equipManager.addEspecialEquip(user,especialEquip);
|
||||
}else if(itemType==GlobalItemType.SOUL_MARK){
|
||||
SoulEquip soulEquip = new SoulEquip(user.getId(),equipId);
|
||||
equipManager.addSoulEquip(soulEquip);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.ljsd.jieling.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @program: server
|
||||
|
@ -169,4 +171,18 @@ public class StringUtil {
|
|||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static Map<Integer,Integer> parsent2ToIntMap(int[][] value) {
|
||||
Map<Integer, Integer> result = new HashMap<>();
|
||||
int length = value.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
int[] item = value[i];
|
||||
if (item.length != 2) {
|
||||
continue;
|
||||
}
|
||||
result.put(item[0], item[1]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@ public enum UUIDEnum {
|
|||
ARENARECORD(3),
|
||||
ADVENTUREBOSS(4),
|
||||
GUILDLOG(5),
|
||||
ESPECIAL_EQUIP(6)
|
||||
ESPECIAL_EQUIP(6),
|
||||
SOUL_EQUIP(7)//魂印
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
|
Loading…
Reference in New Issue