Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
f9dab7ddae
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -19,10 +19,22 @@ public class SDifferDemonsConfig implements BaseConfig {
|
||||||
|
|
||||||
public static Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMap;
|
public static Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMap;
|
||||||
|
|
||||||
|
public static Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMapByComId;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
sDifferDemonsConfigMap= STableManager.getConfig(SDifferDemonsConfig.class);
|
Map<Integer, SDifferDemonsConfig> config = STableManager.getConfig(SDifferDemonsConfig.class);
|
||||||
|
Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMapByComIdTmp = new HashMap<>();
|
||||||
|
for(SDifferDemonsConfig sDifferDemonsConfig : config.values()){
|
||||||
|
int[] comonpentList = sDifferDemonsConfig.getComonpentList();
|
||||||
|
for(int comId : comonpentList){
|
||||||
|
sDifferDemonsConfigMapByComIdTmp.put(comId,sDifferDemonsConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sDifferDemonsConfigMap = config;
|
||||||
|
sDifferDemonsConfigMapByComId = sDifferDemonsConfigMapByComIdTmp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SDifferDemonsConfig getsDifferDemonsConfigByPokenID(int pokenmonId) {
|
public static SDifferDemonsConfig getsDifferDemonsConfigByPokenID(int pokenmonId) {
|
||||||
|
|
|
@ -110,6 +110,8 @@ public class SGameSetting implements BaseConfig {
|
||||||
|
|
||||||
private int[] equipSignUnlock;
|
private int[] equipSignUnlock;
|
||||||
|
|
||||||
|
private int[] heroReturn;
|
||||||
|
|
||||||
|
|
||||||
private static SGameSetting gameSetting;
|
private static SGameSetting gameSetting;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@ public class SHeroLevlConfig implements BaseConfig{
|
||||||
private int[][] consume;
|
private int[][] consume;
|
||||||
private int[][] sumConsume;
|
private int[][] sumConsume;
|
||||||
|
|
||||||
|
private int[][] rankupReturn;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,4 +62,8 @@ public class SHeroLevlConfig implements BaseConfig{
|
||||||
public float getSpeedLevelPara() {
|
public float getSpeedLevelPara() {
|
||||||
return speedLevelPara;
|
return speedLevelPara;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[][] getRankupReturn() {
|
||||||
|
return rankupReturn;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
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 ="HeroReturn")
|
||||||
|
public class SHeroReturn implements BaseConfig {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private int heroId;
|
||||||
|
|
||||||
|
private int star;
|
||||||
|
|
||||||
|
private int[] rankupReturn;
|
||||||
|
|
||||||
|
private int[][] returnHero;
|
||||||
|
|
||||||
|
private int[][] returnConsume;
|
||||||
|
|
||||||
|
private int[][] returnMaterials;
|
||||||
|
|
||||||
|
public static Map<Integer,Map<Integer,SHeroReturn>> sheroReturnMap;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws Exception {
|
||||||
|
Map<Integer, SHeroReturn> config = STableManager.getConfig(SHeroReturn.class);
|
||||||
|
Map<Integer,Map<Integer,SHeroReturn>> sheroReturnMapTmp = new HashMap<>();
|
||||||
|
for(SHeroReturn sHeroReturn : config.values()){
|
||||||
|
int heroId = sHeroReturn.getHeroId();
|
||||||
|
if(!sheroReturnMapTmp.containsKey(heroId)){
|
||||||
|
sheroReturnMapTmp.put(heroId,new HashMap<>());
|
||||||
|
}
|
||||||
|
Map<Integer, SHeroReturn> sHeroReturnMapByStar = sheroReturnMapTmp.get(heroId);
|
||||||
|
int star = sHeroReturn.getStar();
|
||||||
|
int[] rankupReturn = sHeroReturn.getRankupReturn();
|
||||||
|
int[][] returnHero = sHeroReturn.getReturnHero();
|
||||||
|
int length = 1 + returnHero.length ;
|
||||||
|
int[][] returnMaterialsTmp = new int[length][];
|
||||||
|
for(int i=0;i<returnHero.length;i++){
|
||||||
|
returnMaterialsTmp[i]=returnHero[i];
|
||||||
|
}
|
||||||
|
returnMaterialsTmp[length-1] = new int[2];
|
||||||
|
returnMaterialsTmp[length-1][0] = rankupReturn[0];
|
||||||
|
returnMaterialsTmp[length-1][1] = rankupReturn[1];
|
||||||
|
sHeroReturn.setReturnMaterials(returnMaterialsTmp);
|
||||||
|
sHeroReturnMapByStar.put(star,sHeroReturn);
|
||||||
|
}
|
||||||
|
sheroReturnMap = sheroReturnMapTmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHeroId() {
|
||||||
|
return heroId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStar() {
|
||||||
|
return star;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getRankupReturn() {
|
||||||
|
return rankupReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getReturnHero() {
|
||||||
|
return returnHero;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getReturnConsume() {
|
||||||
|
return returnConsume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getReturnMaterials() {
|
||||||
|
return returnMaterials;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReturnMaterials(int[][] returnMaterials) {
|
||||||
|
this.returnMaterials = returnMaterials;
|
||||||
|
}
|
||||||
|
}
|
|
@ -29,6 +29,18 @@ public class SSpecialConfig implements BaseConfig {
|
||||||
public static final String FRIENDAMOUNT_LIMIT = "FriendAmount_limit";//好友上限
|
public static final String FRIENDAMOUNT_LIMIT = "FriendAmount_limit";//好友上限
|
||||||
public static final String FRIENDAPPLYAMOUNT_LIMIT = "FriendApplyAmount_limit";//好友申请上限
|
public static final String FRIENDAPPLYAMOUNT_LIMIT = "FriendApplyAmount_limit";//好友申请上限
|
||||||
public static final String Friend_Gift = "Friend_Gift";//好友赠送友情点
|
public static final String Friend_Gift = "Friend_Gift";//好友赠送友情点
|
||||||
|
public static final String Level_RankingShowNum = "Level_RankingShowNum";//关卡排行
|
||||||
|
|
||||||
|
public static final String lamp_lottery_content_parm = "lamp_lottery_content_parm";//资质13及以上——系统消息
|
||||||
|
public static final String lamp_rankup_hero_content_parm = "lamp_rankup_hero_content_parm";//10星及以上——系统消息
|
||||||
|
public static final String lamp_lottery_differ_content_parm = "lamp_lottery_differ_content_parm";//5及以上——系统消息
|
||||||
|
// public static final String lamp_activate_differ_content_parm = "lamp_activate_differ_content_parm";//5及以上——系统消息
|
||||||
|
public static final String lamp_rankup_differ_content_parm = "lamp_rankup_differ_content_parm";//10阶以上——系统消息
|
||||||
|
public static final String lamp_lottery_equip_content_parm = "lamp_lottery_equip_content_parm";//5及以上——系统消息
|
||||||
|
public static final String lamp_lottery_equipsign_content_parm = "lamp_lottery_equipsign_content_parm";//5及以上——系统消息
|
||||||
|
public static final String lamp_lottery_equiptalisman_content_parm = "lamp_lottery_equiptalisman_content_parm";//5及以上——系统消息
|
||||||
|
public static final String lamp_rankup_equipsign_content_parm = "lamp_rankup_equipsign_content_parm";//5级及以上——系统消息
|
||||||
|
public static final String lamp_rankup_equiptalisman_content_parm = "lamp_rankup_equiptalisman_content_parm";//8星及以上——系统消息
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -122,6 +122,8 @@ public class RedisKey {
|
||||||
public static final String FORCE_RANK = "FORCE_RANK";
|
public static final String FORCE_RANK = "FORCE_RANK";
|
||||||
public static final String EXPERT_RANK = "EXPERT_RANK";
|
public static final String EXPERT_RANK = "EXPERT_RANK";
|
||||||
|
|
||||||
|
public static final String MAINLEVEL_RANK = "MAINLEVEL_RANK";
|
||||||
|
|
||||||
public static final String FAMILY_ID = "FAMILY_ID";
|
public static final String FAMILY_ID = "FAMILY_ID";
|
||||||
|
|
||||||
public static final String FAMILY_JOIN = "FAMILY_JOIN";
|
public static final String FAMILY_JOIN = "FAMILY_JOIN";
|
||||||
|
|
|
@ -90,6 +90,8 @@ public interface BIReason {
|
||||||
int LUCK_WHEEl_ADVANCE_REWARD = 54; //高级幸运转盘
|
int LUCK_WHEEl_ADVANCE_REWARD = 54; //高级幸运转盘
|
||||||
int SYSTERM_OPEN_REWARD = 54; //系统开放奖励
|
int SYSTERM_OPEN_REWARD = 54; //系统开放奖励
|
||||||
|
|
||||||
|
int HERO_BACK_REWARD = 55; // 英雄回溯返回东西
|
||||||
|
|
||||||
//道具消耗原因 1000开头
|
//道具消耗原因 1000开头
|
||||||
int ADVENTURE_UPLEVEL_CONSUME = 1000; //秘境升级
|
int ADVENTURE_UPLEVEL_CONSUME = 1000; //秘境升级
|
||||||
int SECRETBOX_CONSUME = 1001; //秘盒抽卡
|
int SECRETBOX_CONSUME = 1001; //秘盒抽卡
|
||||||
|
@ -160,5 +162,7 @@ public interface BIReason {
|
||||||
int LUCK_WHEEL = 1038; //幸运转盘消耗
|
int LUCK_WHEEL = 1038; //幸运转盘消耗
|
||||||
int LUCK_WHEEL_ADVANCE = 1039; //高级幸运转盘消耗
|
int LUCK_WHEEL_ADVANCE = 1039; //高级幸运转盘消耗
|
||||||
|
|
||||||
|
int HERO_BACK_CONSUME = 1040; // 英雄回溯消耗
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -150,7 +150,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
.addAllTowerReceivedReward(towerFloorReceivedReward)
|
.addAllTowerReceivedReward(towerFloorReceivedReward)
|
||||||
.addAllGoodsTypeDuration(goodsTypeDurations)
|
.addAllGoodsTypeDuration(goodsTypeDurations)
|
||||||
.setHadBuyTreasure(playerInfoManager.getHadBuyTreasure())
|
.setHadBuyTreasure(playerInfoManager.getHadBuyTreasure())
|
||||||
.setTreasureScore(playerInfoManager.getTreasureScore())
|
// .setTreasureScore(playerInfoManager.getTreasureScore())
|
||||||
.setSignInInfo(CommonProto.SignInInfo.newBuilder().setDays(playerInfoManager.getSign()+1).setState(playerInfoManager.getSignTotay()).build())
|
.setSignInInfo(CommonProto.SignInInfo.newBuilder().setDays(playerInfoManager.getSign()+1).setState(playerInfoManager.getSignTotay()).build())
|
||||||
.setMonsterAttackTime(user.getMapManager().getLastMonsterAttack())
|
.setMonsterAttackTime(user.getMapManager().getLastMonsterAttack())
|
||||||
.setFirstTenth(user.getHeroManager().getFirstTenth())
|
.setFirstTenth(user.getHeroManager().getFirstTenth())
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.ljsd.jieling.handler;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class HeroLockHandler extends BaseHandler<HeroInfoProto.HeroLockChangeRequest>{
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.HERO_LOCK_CHANGE_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processWithProto(ISession iSession, HeroInfoProto.HeroLockChangeRequest proto) throws Exception {
|
||||||
|
HeroLogic.getInstance().changeHeroLockState(iSession,proto.getHeroId(),proto.getLockState());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.ljsd.jieling.handler;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class HeroReturnHandler extends BaseHandler<HeroInfoProto.HeroReturnRequest>{
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.HERO_RETURN_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processWithProto(ISession iSession, HeroInfoProto.HeroReturnRequest proto) throws Exception {
|
||||||
|
HeroLogic.getInstance().heroBack(iSession,proto.getHeroId());
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,11 @@
|
||||||
package com.ljsd.jieling.handler.equip;
|
package com.ljsd.jieling.handler.equip;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.chat.logic.ChatLogic;
|
||||||
import com.ljsd.jieling.config.SEquipSign;
|
import com.ljsd.jieling.config.SEquipSign;
|
||||||
|
import com.ljsd.jieling.config.SErrorCodeEerverConfig;
|
||||||
|
import com.ljsd.jieling.config.SItem;
|
||||||
|
import com.ljsd.jieling.config.SSpecialConfig;
|
||||||
|
import com.ljsd.jieling.globals.Global;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
import com.ljsd.jieling.logic.activity.event.EquipEvent;
|
import com.ljsd.jieling.logic.activity.event.EquipEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
|
@ -91,6 +96,11 @@ public class UpSoulEquipQuiickHandler extends BaseHandler<HeroInfoProto.UpQuickS
|
||||||
builder.addAllSoulEquipIds(consumIds);
|
builder.addAllSoulEquipIds(consumIds);
|
||||||
builder.setEquipId(upQuickSoulEquipRequest.getEquipId());
|
builder.setEquipId(upQuickSoulEquipRequest.getEquipId());
|
||||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.UP_SOUL_EQUIP_RESPONSE_VALUE, builder.build(), true);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.UP_SOUL_EQUIP_RESPONSE_VALUE, builder.build(), true);
|
||||||
|
if(soulEquip.getLevel()>= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_rankup_equipsign_content_parm)){
|
||||||
|
SItem sItem = SItem.getsItemMap().get(soulEquip.getEquipId());
|
||||||
|
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_equipsign_content", new Object[]{user.getPlayerInfoManager().getNickName(), sItem.getName(),soulEquip.getLevel()});
|
||||||
|
ChatLogic.getInstance().sendSysChatMessage(message, Global.DILIGENT,sItem.getId(),0,0,0,0,0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.handler.map;
|
||||||
import com.googlecode.protobuf.format.JsonFormat;
|
import com.googlecode.protobuf.format.JsonFormat;
|
||||||
import com.ljsd.jieling.config.*;
|
import com.ljsd.jieling.config.*;
|
||||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||||
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||||
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
|
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
|
||||||
import com.ljsd.jieling.dataReport.reportBeans_37.Repot37EventUtil;
|
import com.ljsd.jieling.dataReport.reportBeans_37.Repot37EventUtil;
|
||||||
|
@ -39,6 +40,7 @@ import com.ljsd.jieling.util.*;
|
||||||
import org.luaj.vm2.LuaValue;
|
import org.luaj.vm2.LuaValue;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.boot.autoconfigure.session.SessionProperties;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.data.mongodb.core.query.Query;
|
import org.springframework.data.mongodb.core.query.Query;
|
||||||
|
@ -2185,6 +2187,69 @@ public class MapLogic {
|
||||||
fightEndResponse.setResult(resultCode);
|
fightEndResponse.setResult(resultCode);
|
||||||
fightEndResponse.build();
|
fightEndResponse.build();
|
||||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
|
||||||
|
String rankKey = RedisKey.getKey(RedisKey.MAINLEVEL_RANK, "", false);
|
||||||
|
RedisUtil.getInstence().zsetAddOne(rankKey, String.valueOf(user.getId()), fightId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getMainLevelRankInfo(ISession session) throws Exception {
|
||||||
|
int rankEndLine = SSpecialConfig.getIntegerValue(SSpecialConfig.Level_RankingShowNum);
|
||||||
|
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.MAINLEVEL_RANK, "", 0, rankEndLine);
|
||||||
|
int rank =1;
|
||||||
|
FightInfoProto.MainLevelRankInfoResponse.Builder builder = FightInfoProto.MainLevelRankInfoResponse.newBuilder();
|
||||||
|
List<CommonProto.MainLevelRankInfo.Builder> mainLevelRankInfoList = new ArrayList<>(rankEndLine);
|
||||||
|
for (ZSetOperations.TypedTuple<String> item : arenaRankInfo) {
|
||||||
|
String value = item.getValue();
|
||||||
|
int score = item.getScore().intValue();
|
||||||
|
int uidTmp = Integer.parseInt(value);
|
||||||
|
User userTmp = UserManager.getUser(uidTmp);
|
||||||
|
PlayerManager playerInfoManager = userTmp.getPlayerInfoManager();
|
||||||
|
mainLevelRankInfoList.add(CommonProto.MainLevelRankInfo.newBuilder()
|
||||||
|
.setUid(uidTmp)
|
||||||
|
.setLevel(playerInfoManager.getLevel())
|
||||||
|
.setName(playerInfoManager.getNickName())
|
||||||
|
.setFightId(score)
|
||||||
|
.setHead(0)
|
||||||
|
.setRank(rank++)
|
||||||
|
.setTotalForce(userTmp.getPlayerInfoManager().getMaxForce())
|
||||||
|
.setHeadFrame(playerInfoManager.getHeadFrame()));
|
||||||
|
}
|
||||||
|
Collections.sort(mainLevelRankInfoList, new Comparator<CommonProto.MainLevelRankInfo.Builder>() {
|
||||||
|
@Override
|
||||||
|
public int compare(CommonProto.MainLevelRankInfo.Builder o1, CommonProto.MainLevelRankInfo.Builder o2) {
|
||||||
|
if(o1.getFightId()==o2.getFightId()){
|
||||||
|
if(o1.getTotalForce()>o2.getTotalForce() && o1.getRank()>o2.getRank()){
|
||||||
|
int rank = o1.getRank();
|
||||||
|
o1.setRank(o2.getRank());
|
||||||
|
o2.setRank(rank);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return o1.getFightId() - o2.getFightId();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
for(CommonProto.MainLevelRankInfo.Builder builder1 : mainLevelRankInfoList){
|
||||||
|
builder.addMainLevelRankInfo(builder1.build());
|
||||||
|
}
|
||||||
|
int uid = session.getUid();
|
||||||
|
int score = RedisUtil.getInstence().getZSetScore(RedisKey.MAINLEVEL_RANK,"", Integer.toString(uid)).intValue();
|
||||||
|
int myRank =-1;
|
||||||
|
if(score == -1){
|
||||||
|
score = 1011;
|
||||||
|
}else{
|
||||||
|
myRank= RedisUtil.getInstence().getZSetreverseRank(RedisKey.MAINLEVEL_RANK,"",Integer.toString(uid)).intValue();
|
||||||
|
}
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||||
|
builder.setMyMainLevelRankInfo(CommonProto.MainLevelRankInfo.newBuilder()
|
||||||
|
.setUid(uid)
|
||||||
|
.setLevel(playerInfoManager.getLevel())
|
||||||
|
.setName(playerInfoManager.getNickName())
|
||||||
|
.setFightId(score)
|
||||||
|
.setHead(0)
|
||||||
|
.setRank(myRank)
|
||||||
|
.setTotalForce(playerInfoManager.getMaxForce())
|
||||||
|
.setHeadFrame(playerInfoManager.getHeadFrame()).build());
|
||||||
|
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.MAIN_LEVEL_GET_RANK_RESPONSE_VALUE,builder.build(),true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openNextMainLevel(User user,int fightId) throws Exception {
|
public void openNextMainLevel(User user,int fightId) throws Exception {
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.ljsd.jieling.handler.map.mapHandler;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.handler.map.MapLogic;
|
||||||
|
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||||
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class GetMainLevelRankHandler extends BaseHandler {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.MAIN_LEVEL_GET_RANK_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||||
|
MapLogic.getInstance().getMainLevelRankInfo(iSession);
|
||||||
|
}
|
||||||
|
}
|
|
@ -666,8 +666,8 @@ public class ArenaLogic {
|
||||||
public void playWithSb(ISession session,int challengeUid,int myteamId) throws Exception {
|
public void playWithSb(ISession session,int challengeUid,int myteamId) throws Exception {
|
||||||
User mine = UserManager.getUser(session.getUid());
|
User mine = UserManager.getUser(session.getUid());
|
||||||
User defUser = UserManager.getUser(challengeUid);
|
User defUser = UserManager.getUser(challengeUid);
|
||||||
if(!defUser.getTeamPosManager().getTeamPosForHero().containsKey(GlobalsDef.TEAM_ARENA_DEFENSE)){
|
if(!defUser.getTeamPosManager().getTeamPosForHero().containsKey(1)){
|
||||||
MessageUtil.sendErrorResponse(session,Global.SHOW_TIPS_ERROR, MessageTypeProto.MessageType.PLAY_WITH_SB_RESPONSE_VALUE,"对方未设置竞技场防守阵容");
|
MessageUtil.sendErrorResponse(session,Global.SHOW_TIPS_ERROR, MessageTypeProto.MessageType.PLAY_WITH_SB_RESPONSE_VALUE,"对方未设置阵容");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,8 @@ public class Hero extends MongoBase {
|
||||||
|
|
||||||
private String especialEquip;
|
private String especialEquip;
|
||||||
|
|
||||||
|
private int isLock;
|
||||||
|
|
||||||
public Hero(){
|
public Hero(){
|
||||||
//绑定关系
|
//绑定关系
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
|
@ -232,6 +234,16 @@ public class Hero extends MongoBase {
|
||||||
updateString("especialEquip",especialEquip);
|
updateString("especialEquip",especialEquip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getIsLock() {
|
||||||
|
return isLock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsLock(int isLock) {
|
||||||
|
updateString("isLock",isLock);
|
||||||
|
this.isLock = isLock;
|
||||||
|
}
|
||||||
|
|
||||||
public String getEspecialEquip() {
|
public String getEspecialEquip() {
|
||||||
return especialEquip;
|
return especialEquip;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class MainLevelManager extends MongoBase {
|
||||||
private int startTime;
|
private int startTime;
|
||||||
private int lastTime; //上一个关卡记时时间
|
private int lastTime; //上一个关卡记时时间
|
||||||
private Map<Integer,Integer> fightStateInfo = new HashMap<>();
|
private Map<Integer,Integer> fightStateInfo = new HashMap<>();
|
||||||
private Map<Integer,Set<String>> bossIds = new HashMap<>();
|
private Map<Integer,HashSet<String>> bossIds = new HashMap<>();
|
||||||
|
|
||||||
public void init(){
|
public void init(){
|
||||||
this.startTime = (int)(System.currentTimeMillis()/1000);
|
this.startTime = (int)(System.currentTimeMillis()/1000);
|
||||||
|
@ -115,7 +115,7 @@ public class MainLevelManager extends MongoBase {
|
||||||
return lastTime;
|
return lastTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Integer, Set<String>> getBossIds() {
|
public Map<Integer, HashSet<String>> getBossIds() {
|
||||||
return bossIds;
|
return bossIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -698,7 +698,7 @@ public class HeroLogic {
|
||||||
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
||||||
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_UP,2,targetHero.getTemplateId(),targetHero.getStar());
|
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_UP,2,targetHero.getTemplateId(),targetHero.getStar());
|
||||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,baseBuilder.build(),true);
|
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,baseBuilder.build(),true);
|
||||||
if(targetHero.getStar()>=7){
|
if(targetHero.getStar()>= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_rankup_hero_content_parm)){
|
||||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_hero_content", new Object[]{user.getPlayerInfoManager().getNickName(), scHero.getReadingName(),targetHero.getStar()});
|
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_hero_content", new Object[]{user.getPlayerInfoManager().getNickName(), scHero.getReadingName(),targetHero.getStar()});
|
||||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,targetHero.getTemplateId(),0,0,0,0,0);
|
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,targetHero.getTemplateId(),0,0,0,0,0);
|
||||||
}
|
}
|
||||||
|
@ -1751,10 +1751,10 @@ public class HeroLogic {
|
||||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.POKEMON_ADVANCED_RESPONSE_VALUE,null,true);
|
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.POKEMON_ADVANCED_RESPONSE_VALUE,null,true);
|
||||||
String message=null;
|
String message=null;
|
||||||
if(pokemon.getAllStage()==1){
|
if(pokemon.getAllStage()==1){
|
||||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_activate_differ_golden_content", new Object[]{user.getPlayerInfoManager().getNickName(),sDifferDemonsConfig.getName() });
|
message = SErrorCodeEerverConfig.getI18NMessage("lamp_activate_differ_content", new Object[]{user.getPlayerInfoManager().getNickName(),sDifferDemonsConfig.getName() });
|
||||||
|
|
||||||
}else{
|
}else if(pokemon.getAllStage()>=SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_rankup_differ_content_parm)){
|
||||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_differ_golden_content", new Object[]{user.getPlayerInfoManager().getNickName(), sDifferDemonsConfig.getName(),pokemon.getAllStage()});
|
message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_differ_content", new Object[]{user.getPlayerInfoManager().getNickName(), sDifferDemonsConfig.getName(),pokemon.getAllStage()});
|
||||||
}
|
}
|
||||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,sDifferDemonsConfig.getId(),0,0,0,0,0);
|
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,sDifferDemonsConfig.getId(),0,0,0,0,0);
|
||||||
|
|
||||||
|
@ -2067,4 +2067,54 @@ public class HeroLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void heroBack(ISession session,String heroId) throws Exception {
|
||||||
|
int uid = session.getUid();
|
||||||
|
int responseMsgId = MessageTypeProto.MessageType.HERO_RETURN_RESPONSE_VALUE;
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
List<String> heroList = new ArrayList<>(1);
|
||||||
|
heroList.add(heroId);
|
||||||
|
String err = ItemLogic.getInstance().checkHeroResolve(heroList, user);
|
||||||
|
if(!"".equals(err)){
|
||||||
|
MessageUtil.sendErrorResponse(session,0,responseMsgId,err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
HeroManager heroManager = user.getHeroManager();
|
||||||
|
Hero hero = user.getHeroManager().getHero(heroId);
|
||||||
|
int star = hero.getStar();
|
||||||
|
int templateId = hero.getTemplateId();
|
||||||
|
Map<Integer, SHeroReturn> sHeroReturnMap = SHeroReturn.sheroReturnMap.get(templateId);
|
||||||
|
if(sHeroReturnMap == null || !sHeroReturnMap.containsKey(star)){
|
||||||
|
MessageUtil.sendErrorResponse(session,0,responseMsgId,"not satisfy");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SHeroReturn sHeroReturn = sHeroReturnMap.get(star);
|
||||||
|
boolean b = ItemUtil.itemCost(user, sHeroReturn.getReturnConsume(), BIReason.HERO_BACK_CONSUME, templateId * 100 + star);
|
||||||
|
if(!b){
|
||||||
|
MessageUtil.sendErrorResponse(session,0,responseMsgId,"材料不足");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
heroManager.removeHero(heroId);
|
||||||
|
int[][] returnMaterials = sHeroReturn.getReturnMaterials();
|
||||||
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, returnMaterials, BIReason.HERO_BACK_REWARD);
|
||||||
|
SHeroLevlConfig sHeroLevlConfig = SHeroLevlConfig.getsHeroLevlConfigMap().get(hero.getLevel());
|
||||||
|
ItemUtil.drop(user, sHeroLevlConfig.getRankupReturn(),drop, BIReason.HERO_BACK_REWARD);
|
||||||
|
HeroInfoProto.HeroReturnResponse build = HeroInfoProto.HeroReturnResponse.newBuilder().setDrop(drop).build();
|
||||||
|
MessageUtil.sendMessage(session,1,responseMsgId,build,true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void changeHeroLockState(ISession session,String heroId,int lockState) throws Exception {
|
||||||
|
int uid = session.getUid();
|
||||||
|
int responseMsgId = MessageTypeProto.MessageType.HERO_LOCK_CHANGE_RESPONSE_VALUE;
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
Hero hero = user.getHeroManager().getHero(heroId);
|
||||||
|
if(hero == null){
|
||||||
|
MessageUtil.sendErrorResponse(session,0,responseMsgId,"no hero");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
hero.setIsLock(lockState);
|
||||||
|
MessageUtil.sendMessage(session,1,responseMsgId,null,true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ljsd.jieling.logic.item;
|
package com.ljsd.jieling.logic.item;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.chat.logic.ChatLogic;
|
||||||
import com.ljsd.jieling.config.*;
|
import com.ljsd.jieling.config.*;
|
||||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
|
@ -347,7 +348,7 @@ public class ItemLogic {
|
||||||
return baseBuilder;
|
return baseBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String checkHeroResolve(List<String> heroIdsList,User user){
|
public String checkHeroResolve(List<String> heroIdsList,User user){
|
||||||
HeroManager heroManager = user.getHeroManager();
|
HeroManager heroManager = user.getHeroManager();
|
||||||
if (heroIdsList.size() == 0){
|
if (heroIdsList.size() == 0){
|
||||||
return "无可分解妖灵师";
|
return "无可分解妖灵师";
|
||||||
|
@ -357,6 +358,9 @@ public class ItemLogic {
|
||||||
if (hero == null){
|
if (hero == null){
|
||||||
return "无该妖灵师";
|
return "无该妖灵师";
|
||||||
}
|
}
|
||||||
|
if(hero.getIsLock() == 1){
|
||||||
|
return "妖灵师已被上锁";
|
||||||
|
}
|
||||||
boolean battleArray = HeroLogic.getInstance().isBattleArray(user, heroId);
|
boolean battleArray = HeroLogic.getInstance().isBattleArray(user, heroId);
|
||||||
if (battleArray){
|
if (battleArray){
|
||||||
return "妖灵师在阵容中";
|
return "妖灵师在阵容中";
|
||||||
|
@ -494,6 +498,11 @@ public class ItemLogic {
|
||||||
Poster.getPoster().dispatchEvent(new EspecialEquipUpEvent(user.getId(),0, user.getEquipManager().getEspecialEquipMap().get(equipId).getStar()));
|
Poster.getPoster().dispatchEvent(new EspecialEquipUpEvent(user.getId(),0, user.getEquipManager().getEspecialEquipMap().get(equipId).getStar()));
|
||||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ESPECIAL_EQUIP,especialEquip.getStar()+1);
|
user.getUserMissionManager().onGameEvent(user, GameEvent.ESPECIAL_EQUIP,especialEquip.getStar()+1);
|
||||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,null,true);
|
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,null,true);
|
||||||
|
if(especialEquip.getStar()>=SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_rankup_equiptalisman_content_parm)){
|
||||||
|
SItem sItem = SItem.getsItemMap().get(especialEquip.getEquipId());
|
||||||
|
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_equiptalisman_content", new Object[]{user.getPlayerInfoManager().getNickName(), sItem.getName(),especialEquip.getStar()});
|
||||||
|
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,sItem.getId(),0,0,0,0,0);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,"材料不足");
|
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,"材料不足");
|
||||||
|
|
||||||
|
|
|
@ -398,7 +398,7 @@ public class WorkShopLogic {
|
||||||
while (nums-->0){
|
while (nums-->0){
|
||||||
Equip equip = new Equip(uid, equipTid, workShopLevel, runneIdsList);
|
Equip equip = new Equip(uid, equipTid, workShopLevel, runneIdsList);
|
||||||
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equip.getEquipId());
|
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equip.getEquipId());
|
||||||
if (sEquipConfig.getQuality() >= 5) {
|
if (sEquipConfig.getQuality() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_equip_content_parm)) {
|
||||||
String nickName = user.getPlayerInfoManager().getNickName();
|
String nickName = user.getPlayerInfoManager().getNickName();
|
||||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_equip_content", new Object[]{
|
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_equip_content", new Object[]{
|
||||||
nickName, ItemUtil.equipQulityNameMap.get(sEquipConfig.getQuality()),SItem.getsItemMap().get(equip.getEquipId()).getName()});
|
nickName, ItemUtil.equipQulityNameMap.get(sEquipConfig.getQuality()),SItem.getsItemMap().get(equip.getEquipId()).getName()});
|
||||||
|
|
|
@ -98,6 +98,7 @@ public class CBean2Proto {
|
||||||
.addAllEquipIdList(equipList)
|
.addAllEquipIdList(equipList)
|
||||||
.addEspecialEquip(hero.getEspecialEquip())
|
.addEspecialEquip(hero.getEspecialEquip())
|
||||||
.addAllSoulPos(soulPoss)
|
.addAllSoulPos(soulPoss)
|
||||||
|
.setLockState(hero.getIsLock())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,9 +454,9 @@ public class CBean2Proto {
|
||||||
.setState(state)
|
.setState(state)
|
||||||
.setDuration(duration);
|
.setDuration(duration);
|
||||||
|
|
||||||
Map<Integer, Set<String>> bossIds = mainLevelManager.getBossIds();
|
Map<Integer, HashSet<String>> bossIds = mainLevelManager.getBossIds();
|
||||||
boolean update =false;
|
boolean update =false;
|
||||||
for(Map.Entry<Integer, Set<String>> item : bossIds.entrySet()){
|
for(Map.Entry<Integer, HashSet<String>> item : bossIds.entrySet()){
|
||||||
Integer fightId = item.getKey();
|
Integer fightId = item.getKey();
|
||||||
Set<String> value = item.getValue();
|
Set<String> value = item.getValue();
|
||||||
SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(mainLevelManager.getFightId());
|
SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(mainLevelManager.getFightId());
|
||||||
|
|
|
@ -13,15 +13,11 @@ import com.ljsd.jieling.handler.map.TemporaryItems;
|
||||||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
import com.ljsd.jieling.logic.activity.event.ArenaChallengeEvent;
|
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.activity.event.UseItemEvent;
|
import com.ljsd.jieling.logic.activity.event.UseItemEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.UserLevelEvent;
|
import com.ljsd.jieling.logic.activity.event.UserLevelEvent;
|
||||||
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.item.ItemLog;
|
|
||||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
|
||||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
@ -47,7 +43,7 @@ public class ItemUtil {
|
||||||
notDelete.add(Global.STAMINA);
|
notDelete.add(Global.STAMINA);
|
||||||
|
|
||||||
equipQulityNameMap.put(5,"传说");
|
equipQulityNameMap.put(5,"传说");
|
||||||
equipQulityNameMap.put(6,"史诗");
|
equipQulityNameMap.put(6,"远古");
|
||||||
currencyMap.add(Global.GEM);
|
currencyMap.add(Global.GEM);
|
||||||
currencyMap.add(Global.GOLD);
|
currencyMap.add(Global.GOLD);
|
||||||
currencyMap.add(Global.SOULCRYSTAL);
|
currencyMap.add(Global.SOULCRYSTAL);
|
||||||
|
@ -77,6 +73,20 @@ public class ItemUtil {
|
||||||
return dropBuilder;
|
return dropBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static CommonProto.Drop.Builder drop(User user, int[][] itemArr,CommonProto.Drop.Builder dropBuilder,int reason) throws Exception {
|
||||||
|
Map<Integer, Integer> itemMap = new HashMap<>();
|
||||||
|
Map<Integer, Integer> cardMap = new HashMap<>();
|
||||||
|
Map<Integer,Integer> equipMap = new HashMap<>();
|
||||||
|
Map<Integer,Integer> randomMap = new HashMap<>();
|
||||||
|
selectItemArr(itemArr,cardMap,itemMap,equipMap,randomMap);
|
||||||
|
useRandomItem(user,randomMap,reason);
|
||||||
|
addItem(user,itemMap,dropBuilder,reason);
|
||||||
|
addCard(user,cardMap,dropBuilder,reason);
|
||||||
|
addEquip(user,equipMap,dropBuilder,reason);
|
||||||
|
addSoulEquip(user,equipMap,dropBuilder,reason);
|
||||||
|
return dropBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
//指定道具掉落(如:邮件,初始化物品)
|
//指定道具掉落(如:邮件,初始化物品)
|
||||||
public static CommonProto.Drop.Builder drop(User user, List<int[][]> itemArrs,int reason) throws Exception {
|
public static CommonProto.Drop.Builder drop(User user, List<int[][]> itemArrs,int reason) throws Exception {
|
||||||
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
|
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
|
||||||
|
@ -490,9 +500,10 @@ public class ItemUtil {
|
||||||
eventType = ParamEventBean.UserCurrencyEvent;
|
eventType = ParamEventBean.UserCurrencyEvent;
|
||||||
}
|
}
|
||||||
KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.addReason,entry.getKey(),itemNum,item.getItemNum());
|
KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.addReason,entry.getKey(),itemNum,item.getItemNum());
|
||||||
if(sItem.getItemType() == GlobalItemType.POKENMON_COMONPENT){
|
if(sItem.getItemType() == GlobalItemType.POKENMON_COMONPENT && sItem.getQuantity()>=SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_differ_content_parm)){
|
||||||
|
SDifferDemonsConfig sDifferDemonsConfig = SDifferDemonsConfig.sDifferDemonsConfigMapByComId.get(sItem.getId());
|
||||||
String nickName = user.getPlayerInfoManager().getNickName();
|
String nickName = user.getPlayerInfoManager().getNickName();
|
||||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_differ_content", new Object[]{nickName,sItem.getName()});
|
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_differ_content", new Object[]{nickName,sDifferDemonsConfig.getName(),sItem.getName()});
|
||||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,sItem.getId(),0,0,0,0,0);
|
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,sItem.getId(),0,0,0,0,0);
|
||||||
}
|
}
|
||||||
if(sItem.getId() == GlobalItemType.EXP){
|
if(sItem.getId() == GlobalItemType.EXP){
|
||||||
|
@ -877,6 +888,7 @@ public class ItemUtil {
|
||||||
String reward = getLimitReward(equipMap,filter);
|
String reward = getLimitReward(equipMap,filter);
|
||||||
int nowTime =(int) (TimeUtils.now()/1000);
|
int nowTime =(int) (TimeUtils.now()/1000);
|
||||||
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,nowTime,Global.MAIL_EFFECTIVE_TIME);
|
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,nowTime,Global.MAIL_EFFECTIVE_TIME);
|
||||||
|
MessageUtil.nofityBagIsFull(user);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
StringBuilder reward = new StringBuilder();
|
StringBuilder reward = new StringBuilder();
|
||||||
|
@ -905,6 +917,7 @@ public class ItemUtil {
|
||||||
if (reward.length() > 0) {
|
if (reward.length() > 0) {
|
||||||
int nowTime = (int) (TimeUtils.now() / 1000);
|
int nowTime = (int) (TimeUtils.now() / 1000);
|
||||||
MailLogic.getInstance().sendMail(user.getId(), title, content, reward.toString(), nowTime, Global.MAIL_EFFECTIVE_TIME);
|
MailLogic.getInstance().sendMail(user.getId(), title, content, reward.toString(), nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||||
|
MessageUtil.nofityBagIsFull(user);
|
||||||
}
|
}
|
||||||
dropBuilder.addAllEquipId(equipList);
|
dropBuilder.addAllEquipId(equipList);
|
||||||
dropBuilder.addAllEspecialEquipId(especialEquip);
|
dropBuilder.addAllEspecialEquipId(especialEquip);
|
||||||
|
@ -964,26 +977,29 @@ public class ItemUtil {
|
||||||
EquipManager equipManager = user.getEquipManager();
|
EquipManager equipManager = user.getEquipManager();
|
||||||
SItem item = SItem.getsItemMap().get(equipId);
|
SItem item = SItem.getsItemMap().get(equipId);
|
||||||
int itemType = item.getItemType();
|
int itemType = item.getItemType();
|
||||||
|
String msgTem = "";
|
||||||
if(itemType==GlobalItemType.EQUIP){
|
if(itemType==GlobalItemType.EQUIP){
|
||||||
Equip equip = new Equip(user.getId(),equipId);
|
Equip equip = new Equip(user.getId(),equipId);
|
||||||
equipManager.addEquip(user,equip);
|
equipManager.addEquip(user,equip);
|
||||||
equipList.add(CBean2Proto.getEquipProto(equip));
|
equipList.add(CBean2Proto.getEquipProto(equip));
|
||||||
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equipId);
|
msgTem="lamp_lottery_equip_content";
|
||||||
if (sEquipConfig.getQuality() >= 5) {
|
|
||||||
String nickName = user.getPlayerInfoManager().getNickName();
|
|
||||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_equip_content", new Object[]{nickName, equipQulityNameMap.get(sEquipConfig.getQuality()), item.getName()});
|
|
||||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,equipId,0,0,0,0,0);
|
|
||||||
}
|
|
||||||
}else if(itemType==GlobalItemType.ESPECIAL_EQUIP){
|
}else if(itemType==GlobalItemType.ESPECIAL_EQUIP){
|
||||||
EspecialEquip especialEquip = new EspecialEquip(user.getId(),equipId);
|
EspecialEquip especialEquip = new EspecialEquip(user.getId(),equipId);
|
||||||
especialEquip.setStar(item.getQuantity());
|
especialEquip.setStar(item.getQuantity());
|
||||||
especialEquipList.add(CBean2Proto.getEquipProto(especialEquip));
|
especialEquipList.add(CBean2Proto.getEquipProto(especialEquip));
|
||||||
equipManager.addEspecialEquip(user,especialEquip);
|
equipManager.addEspecialEquip(user,especialEquip);
|
||||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ESPECIAL_EQUIP, especialEquip.getStar());
|
user.getUserMissionManager().onGameEvent(user, GameEvent.ESPECIAL_EQUIP, especialEquip.getStar());
|
||||||
|
msgTem="lamp_lottery_equiptalisman_content";
|
||||||
}else if(itemType==GlobalItemType.SOUL_MARK){
|
}else if(itemType==GlobalItemType.SOUL_MARK){
|
||||||
SoulEquip soulEquip = new SoulEquip(user.getId(),equipId);
|
SoulEquip soulEquip = new SoulEquip(user.getId(),equipId);
|
||||||
equipManager.addSoulEquip(soulEquip);
|
equipManager.addSoulEquip(soulEquip);
|
||||||
equipList.add(CBean2Proto.getEquipProto(soulEquip));
|
equipList.add(CBean2Proto.getEquipProto(soulEquip));
|
||||||
|
msgTem="lamp_lottery_equipsign_content";
|
||||||
|
}
|
||||||
|
if (item.getQuantity() >= SSpecialConfig.getIntegerValue(msgTem+"_parm")) {
|
||||||
|
String nickName = user.getPlayerInfoManager().getNickName();
|
||||||
|
String message = SErrorCodeEerverConfig.getI18NMessage(msgTem, new Object[]{nickName, equipQulityNameMap.get(item.getQuantity()), item.getName()});
|
||||||
|
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,equipId,0,0,0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1007,6 +1023,7 @@ public class ItemUtil {
|
||||||
String reward = getLimitReward(cardMap,null);
|
String reward = getLimitReward(cardMap,null);
|
||||||
int nowTime =(int) (TimeUtils.now()/1000);
|
int nowTime =(int) (TimeUtils.now()/1000);
|
||||||
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,nowTime,Global.MAIL_EFFECTIVE_TIME);
|
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,nowTime,Global.MAIL_EFFECTIVE_TIME);
|
||||||
|
MessageUtil.nofityBagIsFull(user);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<CommonProto.Hero> heroList = new CopyOnWriteArrayList<>();
|
List<CommonProto.Hero> heroList = new CopyOnWriteArrayList<>();
|
||||||
|
@ -1028,6 +1045,7 @@ public class ItemUtil {
|
||||||
if (reward.length() > 0) {
|
if (reward.length() > 0) {
|
||||||
int nowTime = (int) (TimeUtils.now() / 1000);
|
int nowTime = (int) (TimeUtils.now() / 1000);
|
||||||
MailLogic.getInstance().sendMail(user.getId(), title, content, reward.toString(), nowTime, Global.MAIL_EFFECTIVE_TIME);
|
MailLogic.getInstance().sendMail(user.getId(), title, content, reward.toString(), nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||||
|
MessageUtil.nofityBagIsFull(user);
|
||||||
}
|
}
|
||||||
dropBuilder.addAllHero(heroList);
|
dropBuilder.addAllHero(heroList);
|
||||||
}
|
}
|
||||||
|
@ -1040,14 +1058,8 @@ public class ItemUtil {
|
||||||
heroManager.addHero(hero);
|
heroManager.addHero(hero);
|
||||||
heroList.add(CBean2Proto.getHero(hero));
|
heroList.add(CBean2Proto.getHero(hero));
|
||||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||||
if (scHero.getNatural() >= 13) {
|
if (scHero.getNatural() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) {
|
||||||
String message = "";
|
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_content", new Object[]{playerInfoManager.getNickName(), scHero.getNatural(), scHero.getReadingName()});
|
||||||
// String quality = HeroLogic.getInstance().getQuality(scHero.getNatural());
|
|
||||||
if (reason == BIReason.COMPOS_HERO_REWARD) {
|
|
||||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_synthesize_content", new Object[]{playerInfoManager.getNickName(), scHero.getNatural(), scHero.getReadingName()});
|
|
||||||
} else if (reason == BIReason.HERO_RANDOM) {
|
|
||||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_recruit_content", new Object[]{playerInfoManager.getNickName(), scHero.getNatural(), scHero.getReadingName()});
|
|
||||||
}
|
|
||||||
if (!message.isEmpty()){
|
if (!message.isEmpty()){
|
||||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,hero.getTemplateId(),0,0,0,0,0);
|
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,hero.getTemplateId(),0,0,0,0,0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,11 @@ package com.ljsd.jieling.util;
|
||||||
|
|
||||||
import com.google.protobuf.GeneratedMessage;
|
import com.google.protobuf.GeneratedMessage;
|
||||||
import com.googlecode.protobuf.format.JsonFormat;
|
import com.googlecode.protobuf.format.JsonFormat;
|
||||||
|
import com.ljsd.jieling.config.SErrorCodeEerverConfig;
|
||||||
import com.ljsd.jieling.core.GlobalsDef;
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||||
import com.ljsd.jieling.core.SimpleTransaction;
|
import com.ljsd.jieling.core.SimpleTransaction;
|
||||||
|
import com.ljsd.jieling.globals.Global;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
@ -202,6 +204,16 @@ public class MessageUtil {
|
||||||
session.writeAndFlush(byteBuf);
|
session.writeAndFlush(byteBuf);
|
||||||
session.putBackMassageToMap(byteBuf);
|
session.putBackMassageToMap(byteBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void nofityBagIsFull(User user){
|
||||||
|
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||||
|
if(session!=null){
|
||||||
|
String bag_full_tips = SErrorCodeEerverConfig.getI18NMessage("bag_full_tips");
|
||||||
|
GeneratedMessage generatedMessage = CommonProto.ErrorResponse.newBuilder().setErrCode(Global.SHOW_TIPS_ERROR).setErrMsg(bag_full_tips).build();
|
||||||
|
sendIndicationMessage(session,1, MessageTypeProto.MessageType.ERROR_CODE_INDICATION_VALUE,generatedMessage,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// public static void sendResponse(Msg msg, int msgId, GeneratedMessage generatedMessage) throws Exception {
|
// public static void sendResponse(Msg msg, int msgId, GeneratedMessage generatedMessage) throws Exception {
|
||||||
// String protoEntity = Base64.getEncoder().encodeToString(generatedMessage.toByteArray());
|
// String protoEntity = Base64.getEncoder().encodeToString(generatedMessage.toByteArray());
|
||||||
|
|
Loading…
Reference in New Issue