back_recharge
wangyuan 2019-02-19 20:46:06 +08:00
parent 53ead12c3e
commit 4b324dbd2b
6 changed files with 108 additions and 89 deletions

View File

@ -1,15 +1,15 @@
Id Quality ProfessionLimit Position PropertyMin PropertyMax Pool SecondNumMin SecondNumMax SkillId IfClear Id Quality ProfessionLimit Position PropertyMin PropertyMax Pool SecondNumMin SecondNumMax SkillId IfClear
int int int int mut,int#int,1 mut,int#int,1 int int int int int int int int int mut,int#int,1 mut,int#int,1 int int int int int
3001 1 1501 1 2#42 2#70 1 0 0 0 0 3001 1 3 1 2#42 2#70 1 0 0 0 0
3002 1 1501 1 2#42 2#70 1 0 0 0 0 3002 1 3 1 2#42 2#70 1 0 0 0 0
3003 1 1502 1 2#42 2#70 1 0 0 0 0 3003 1 5 1 2#42 2#70 1 0 0 0 0
3004 1 1502 1 2#42 2#70 1 0 0 0 0 3004 1 5 1 2#42 2#70 1 0 0 0 0
3005 1 1503 1 2#42 2#70 1 0 0 0 0 3005 1 1 1 2#42 2#70 1 0 0 0 0
3006 1 1503 1 2#42 2#70 1 0 0 0 0 3006 1 1 1 2#42 2#70 1 0 0 0 0
3007 1 1504 1 2#42 2#70 1 0 0 0 0 3007 1 2 1 2#42 2#70 1 0 0 0 0
3008 1 1504 1 2#42 2#70 1 0 0 0 0 3008 1 2 1 2#42 2#70 1 0 0 0 0
3009 1 1505 1 2#42 2#70 1 0 0 0 0 3009 1 4 1 2#42 2#70 1 0 0 0 0
3010 1 1505 1 2#42 2#70 1 0 0 0 0 3010 1 4 1 2#42 2#70 1 0 0 0 0
3011 1 0 2 3#43 3#72 1 0 0 0 0 3011 1 0 2 3#43 3#72 1 0 0 0 0
3012 1 0 2 3#43 3#72 1 0 0 0 0 3012 1 0 2 3#43 3#72 1 0 0 0 0
3013 1 0 2 4#40 4#67 1 0 0 0 0 3013 1 0 2 4#40 4#67 1 0 0 0 0
@ -18,16 +18,16 @@ int int int int mut,int#int,1 mut,int#int,1 int int int int int
3016 1 0 4 5#24 5#28 1 0 0 0 0 3016 1 0 4 5#24 5#28 1 0 0 0 0
3017 1 0 3 1#460 1#767 1 0 0 0 0 3017 1 0 3 1#460 1#767 1 0 0 0 0
3018 1 0 3 1#460 1#767 1 0 0 0 0 3018 1 0 3 1#460 1#767 1 0 0 0 0
3101 2 1501 1 2#56 2#93 1 0 1 0 0 3101 2 3 1 2#56 2#93 1 0 1 0 0
3102 2 1501 1 2#56 2#93 1 0 1 0 0 3102 2 3 1 2#56 2#93 1 0 1 0 0
3103 2 1502 1 2#56 2#93 1 0 1 0 0 3103 2 5 1 2#56 2#93 1 0 1 0 0
3104 2 1502 1 2#56 2#93 1 0 1 0 0 3104 2 5 1 2#56 2#93 1 0 1 0 0
3105 2 1503 1 2#56 2#93 1 0 1 0 0 3105 2 1 1 2#56 2#93 1 0 1 0 0
3106 2 1503 1 2#56 2#93 1 0 1 0 0 3106 2 1 1 2#56 2#93 1 0 1 0 0
3107 2 1504 1 2#56 2#93 1 0 1 0 0 3107 2 2 1 2#56 2#93 1 0 1 0 0
3108 2 1504 1 2#56 2#93 1 0 1 0 0 3108 2 2 1 2#56 2#93 1 0 1 0 0
3109 2 1505 1 2#56 2#93 1 0 1 0 0 3109 2 4 1 2#56 2#93 1 0 1 0 0
3110 2 1505 1 2#56 2#93 1 0 1 0 0 3110 2 4 1 2#56 2#93 1 0 1 0 0
3111 2 0 2 3#58 3#96 2 0 1 0 0 3111 2 0 2 3#58 3#96 2 0 1 0 0
3112 2 0 2 3#58 3#96 2 0 1 0 0 3112 2 0 2 3#58 3#96 2 0 1 0 0
3113 2 0 2 4#54 4#90 2 0 1 0 0 3113 2 0 2 4#54 4#90 2 0 1 0 0
@ -36,16 +36,16 @@ int int int int mut,int#int,1 mut,int#int,1 int int int int int
3116 2 0 4 5#48 5#56 3 0 1 0 0 3116 2 0 4 5#48 5#56 3 0 1 0 0
3117 2 0 3 1#616 1#1027 4 0 1 0 0 3117 2 0 3 1#616 1#1027 4 0 1 0 0
3118 2 0 3 1#616 1#1027 4 0 1 0 0 3118 2 0 3 1#616 1#1027 4 0 1 0 0
3201 3 1501 1 2#72 2#120 5 1 3 0 1 3201 3 3 1 2#72 2#120 5 1 3 0 1
3202 3 1501 1 2#72 2#120 5 1 3 0 1 3202 3 3 1 2#72 2#120 5 1 3 0 1
3203 3 1502 1 2#72 2#120 5 1 3 0 1 3203 3 5 1 2#72 2#120 5 1 3 0 1
3204 3 1502 1 2#72 2#120 5 1 3 0 1 3204 3 5 1 2#72 2#120 5 1 3 0 1
3205 3 1503 1 2#72 2#120 5 1 3 0 1 3205 3 1 1 2#72 2#120 5 1 3 0 1
3206 3 1503 1 2#72 2#120 5 1 3 0 1 3206 3 1 1 2#72 2#120 5 1 3 0 1
3207 3 1504 1 2#72 2#120 5 1 3 0 1 3207 3 2 1 2#72 2#120 5 1 3 0 1
3208 3 1504 1 2#72 2#120 5 1 3 0 1 3208 3 2 1 2#72 2#120 5 1 3 0 1
3209 3 1505 1 2#72 2#120 5 1 3 0 1 3209 3 4 1 2#72 2#120 5 1 3 0 1
3210 3 1505 1 2#72 2#120 5 1 3 0 1 3210 3 4 1 2#72 2#120 5 1 3 0 1
3211 3 0 2 3#74 3#124 6 1 3 0 1 3211 3 0 2 3#74 3#124 6 1 3 0 1
3212 3 0 2 3#74 3#124 6 1 3 0 1 3212 3 0 2 3#74 3#124 6 1 3 0 1
3213 3 0 2 4#70 4#116 6 1 3 0 1 3213 3 0 2 4#70 4#116 6 1 3 0 1
@ -54,16 +54,16 @@ int int int int mut,int#int,1 mut,int#int,1 int int int int int
3216 3 0 4 5#72 5#84 7 1 3 0 1 3216 3 0 4 5#72 5#84 7 1 3 0 1
3217 3 0 3 1#792 1#1320 8 1 3 0 1 3217 3 0 3 1#792 1#1320 8 1 3 0 1
3218 3 0 3 1#792 1#1320 8 1 3 0 1 3218 3 0 3 1#792 1#1320 8 1 3 0 1
3301 4 1501 1 2#383 2#638 9 2 4 0 1 3301 4 3 1 2#383 2#638 9 2 4 0 1
3302 4 1501 1 2#383 2#638 9 2 4 0 1 3302 4 3 1 2#383 2#638 9 2 4 0 1
3303 4 1502 1 2#383 2#638 9 2 4 0 1 3303 4 5 1 2#383 2#638 9 2 4 0 1
3304 4 1502 1 2#383 2#638 9 2 4 0 1 3304 4 5 1 2#383 2#638 9 2 4 0 1
3305 4 1503 1 2#383 2#638 9 2 4 0 1 3305 4 1 1 2#383 2#638 9 2 4 0 1
3306 4 1503 1 2#383 2#638 9 2 4 0 1 3306 4 1 1 2#383 2#638 9 2 4 0 1
3307 4 1504 1 2#383 2#638 9 2 4 0 1 3307 4 2 1 2#383 2#638 9 2 4 0 1
3308 4 1504 1 2#383 2#638 9 2 4 0 1 3308 4 2 1 2#383 2#638 9 2 4 0 1
3309 4 1505 1 2#383 2#638 9 2 4 0 1 3309 4 4 1 2#383 2#638 9 2 4 0 1
3310 4 1505 1 2#383 2#638 9 2 4 0 1 3310 4 4 1 2#383 2#638 9 2 4 0 1
3311 4 0 2 3#396 3#659 10 2 4 0 1 3311 4 0 2 3#396 3#659 10 2 4 0 1
3312 4 0 2 3#396 3#659 10 2 4 0 1 3312 4 0 2 3#396 3#659 10 2 4 0 1
3313 4 0 2 4#370 4#617 10 2 4 0 1 3313 4 0 2 4#370 4#617 10 2 4 0 1
@ -72,16 +72,16 @@ int int int int mut,int#int,1 mut,int#int,1 int int int int int
3316 4 0 4 5#96 5#113 11 2 4 0 1 3316 4 0 4 5#96 5#113 11 2 4 0 1
3317 4 0 3 1#4212 1#7020 12 2 4 0 1 3317 4 0 3 1#4212 1#7020 12 2 4 0 1
3318 4 0 3 1#4212 1#7020 12 2 4 0 1 3318 4 0 3 1#4212 1#7020 12 2 4 0 1
3319 4 1501 1 2#383 2#638 9 2 4 0 1 3319 4 3 1 2#383 2#638 9 2 4 0 1
3320 4 1501 1 2#383 2#638 9 2 4 0 1 3320 4 3 1 2#383 2#638 9 2 4 0 1
3321 4 1502 1 2#383 2#638 9 2 4 0 1 3321 4 5 1 2#383 2#638 9 2 4 0 1
3322 4 1502 1 2#383 2#638 9 2 4 0 1 3322 4 5 1 2#383 2#638 9 2 4 0 1
3323 4 1503 1 2#383 2#638 9 2 4 0 1 3323 4 1 1 2#383 2#638 9 2 4 0 1
3324 4 1503 1 2#383 2#638 9 2 4 0 1 3324 4 1 1 2#383 2#638 9 2 4 0 1
3325 4 1504 1 2#383 2#638 9 2 4 0 1 3325 4 2 1 2#383 2#638 9 2 4 0 1
3326 4 1504 1 2#383 2#638 9 2 4 0 1 3326 4 2 1 2#383 2#638 9 2 4 0 1
3327 4 1505 1 2#383 2#638 9 2 4 0 1 3327 4 4 1 2#383 2#638 9 2 4 0 1
3328 4 1505 1 2#383 2#638 9 2 4 0 1 3328 4 4 1 2#383 2#638 9 2 4 0 1
3329 4 0 2 3#396 3#659 10 2 4 0 1 3329 4 0 2 3#396 3#659 10 2 4 0 1
3330 4 0 2 3#396 3#659 10 2 4 0 1 3330 4 0 2 3#396 3#659 10 2 4 0 1
3331 4 0 2 4#370 4#617 10 2 4 0 1 3331 4 0 2 4#370 4#617 10 2 4 0 1
@ -90,25 +90,25 @@ int int int int mut,int#int,1 mut,int#int,1 int int int int int
3334 4 0 4 5#96 5#113 11 2 4 0 1 3334 4 0 4 5#96 5#113 11 2 4 0 1
3335 4 0 3 1#4212 1#7020 12 2 4 0 1 3335 4 0 3 1#4212 1#7020 12 2 4 0 1
3336 4 0 3 1#4212 1#7020 12 2 4 0 1 3336 4 0 3 1#4212 1#7020 12 2 4 0 1
4001 3 1501 1 2#72 2#120 5 1 3 0 0 4001 3 3 1 2#72 2#120 5 1 3 0 0
4002 3 1502 1 2#72 2#120 5 1 3 0 0 4002 3 5 1 2#72 2#120 5 1 3 0 0
4003 3 1503 1 2#72 2#120 5 1 3 0 0 4003 3 1 1 2#72 2#120 5 1 3 0 0
4004 3 1504 1 2#72 2#120 5 1 3 0 0 4004 3 2 1 2#72 2#120 5 1 3 0 0
4005 3 1505 1 2#72 2#120 5 1 3 0 0 4005 3 4 1 2#72 2#120 5 1 3 0 0
4006 3 0 2 3#74 3#124 6 1 3 0 0 4006 3 0 2 3#74 3#124 6 1 3 0 0
4007 3 0 2 4#70 4#116 6 1 3 0 0 4007 3 0 2 4#70 4#116 6 1 3 0 0
4008 3 0 4 5#72 5#84 7 1 3 0 0 4008 3 0 4 5#72 5#84 7 1 3 0 0
4009 3 0 3 1#792 1#1320 8 1 3 0 0 4009 3 0 3 1#792 1#1320 8 1 3 0 0
4101 4 1501 1 2#383 2#638 9 2 4 0 0 4101 4 3 1 2#383 2#638 9 2 4 0 0
4102 4 1501 1 2#383 2#638 9 2 4 0 0 4102 4 3 1 2#383 2#638 9 2 4 0 0
4103 4 1502 1 2#383 2#638 9 2 4 0 0 4103 4 5 1 2#383 2#638 9 2 4 0 0
4104 4 1502 1 2#383 2#638 9 2 4 0 0 4104 4 5 1 2#383 2#638 9 2 4 0 0
4105 4 1503 1 2#383 2#638 9 2 4 0 0 4105 4 1 1 2#383 2#638 9 2 4 0 0
4106 4 1503 1 2#383 2#638 9 2 4 0 0 4106 4 1 1 2#383 2#638 9 2 4 0 0
4107 4 1504 1 2#383 2#638 9 2 4 0 0 4107 4 2 1 2#383 2#638 9 2 4 0 0
4108 4 1504 1 2#383 2#638 9 2 4 0 0 4108 4 2 1 2#383 2#638 9 2 4 0 0
4109 4 1505 1 2#383 2#638 9 2 4 0 0 4109 4 4 1 2#383 2#638 9 2 4 0 0
4110 4 1505 1 2#383 2#638 9 2 4 0 0 4110 4 4 1 2#383 2#638 9 2 4 0 0
4111 4 0 2 3#396 3#659 10 2 4 0 0 4111 4 0 2 3#396 3#659 10 2 4 0 0
4112 4 0 2 3#396 3#659 10 2 4 0 0 4112 4 0 2 3#396 3#659 10 2 4 0 0
4113 4 0 2 4#370 4#617 10 2 4 0 0 4113 4 0 2 4#370 4#617 10 2 4 0 0

View File

@ -29,7 +29,7 @@ public class SPropertyConfig implements BaseConfig {
int propertyId = sPropertyConfig.getPropertyId(); int propertyId = sPropertyConfig.getPropertyId();
sPropertyConfigByPIDMapTmp.put(propertyId,sPropertyConfig); sPropertyConfigByPIDMapTmp.put(propertyId,sPropertyConfig);
} }
sPropertyConfigByPIDMapTmp = sPropertyConfigByPIDMap; sPropertyConfigByPIDMap = sPropertyConfigByPIDMapTmp;
} }

View File

@ -7,6 +7,8 @@ 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;
import java.util.List;
@Component @Component
public class EquipUnLoadOptHandler extends BaseHandler { public class EquipUnLoadOptHandler extends BaseHandler {
@Override @Override
@ -17,9 +19,8 @@ public class EquipUnLoadOptHandler extends BaseHandler {
@Override @Override
public void process(ISession iSession, PacketNetData netData) throws Exception { public void process(ISession iSession, PacketNetData netData) throws Exception {
HeroInfoProto.EquipUnLoadOptRequest equipUnLoadOptRequest = HeroInfoProto.EquipUnLoadOptRequest.parseFrom(netData.parseClientProtoNetData()); HeroInfoProto.EquipUnLoadOptRequest equipUnLoadOptRequest = HeroInfoProto.EquipUnLoadOptRequest.parseFrom(netData.parseClientProtoNetData());
int type = equipUnLoadOptRequest.getType(); List<String> equipIdsList = equipUnLoadOptRequest.getEquipIdsList();
String equipId = equipUnLoadOptRequest.getEquipId();
String heroId = equipUnLoadOptRequest.getHeroId(); String heroId = equipUnLoadOptRequest.getHeroId();
HeroLogic.getInstance().unloadEquipOpt(iSession,type,heroId,equipId); HeroLogic.getInstance().unloadEquipOpt(iSession,heroId,equipIdsList);
} }
} }

View File

@ -136,17 +136,17 @@ public class Hero extends MongoBase {
} }
public void setEquipByPositionMap(Map<Integer, String> equipByPositionMap) throws Exception { public void setEquipByPositionMap(Map<Integer, String> equipByPositionMap) throws Exception {
updateString("breakId",breakId); updateString("equipByPositionMap",equipByPositionMap);
this.equipByPositionMap = equipByPositionMap; this.equipByPositionMap = equipByPositionMap;
} }
public void updateEquipPositionMap(int position,String equipId) throws Exception { public void updateEquipPositionMap(int position,String equipId) throws Exception {
updateString("breakId." + position ,breakId); updateString("equipByPositionMap." + position ,equipId);
this.equipByPositionMap.put(position,equipId); this.equipByPositionMap.put(position,equipId);
} }
public void removeEquip(int position){ public void removeEquip(int position){
removeString("breakId." + position); removeString("equipByPositionMap." + position);
this.equipByPositionMap.remove(position); this.equipByPositionMap.remove(position);
} }
@ -158,4 +158,8 @@ public class Hero extends MongoBase {
updateString("breakId",breakId); updateString("breakId",breakId);
this.breakId = breakId; this.breakId = breakId;
} }
public int getCreateTime() {
return createTime;
}
} }

View File

@ -33,6 +33,7 @@ public class HeroLogic {
} }
public static class Instance { public static class Instance {
public final static HeroLogic instance = new HeroLogic(); public final static HeroLogic instance = new HeroLogic();
} }
@ -240,7 +241,7 @@ public class HeroLogic {
public String checkTeamPos(User user, int teamId,List<CommonProto.TeamHeroInfo> heroIds, List<CommonProto.TeamPokemonInfo> pokemonoIds ){ public String checkTeamPos(User user, int teamId,List<CommonProto.TeamHeroInfo> heroIds, List<CommonProto.TeamPokemonInfo> pokemonoIds ){
if(heroIds ==null || heroIds.isEmpty()){ if(heroIds ==null || heroIds.isEmpty()){
return "队伍信息错误"; return "";
} }
Set<String> cacheHeroIds = new HashSet<>(); Set<String> cacheHeroIds = new HashSet<>();
@ -630,9 +631,11 @@ public class HeroLogic {
Hero hero = user.getHeroManager().getHero(heroId); Hero hero = user.getHeroManager().getHero(heroId);
Equip equip = user.getEquipManager().getEquipMap().get(equipId); Equip equip = user.getEquipManager().getEquipMap().get(equipId);
if( null == equip || null == hero ){ if( null == equip || null == hero ){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE_VALUE,"");
return; return;
} }
if(!StringUtil.isEmpty(equip.getHeroId())){ if(!StringUtil.isEmpty(equip.getHeroId())){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE_VALUE,"");
return; return;
} }
int equipIdTid = equip.getEquipId(); int equipIdTid = equip.getEquipId();
@ -641,38 +644,43 @@ public class HeroLogic {
int professionLimit = sEquipConfig.getProfessionLimit(); int professionLimit = sEquipConfig.getProfessionLimit();
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId()); SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
if(professionLimit!=0 && scHero.getProfession()!= professionLimit){ if(professionLimit!=0 && scHero.getProfession()!= professionLimit){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_REQUEST_VALUE,""); MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE_VALUE,"");
return; return;
} }
hero.updateEquipPositionMap(position,equipId); hero.updateEquipPositionMap(position,equipId);
LOGGER.info("the heroTid={},the force={}",calHeoForce(user,hero)); //LOGGER.info("the heroTid={},the force={}",calHeoForce(user,hero));
//发送成功消息 //发送成功消息
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.EQUIP_WEAR_REQUEST_VALUE,null,true); MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE_VALUE,null,true);
} }
public void unloadEquipOpt(ISession session,int type,String heroId,String equipId) throws Exception { public void unloadEquipOpt(ISession session,String heroId,List<String> equipIds) throws Exception {
int uid = session.getUid(); int uid = session.getUid();
User user = UserManager.getUser(uid); User user = UserManager.getUser(uid);
Equip equip = user.getEquipManager().getEquipMap().get(equipId);
Hero hero = user.getHeroManager().getHero(heroId); Hero hero = user.getHeroManager().getHero(heroId);
if( hero == null|| null == equip || !StringUtil.isEmpty(equip.getHeroId()) ){ if( hero == null || equipIds.isEmpty()){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_UNLOAD_OPT_RESPONSE_VALUE,"");
return;
}
List<Integer> positions = new ArrayList<>();
for(String equipId : equipIds){
Equip equip = user.getEquipManager().getEquipMap().get(equipId);
if(null == equip || !StringUtil.isEmpty(equip.getHeroId())){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_UNLOAD_OPT_RESPONSE_VALUE,"");
return; return;
} }
int equipIdTid = equip.getEquipId(); int equipIdTid = equip.getEquipId();
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equipIdTid); SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equipIdTid);
int position = sEquipConfig.getPosition(); int position = sEquipConfig.getPosition();
positions.add(position);
if(type == 1){
equip.setHeroId("");
hero.removeEquip(position);
} }
if(type == 2){
hero.setEquipByPositionMap(new HashMap<>()); for(Integer position : positions){
hero.removeEquip(position);
} }
//发送成功消息 //发送成功消息

View File

@ -37,6 +37,11 @@ public class CBean2Proto {
} }
public static CommonProto.Hero getHero(Hero hero){ public static CommonProto.Hero getHero(Hero hero){
Map<Integer, String> equipByPositionMap = hero.getEquipByPositionMap();
List<String> equipList = new ArrayList<>();
for(String equipId : equipByPositionMap.values()){
equipList.add(equipId);
}
CommonProto.Hero heroProto = CommonProto.Hero CommonProto.Hero heroProto = CommonProto.Hero
.newBuilder() .newBuilder()
.setId(hero.getId()) .setId(hero.getId())
@ -44,8 +49,9 @@ public class CBean2Proto {
.setLevel(hero.getLevel()) .setLevel(hero.getLevel())
.setStar(hero.getStar()) .setStar(hero.getStar())
.setBreakId(hero.getBreakId()) .setBreakId(hero.getBreakId())
.setCreateTime(hero.getCreateTime())
.addAllSkillIdList(hero.getSkillList()) .addAllSkillIdList(hero.getSkillList())
// .addAllEquipIdList(getHeroEquip(hero.getEquipList())) .addAllEquipIdList(equipList)
.build(); .build();
return heroProto; return heroProto;
} }