Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
50c2758b5f
|
@ -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,12 @@ public class SSpecialConfig implements BaseConfig {
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
public static final String PHONE_BINDING = "Phone_Binding";
|
public static final String PHONE_BINDING = "Phone_Binding";
|
||||||
|
public static final String MANDATORY_ASTROLOGICAL = "Mandatory_Astrological";//强制占星跳到第四颗星
|
||||||
|
public static final String ARENA_RANKINGSHOWNUM = "Arena_RankingShowNum";//竞技场排行榜上榜显示排名
|
||||||
|
public static final String TRIAL_RANKINGSHOWNUM = "Trial_RankingShowNum";//试炼副本排行榜上榜显示排名
|
||||||
|
public static final String BEASTS_RANKINGSHOWNUM = "Beasts_RankingShowNum";//兽潮来袭排行榜上榜显示排名
|
||||||
|
public static final String ADVENTURE_RANKINGSHOWNUM = "Adventure_RankingShowNum";//外敌入侵排行榜上榜显示排名
|
||||||
|
public static final String COMBAT_RANKINGSHOWNUM = "Combat_RankingShowNum";//战力排行榜上榜显示排名
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
@ -38,7 +44,7 @@ public class SSpecialConfig implements BaseConfig {
|
||||||
|
|
||||||
public static int getIntegerValue(String key) {
|
public static int getIntegerValue(String key) {
|
||||||
String value = enumers.get(key);
|
String value = enumers.get(key);
|
||||||
if(value==null){
|
if (value == null) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return Integer.valueOf(value);
|
return Integer.valueOf(value);
|
||||||
|
|
|
@ -80,6 +80,9 @@ public interface BIReason {
|
||||||
int BIND_PHONE = 49; // 修改手机号
|
int BIND_PHONE = 49; // 修改手机号
|
||||||
|
|
||||||
int ENDLESS_REASON_CHANGE = 50;//无尽副本赛季更换
|
int ENDLESS_REASON_CHANGE = 50;//无尽副本赛季更换
|
||||||
|
int RANDOM_SOULEQUIP = 51;//占星
|
||||||
|
|
||||||
|
|
||||||
//道具消耗原因 1000开头
|
//道具消耗原因 1000开头
|
||||||
int ADVENTURE_UPLEVEL_CONSUME = 1000; //秘境升级
|
int ADVENTURE_UPLEVEL_CONSUME = 1000; //秘境升级
|
||||||
int SECRETBOX_CONSUME = 1001; //秘盒抽卡
|
int SECRETBOX_CONSUME = 1001; //秘盒抽卡
|
||||||
|
@ -141,4 +144,7 @@ public interface BIReason {
|
||||||
|
|
||||||
int ESPECIAL_EQUIP_UP_LEVEL_CONSUME = 1035;//法宝进阶消耗
|
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());
|
goodsTypeDurations.add(CommonProto.GoodsTypeDuration.newBuilder().setGoodsType(sRechargeCommodityConfig.getType()).setEndTime(goodsEndTime).build());
|
||||||
}
|
}
|
||||||
//问卷状态
|
//问卷状态
|
||||||
int questState =0;
|
int questState =-1;
|
||||||
if(user.getQuestionManager().getQuestId()!=0){
|
if(user.getQuestionManager().getQuestId()!=0){
|
||||||
questState=user.getQuestionManager().getQuestState();
|
questState=user.getQuestionManager().getQuestState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class UseAndPriceItemHandler extends BaseHandler {
|
public class UseAndPriceItemHandler extends BaseHandler<PlayerInfoProto.UseAndPriceItemRequest> {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(UseAndPriceItemHandler.class);
|
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;
|
return MessageTypeProto.MessageType.USER_AND_PRICE_ITEM_REQUEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
public void processWithProto(ISession iSession, PlayerInfoProto.UseAndPriceItemRequest useAndPriceItemRequest) throws Exception {
|
||||||
PlayerInfoProto.UseAndPriceItemRequest useAndPriceItemRequest
|
|
||||||
= PlayerInfoProto.UseAndPriceItemRequest.parseFrom(netData.parseClientProtoNetData());
|
|
||||||
int type = useAndPriceItemRequest.getType();
|
int type = useAndPriceItemRequest.getType();
|
||||||
List<CommonProto.Item> itemList = useAndPriceItemRequest.getItemsList();
|
List<CommonProto.Item> itemList = useAndPriceItemRequest.getItemsList();
|
||||||
List<String> equipIdsList = useAndPriceItemRequest.getEquipIdsList();
|
List<String> equipIdsList = useAndPriceItemRequest.getEquipIdsList();
|
||||||
|
@ -39,8 +38,10 @@ public class UseAndPriceItemHandler extends BaseHandler {
|
||||||
} else if(type==3){
|
} else if(type==3){
|
||||||
CommonProto.Drop.Builder baseBuilder =ItemLogic.getInstance().decomposeHero(iSession,heroIdsList,null, MessageTypeProto.MessageType.USER_AND_PRICE_ITEM_RESPONSE_VALUE);
|
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);
|
ItemLogic.sendUseAndPriceItemMessage(iSession, MessageTypeProto.MessageType.USER_AND_PRICE_ITEM_RESPONSE_VALUE, baseBuilder);
|
||||||
}else {//分解法宝
|
}else if(type==4){//分解法宝
|
||||||
ItemLogic.getInstance().decomposeEspecialEquip(iSession, equipIdsList);
|
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.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class EquipWearHandler extends BaseHandler{
|
public class EquipWearHandler extends BaseHandler<HeroInfoProto.EquipWearRequest> {
|
||||||
@Override
|
@Override
|
||||||
public MessageTypeProto.MessageType getMessageCode() {
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
return MessageTypeProto.MessageType.EQUIP_WEAR_REQUEST;
|
return MessageTypeProto.MessageType.EQUIP_WEAR_REQUEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
public void processWithProto(ISession iSession, HeroInfoProto.EquipWearRequest equipWearRequest) throws Exception {
|
||||||
HeroInfoProto.EquipWearRequest equipWearRequest = HeroInfoProto.EquipWearRequest.parseFrom(netData.parseClientProtoNetData());
|
|
||||||
HeroLogic.getInstance().wearEquipOpt(iSession,equipWearRequest.getHeroId(),equipWearRequest.getEquipIdList(),equipWearRequest.getType());
|
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.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
@ -8,17 +9,14 @@ import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class GetAllEquipHandler extends BaseHandler{
|
public class GetAllEquipHandler extends BaseHandler<HeroInfoProto.GetAllEquipRequest> {
|
||||||
@Override
|
@Override
|
||||||
public MessageTypeProto.MessageType getMessageCode() {
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
return MessageTypeProto.MessageType.GET_ALL_EQUIP_REQUEST;
|
return MessageTypeProto.MessageType.GET_ALL_EQUIP_REQUEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
public void processWithProto(ISession iSession, HeroInfoProto.GetAllEquipRequest getAllEquipRequest) throws Exception {
|
||||||
byte[] message = netData.parseClientProtoNetData();
|
|
||||||
HeroInfoProto.GetAllEquipRequest getAllEquipRequest
|
|
||||||
= HeroInfoProto.GetAllEquipRequest.parseFrom(message);
|
|
||||||
int index = getAllEquipRequest.getIndex();
|
int index = getAllEquipRequest.getIndex();
|
||||||
int type = getAllEquipRequest.getType();
|
int type = getAllEquipRequest.getType();
|
||||||
HeroLogic.getInstance().getAllEquipInfo(iSession,index,type);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2996,7 +2996,9 @@ public class MapLogic {
|
||||||
*/
|
*/
|
||||||
public void getTowerRank(ISession session,MessageTypeProto.MessageType messageType) throws Exception {
|
public void getTowerRank(ISession session,MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
User user = UserManager.getUser(session.getUid());
|
User user = UserManager.getUser(session.getUid());
|
||||||
Set<ZSetOperations.TypedTuple<String>> zsetreverseRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.TOWER_RANK, "", 0, 99);
|
|
||||||
|
int rankEndLine = SSpecialConfig.getIntegerValue(SSpecialConfig.TRIAL_RANKINGSHOWNUM);
|
||||||
|
Set<ZSetOperations.TypedTuple<String>> zsetreverseRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.TOWER_RANK, "", 0, rankEndLine);
|
||||||
Iterator<ZSetOperations.TypedTuple<String>> iterator = zsetreverseRangeWithScores.iterator();
|
Iterator<ZSetOperations.TypedTuple<String>> iterator = zsetreverseRangeWithScores.iterator();
|
||||||
MapInfoProto.TowerRankResponse.Builder response = MapInfoProto.TowerRankResponse.newBuilder();
|
MapInfoProto.TowerRankResponse.Builder response = MapInfoProto.TowerRankResponse.newBuilder();
|
||||||
int rank = 1;
|
int rank = 1;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ljsd.jieling.handler.monsterAttack;
|
package com.ljsd.jieling.handler.monsterAttack;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.config.SSpecialConfig;
|
||||||
import com.ljsd.jieling.db.redis.RedisKey;
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
@ -30,7 +31,8 @@ public class GetMonsterAttackRankHandler extends BaseHandler<PlayerInfoProto.Get
|
||||||
|
|
||||||
int start = 0;
|
int start = 0;
|
||||||
List<CommonProto.MonsterRankInfo> monsterRankInfos = new LinkedList<>();
|
List<CommonProto.MonsterRankInfo> monsterRankInfos = new LinkedList<>();
|
||||||
Set<ZSetOperations.TypedTuple<String>> rankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.MONSTER_ATTACK_RANK, "", 0, 100);
|
int rankEndLine = SSpecialConfig.getIntegerValue(SSpecialConfig.BEASTS_RANKINGSHOWNUM);
|
||||||
|
Set<ZSetOperations.TypedTuple<String>> rankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.MONSTER_ATTACK_RANK, "", 0, rankEndLine-1);
|
||||||
|
|
||||||
for (ZSetOperations.TypedTuple<String> item : rankInfo) {
|
for (ZSetOperations.TypedTuple<String> item : rankInfo) {
|
||||||
String value = item.getValue();
|
String value = item.getValue();
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.activity;
|
||||||
|
|
||||||
import com.ljsd.jieling.config.SActivityRewardConfig;
|
import com.ljsd.jieling.config.SActivityRewardConfig;
|
||||||
import com.ljsd.jieling.config.SErrorCodeEerverConfig;
|
import com.ljsd.jieling.config.SErrorCodeEerverConfig;
|
||||||
|
import com.ljsd.jieling.config.SSpecialConfig;
|
||||||
import com.ljsd.jieling.core.GlobalsDef;
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
import com.ljsd.jieling.db.redis.RedisKey;
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
|
@ -71,7 +72,8 @@ class ForceRankActivity extends AbstractActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<ZSetOperations.TypedTuple<String>> rankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.FORCE_RANK, "", 0, maxRank-1);
|
int rankEndLine = SSpecialConfig.getIntegerValue(SSpecialConfig.COMBAT_RANKINGSHOWNUM);
|
||||||
|
Set<ZSetOperations.TypedTuple<String>> rankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.FORCE_RANK, "", 0, rankEndLine-1);
|
||||||
int rank = 1;
|
int rank = 1;
|
||||||
int nowTime = (int) (TimeUtils.now() / 1000);
|
int nowTime = (int) (TimeUtils.now() / 1000);
|
||||||
for (ZSetOperations.TypedTuple<String> item : rankInfo) {
|
for (ZSetOperations.TypedTuple<String> item : rankInfo) {
|
||||||
|
|
|
@ -437,35 +437,39 @@ public class ArenaLogic {
|
||||||
}
|
}
|
||||||
int start = (page - 1) * 20, end = page * 20 - 1;
|
int start = (page - 1) * 20, end = page * 20 - 1;
|
||||||
List<CommonProto.ArenaEnemy> arenaRankMemberInfo = new ArrayList<>(20);
|
List<CommonProto.ArenaEnemy> arenaRankMemberInfo = new ArrayList<>(20);
|
||||||
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ARENA_RANK,Integer.toString(curSeason), start, end);
|
|
||||||
for(ZSetOperations.TypedTuple<String> item : arenaRankInfo){
|
int rankEndLine = SSpecialConfig.getIntegerValue(SSpecialConfig.ARENA_RANKINGSHOWNUM);
|
||||||
String value = item.getValue();
|
if(end<rankEndLine) {
|
||||||
int score =item.getScore().intValue();
|
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ARENA_RANK, Integer.toString(curSeason), start, end);
|
||||||
int uid = Integer.parseInt(value);
|
for (ZSetOperations.TypedTuple<String> item : arenaRankInfo) {
|
||||||
User user = UserManager.getUser(uid);
|
String value = item.getValue();
|
||||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE,false);
|
int score = item.getScore().intValue();
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE);
|
int uid = Integer.parseInt(value);
|
||||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
User user = UserManager.getUser(uid);
|
||||||
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE, false);
|
||||||
for(TeamPosHeroInfo teamPosHeroInfo:teamPosHeroInfoList){
|
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE);
|
||||||
heroTids.add(heroMap.get(teamPosHeroInfo.getHeroId()).getTemplateId());
|
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||||
|
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
||||||
|
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfoList) {
|
||||||
|
heroTids.add(heroMap.get(teamPosHeroInfo.getHeroId()).getTemplateId());
|
||||||
|
}
|
||||||
|
CommonProto.Team teamBuild = CommonProto.Team.newBuilder().addAllHeroTid(heroTids).build();
|
||||||
|
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||||
|
CommonProto.ArenaPersonInfo personInfoBuild = CommonProto.ArenaPersonInfo.newBuilder()
|
||||||
|
.setUid(uid)
|
||||||
|
.setLevel(playerInfoManager.getLevel())
|
||||||
|
.setName(playerInfoManager.getNickName())
|
||||||
|
.setScore(score)
|
||||||
|
.setHead(0)
|
||||||
|
.setRank(++start)
|
||||||
|
.setTotalForce(totalForce)
|
||||||
|
.setHeadFrame(playerInfoManager.getHeadFrame())
|
||||||
|
.build();
|
||||||
|
arenaRankMemberInfo.add(CommonProto.ArenaEnemy.newBuilder()
|
||||||
|
.setPersonInfo(personInfoBuild)
|
||||||
|
.setTeam(teamBuild)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
CommonProto.Team teamBuild = CommonProto.Team.newBuilder().addAllHeroTid(heroTids).build();
|
|
||||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
|
||||||
CommonProto.ArenaPersonInfo personInfoBuild = CommonProto.ArenaPersonInfo.newBuilder()
|
|
||||||
.setUid(uid)
|
|
||||||
.setLevel(playerInfoManager.getLevel())
|
|
||||||
.setName(playerInfoManager.getNickName())
|
|
||||||
.setScore(score)
|
|
||||||
.setHead(0)
|
|
||||||
.setRank(++start)
|
|
||||||
.setTotalForce(totalForce)
|
|
||||||
.setHeadFrame(playerInfoManager.getHeadFrame())
|
|
||||||
.build();
|
|
||||||
arenaRankMemberInfo.add(CommonProto.ArenaEnemy.newBuilder()
|
|
||||||
.setPersonInfo(personInfoBuild)
|
|
||||||
.setTeam(teamBuild)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
int uid = session.getUid();
|
int uid = session.getUid();
|
||||||
int score = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason), Integer.toString(uid)).intValue();
|
int score = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason), Integer.toString(uid)).intValue();
|
||||||
|
|
|
@ -17,15 +17,21 @@ public class EquipManager extends MongoBase {
|
||||||
|
|
||||||
private Map<String,EspecialEquip> especialEquipMap;
|
private Map<String,EspecialEquip> especialEquipMap;
|
||||||
|
|
||||||
|
private Map<String,SoulEquip> soulEquipMap;
|
||||||
|
|
||||||
private Equip unDetermined;
|
private Equip unDetermined;
|
||||||
|
|
||||||
private Map<Integer,Integer> equipHandBook;
|
private Map<Integer,Integer> equipHandBook;
|
||||||
|
|
||||||
|
private int soulEquipPool;//占星装备卡池
|
||||||
|
|
||||||
public EquipManager() {
|
public EquipManager() {
|
||||||
|
|
||||||
this.equipHandBook = new HashMap<>();
|
this.equipHandBook = new HashMap<>();
|
||||||
this.equipMap = new HashMap<>();
|
this.equipMap = new HashMap<>();
|
||||||
this.especialEquipMap = new HashMap<>();
|
this.especialEquipMap = new HashMap<>();
|
||||||
|
this.soulEquipMap = new HashMap<>();
|
||||||
|
this.soulEquipPool = 1;
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,8 +53,8 @@ public class EquipManager extends MongoBase {
|
||||||
removeString(getMongoKey()+".especialEquipMap."+equip);
|
removeString(getMongoKey()+".especialEquipMap."+equip);
|
||||||
especialEquipMap.remove(equip);
|
especialEquipMap.remove(equip);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(String equipId){
|
public void remove(String equipId){
|
||||||
if (equipMap.containsKey(equipId)){
|
if (equipMap.containsKey(equipId)){
|
||||||
removeString(getMongoKey()+".equipMap." + 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() {
|
public Map<String, Equip> getEquipMap() {
|
||||||
return equipMap;
|
return equipMap;
|
||||||
}
|
}
|
||||||
|
@ -64,6 +82,10 @@ public class EquipManager extends MongoBase {
|
||||||
return especialEquipMap;
|
return especialEquipMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, SoulEquip> getSoulEquipMap() {
|
||||||
|
return soulEquipMap;
|
||||||
|
}
|
||||||
|
|
||||||
public Equip getUnDetermined() {
|
public Equip getUnDetermined() {
|
||||||
return unDetermined;
|
return unDetermined;
|
||||||
}
|
}
|
||||||
|
@ -80,6 +102,17 @@ public class EquipManager extends MongoBase {
|
||||||
updateString("equipHandBook." + equipId, 0);
|
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() {
|
public Map<Integer, Integer> getEquipHandBook() {
|
||||||
return equipHandBook;
|
return equipHandBook;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ public class Hero extends MongoBase {
|
||||||
|
|
||||||
private Map<Integer,String> equipByPositionMap;
|
private Map<Integer,String> equipByPositionMap;
|
||||||
|
|
||||||
|
private Map<Integer,String> soulEquipByPositionMap;
|
||||||
|
|
||||||
private int breakId;
|
private int breakId;
|
||||||
|
|
||||||
private int starBreakId;
|
private int starBreakId;
|
||||||
|
@ -59,6 +61,7 @@ public class Hero extends MongoBase {
|
||||||
this.star = initStar;
|
this.star = initStar;
|
||||||
this.skillList = new ArrayList<>();
|
this.skillList = new ArrayList<>();
|
||||||
this.equipByPositionMap = new HashMap<>();
|
this.equipByPositionMap = new HashMap<>();
|
||||||
|
this.soulEquipByPositionMap = new HashMap<>();
|
||||||
this.especialEquip = "";
|
this.especialEquip = "";
|
||||||
List<Integer> skillIds = scHero.getSkillListByStar().get(star);
|
List<Integer> skillIds = scHero.getSkillListByStar().get(star);
|
||||||
if(skillIds!=null && !skillIds.isEmpty()){
|
if(skillIds!=null && !skillIds.isEmpty()){
|
||||||
|
@ -167,6 +170,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() {
|
public int getBreakId() {
|
||||||
return breakId;
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -831,13 +831,17 @@ public class CombatLogic {
|
||||||
int myuid = session.getUid();
|
int myuid = session.getUid();
|
||||||
int start = (page - 1) * 20, end = page * 20 - 1;
|
int start = (page - 1) * 20, end = page * 20 - 1;
|
||||||
List<CommonProto.AdventureRankItemInfo> adventureRankItemInfos = new ArrayList<>(20);
|
List<CommonProto.AdventureRankItemInfo> adventureRankItemInfos = new ArrayList<>(20);
|
||||||
Set<ZSetOperations.TypedTuple<String>> adventureBossRankInfo= RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ADVENTRUEN_BOSS_RANK,"", start, end);
|
|
||||||
for(ZSetOperations.TypedTuple<String> item : adventureBossRankInfo){
|
int rankEndLine = SSpecialConfig.getIntegerValue(SSpecialConfig.ADVENTURE_RANKINGSHOWNUM);
|
||||||
String value = item.getValue();
|
if(end<rankEndLine){
|
||||||
int score =item.getScore().intValue();
|
Set<ZSetOperations.TypedTuple<String>> adventureBossRankInfo= RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ADVENTRUEN_BOSS_RANK,"", start, end);
|
||||||
int uid = Integer.parseInt(value);
|
for(ZSetOperations.TypedTuple<String> item : adventureBossRankInfo){
|
||||||
User user = UserManager.getUser(uid);
|
String value = item.getValue();
|
||||||
adventureRankItemInfos.add(CBean2Proto.getAdventureRankItemInfo(uid,user,score,++start));
|
int score =item.getScore().intValue();
|
||||||
|
int uid = Integer.parseInt(value);
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
adventureRankItemInfos.add(CBean2Proto.getAdventureRankItemInfo(uid,user,score,++start));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int score = RedisUtil.getInstence().getZSetScore(RedisKey.ADVENTRUEN_BOSS_RANK,"", Integer.toString(myuid)).intValue();
|
int score = RedisUtil.getInstence().getZSetScore(RedisKey.ADVENTRUEN_BOSS_RANK,"", Integer.toString(myuid)).intValue();
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.ljsd.jieling.core.HandlerLogicThread;
|
||||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
|
import com.ljsd.jieling.logic.STableManager;
|
||||||
import com.ljsd.jieling.handler.map.EndlessHero;
|
import com.ljsd.jieling.handler.map.EndlessHero;
|
||||||
import com.ljsd.jieling.logic.activity.event.HeroUpStarEvent;
|
import com.ljsd.jieling.logic.activity.event.HeroUpStarEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
|
@ -92,7 +93,7 @@ public class HeroLogic {
|
||||||
private static final String DIVISION = "#";
|
private static final String DIVISION = "#";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取装备、法宝信息
|
* 获取装备、法宝信息、魂印
|
||||||
* @param iSession
|
* @param iSession
|
||||||
* @param index
|
* @param index
|
||||||
* @param type
|
* @param type
|
||||||
|
@ -107,12 +108,20 @@ public class HeroLogic {
|
||||||
for(Equip equipInfo: equipMap.values()){
|
for(Equip equipInfo: equipMap.values()){
|
||||||
equipList.add(CBean2Proto.getEquipProto(equipInfo));
|
equipList.add(CBean2Proto.getEquipProto(equipInfo));
|
||||||
}
|
}
|
||||||
}else{
|
}else if(type==2){
|
||||||
Map<String, EspecialEquip> especialEquipMap = user.getEquipManager().getEspecialEquipMap();
|
Map<String, EspecialEquip> especialEquipMap = user.getEquipManager().getEspecialEquipMap();
|
||||||
for(EspecialEquip especialEquipInfo: especialEquipMap.values()){
|
for(EspecialEquip especialEquipInfo: especialEquipMap.values()){
|
||||||
equipList.add(CBean2Proto.getEquipProto(especialEquipInfo));
|
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;
|
boolean isSendFinish = false;
|
||||||
int endIndex = index + Global.SEND_EQUIP_COUNT;
|
int endIndex = index + Global.SEND_EQUIP_COUNT;
|
||||||
if (index < equipList.size()) {
|
if (index < equipList.size()) {
|
||||||
|
@ -1361,6 +1370,7 @@ public class HeroLogic {
|
||||||
hero.updateEspecial(equipIds.get(0));
|
hero.updateEspecial(equipIds.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map<Integer, Integer> heroNotBufferAttribute = calHeroNotBufferAttribute(user, hero);
|
// Map<Integer, Integer> heroNotBufferAttribute = calHeroNotBufferAttribute(user, hero);
|
||||||
// int force = calForce(heroNotBufferAttribute) + heroNotBufferAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId());
|
// int force = calForce(heroNotBufferAttribute) + heroNotBufferAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId());
|
||||||
// LOGGER.info("the heroTid={},the force={}",hero.getTemplateId(),force);
|
// LOGGER.info("the heroTid={},the force={}",hero.getTemplateId(),force);
|
||||||
|
@ -1371,6 +1381,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 {
|
public void unloadEquipOpt(ISession session,String heroId,List<String> equipIds,int type) throws Exception {
|
||||||
int uid = session.getUid();
|
int uid = session.getUid();
|
||||||
User user = UserManager.getUser(uid);
|
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.BIReason;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
import com.ljsd.jieling.handler.map.MapManager;
|
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.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
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.HeroInfoProto;
|
||||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||||
import com.ljsd.jieling.util.CBean2Proto;
|
import com.ljsd.jieling.util.*;
|
||||||
import com.ljsd.jieling.util.ItemUtil;
|
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
|
||||||
import com.ljsd.jieling.util.StringUtil;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -208,6 +206,36 @@ public class ItemLogic {
|
||||||
sendUseAndPriceItemMessage(iSession, msgId, drop);
|
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.removeSoulEquip(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) {
|
private String checkEquipResolve(List<String> equipIdsList,EquipManager equipManager) {
|
||||||
if (equipIdsList.size() == 0){
|
if (equipIdsList.size() == 0){
|
||||||
return "无可分解装备";
|
return "无可分解装备";
|
||||||
|
@ -228,6 +256,27 @@ public class ItemLogic {
|
||||||
return "";
|
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
|
* @param iSession
|
||||||
|
@ -443,4 +492,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().setQuestId(0);
|
||||||
user.getQuestionManager().setQuestState(0);
|
user.getQuestionManager().setQuestState(0);
|
||||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
|
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
|
||||||
|
if(null ==sessionByUid){
|
||||||
|
return;
|
||||||
|
}
|
||||||
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.PLAYER_BACKCINFO_INDICATION_VALUE, builder, true);
|
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.PLAYER_BACKCINFO_INDICATION_VALUE, builder, true);
|
||||||
}
|
}
|
||||||
}, new ArrayList<>(OnlineUserManager.sessionMap.keySet()), 120);
|
}, new ArrayList<>(OnlineUserManager.sessionMap.keySet()), 120);
|
||||||
|
|
|
@ -71,6 +71,16 @@ public class CBean2Proto {
|
||||||
List<String> equipList = new ArrayList<>();
|
List<String> equipList = new ArrayList<>();
|
||||||
if(equipByPositionMap!=null && !equipByPositionMap.isEmpty()){
|
if(equipByPositionMap!=null && !equipByPositionMap.isEmpty()){
|
||||||
equipList.addAll(equipByPositionMap.values());
|
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
|
return CommonProto.Hero
|
||||||
.newBuilder()
|
.newBuilder()
|
||||||
|
@ -84,6 +94,7 @@ public class CBean2Proto {
|
||||||
.addAllSkillIdList(hero.getSkillList())
|
.addAllSkillIdList(hero.getSkillList())
|
||||||
.addAllEquipIdList(equipList)
|
.addAllEquipIdList(equipList)
|
||||||
.addEspecialEquip(hero.getEspecialEquip())
|
.addEspecialEquip(hero.getEspecialEquip())
|
||||||
|
.addAllSoulPos(soulPoss)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,6 +134,10 @@ public class CBean2Proto {
|
||||||
EspecialEquip tempEquip =(EspecialEquip)equip;
|
EspecialEquip tempEquip =(EspecialEquip)equip;
|
||||||
equipProto.setRebuildLevel(tempEquip.getStar());
|
equipProto.setRebuildLevel(tempEquip.getStar());
|
||||||
}
|
}
|
||||||
|
if(equip instanceof SoulEquip){
|
||||||
|
equipProto.setRebuildLevel(((SoulEquip) equip).getLevel());
|
||||||
|
equipProto.setExp(((SoulEquip) equip).getExp());
|
||||||
|
}
|
||||||
return equipProto.build();
|
return equipProto.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -386,6 +386,7 @@ public class ItemUtil {
|
||||||
break;
|
break;
|
||||||
case GlobalItemType.EQUIP:
|
case GlobalItemType.EQUIP:
|
||||||
case GlobalItemType.ESPECIAL_EQUIP:
|
case GlobalItemType.ESPECIAL_EQUIP:
|
||||||
|
case GlobalItemType.SOUL_MARK:
|
||||||
putcountMap(itemId, itemNum, equipMap);
|
putcountMap(itemId, itemNum, equipMap);
|
||||||
break;
|
break;
|
||||||
case GlobalItemType.RANDOM_ITME:
|
case GlobalItemType.RANDOM_ITME:
|
||||||
|
@ -408,7 +409,6 @@ public class ItemUtil {
|
||||||
case GlobalItemType.HEAD_FRAME:
|
case GlobalItemType.HEAD_FRAME:
|
||||||
case GlobalItemType.SecretBox:
|
case GlobalItemType.SecretBox:
|
||||||
case GlobalItemType.CHANGE_NAME_CARD:
|
case GlobalItemType.CHANGE_NAME_CARD:
|
||||||
case GlobalItemType.SOUL_MARK:
|
|
||||||
itemType = GlobalItemType.ITEM;
|
itemType = GlobalItemType.ITEM;
|
||||||
break;
|
break;
|
||||||
case GlobalItemType.RANDOM_ITME:
|
case GlobalItemType.RANDOM_ITME:
|
||||||
|
@ -790,6 +790,9 @@ public class ItemUtil {
|
||||||
EspecialEquip especialEquip = new EspecialEquip(user.getId(),equipId);
|
EspecialEquip especialEquip = new EspecialEquip(user.getId(),equipId);
|
||||||
especialEquipList.add(CBean2Proto.getEquipProto(especialEquip));
|
especialEquipList.add(CBean2Proto.getEquipProto(especialEquip));
|
||||||
equipManager.addEspecialEquip(user,especialEquip);
|
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;
|
package com.ljsd.jieling.util;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: server
|
* @program: server
|
||||||
|
@ -169,4 +171,18 @@ public class StringUtil {
|
||||||
}
|
}
|
||||||
return sb.toString();
|
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),
|
ARENARECORD(3),
|
||||||
ADVENTUREBOSS(4),
|
ADVENTUREBOSS(4),
|
||||||
GUILDLOG(5),
|
GUILDLOG(5),
|
||||||
ESPECIAL_EQUIP(6)
|
ESPECIAL_EQUIP(6),
|
||||||
|
SOUL_EQUIP(7)//魂印
|
||||||
;
|
;
|
||||||
|
|
||||||
private int value;
|
private int value;
|
||||||
|
|
Loading…
Reference in New Issue