back_recharge
zhangshanxue 2019-09-25 15:39:23 +08:00
commit cf8066ae5c
9 changed files with 123 additions and 54 deletions

View File

@ -122,7 +122,7 @@ public class GmService implements RPCRequestGMIFace.Iface {
sendIds.add(session.getUid());
}
} else {
if(cmd.contains("hotfix")){
if(cmd.contains("hotfix") || cmd.contains("shop")|| cmd.contains("endStore")){
List<User> usersInDB = MongoUtil.getLjsdMongoTemplate().findAll("user", User.class);
for(User user1 : usersInDB){
User userInMem = UserManager.getUserInMem(user1.getId());

View File

@ -17,7 +17,7 @@ public class SEndlessDifficulty implements BaseConfig{
private int[] rewardId;
private int[] mapPool;
private int mapPool;
public static Map<Integer,SEndlessDifficulty> difficultyMap;
@ -78,7 +78,7 @@ public class SEndlessDifficulty implements BaseConfig{
return rewardId;
}
public int[] getMapPool() {
public int getMapPool() {
return mapPool;
}
}

View File

@ -2,6 +2,7 @@ package com.ljsd.jieling.handler.map;
import com.googlecode.protobuf.format.JsonFormat;
import com.ljsd.jieling.config.*;
import com.ljsd.jieling.core.FunctionIdEnum;
import com.ljsd.jieling.core.VipPrivilegeType;
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
import com.ljsd.jieling.dataReport.reportBeans_37.Repot37EventUtil;
@ -17,6 +18,7 @@ import com.ljsd.jieling.handler.mission.Mission;
import com.ljsd.jieling.ktbeans.KTGameType;
import com.ljsd.jieling.ktbeans.KtEventUtils;
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.STableManager;
import com.ljsd.jieling.logic.activity.event.Poster;
@ -216,7 +218,8 @@ public class MapLogic {
}
EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo();
if(endlessMapInfo.getSeason()!=endlessSeason){
StoreLogic.initOneStore(user,SEndlessMapConfig.sEndlessMapConfigMap.get(endlessMapId).getMapStoreId());
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Endless);
StoreLogic.initOnsStoereWithTime(user,SEndlessMapConfig.sEndlessMapConfigMap.get(endlessMapId).getMapStoreId(),openTimeOfFuntionCacheByType.getStartTime(),openTimeOfFuntionCacheByType.getEndTime());
mapManager.updateEndlessSeason(endlessSeason);
mapManager.updateEndlessMapId(0);
mapManager.endlessWalkCellSave(new HashSet<>());
@ -341,7 +344,7 @@ public class MapLogic {
break;
}
Map<Integer, Integer> heroAllAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,teamId);
if(teamId==401){
if(teamId==401&&user.getMapManager().getEndlessMapInfo().getSeason()==endlessSeason){
Map<String, Integer> endlessHeroInfo = user.getMapManager().getEndlessMapInfo().getEndlessHeroInfo();
if(endlessHeroInfo!=null&&endlessHeroInfo.size()>0){
if(initType!=2){
@ -477,6 +480,12 @@ public class MapLogic {
int xy = CellUtil.xy2Pos(challengeMapConfig.getPosition()[0], challengeMapConfig.getPosition()[1]);
int type = sChallengeConfig.getType();
if(type==4){
if(mapManager.getEndlessMapInfo().getSeason()!=endlessSeason) {
for(Map.Entry<String,Integer> entry:mapManager.getEndlessMapInfo().getEndlessHeroInfo().entrySet()){
mapManager.updateEndlessHeroHp(entry.getKey(),10000);
}
mapManager.updateEndlessLocation(0);
}
if(mapManager.getEndlessMapInfo().getCurCell()!=0){
xy = mapManager.getEndlessMapInfo().getCurCell();
}
@ -1269,14 +1278,16 @@ public class MapLogic {
mapManager.updateEndlessFightCount(1+mapManager.getEndlessMapInfo().getFightCount());
}
if (resultCode == 0) {
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){
//无尽副本复活消耗
//todo 无尽副本不复活记得改回去
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
// //无尽副本复活消耗
reviveConsumeExecution(user);
for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
mapManager.updateEndlessHeroHp(entry.getKey(),0);
}
}else {
}
// for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
// mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
// mapManager.updateEndlessHeroHp(entry.getKey(),0);
// }
// }else {
// 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount();
dieCount++;
@ -1300,7 +1311,7 @@ public class MapLogic {
remainHp.add(heroAttributeMap.get(HeroAttributeEnum.CurHP.getPropertyId()));
}
}
}
// }
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
FightInfoProto.FastFightResponse build = FightInfoProto.FastFightResponse
.newBuilder()
@ -1504,36 +1515,37 @@ public class MapLogic {
mapManager.setLastFightResult(resultCode);
if (resultCode == 0 || dropout == 1) {
//todo 无尽副本复活
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){
//无尽副本复活消耗
reviveConsumeExecution(user);
for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
mapManager.updateEndlessHeroHp(entry.getKey(),0);
}
}else{
// 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount();
dieCount++;
user.getMapManager().setDieCount(dieCount);
int[] reviveTime = sChallengeConfig.getReviveTime();
long time = (long) (MathUtils.calABX(dieCount, reviveTime) * 1000);
user.getMapManager().setCanMoveTime(TimeUtils.now() + time);
int leftTime = getLeftTime(user, true);
remainHp.clear();
if (leftTime <= (int) (time / 1000)) {
resetMapInfo(user, false);
} else {
initTeamInfo(mapManager.getTeamId(), uid, user, mapManager,2);
Map<String, Map<Integer, Integer>> heroAllAttributeMap = mapManager.getHeroAllAttributeMap();
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(mapManager.getTeamId());
for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) {
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
if (hero == null) {
continue;
}
remainHp.add(heroAllAttributeMap.get(hero.getId()).get(HeroAttributeEnum.CurHP.getPropertyId()));
// for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
// mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
// mapManager.updateEndlessHeroHp(entry.getKey(),0);
// }
}
// else{
// 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount();
dieCount++;
user.getMapManager().setDieCount(dieCount);
int[] reviveTime = sChallengeConfig.getReviveTime();
long time = (long) (MathUtils.calABX(dieCount, reviveTime) * 1000);
user.getMapManager().setCanMoveTime(TimeUtils.now() + time);
int leftTime = getLeftTime(user, true);
remainHp.clear();
if (leftTime <= (int) (time / 1000)) {
resetMapInfo(user, false);
} else {
initTeamInfo(mapManager.getTeamId(), uid, user, mapManager,2);
Map<String, Map<Integer, Integer>> heroAllAttributeMap = mapManager.getHeroAllAttributeMap();
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(mapManager.getTeamId());
for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) {
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
if (hero == null) {
continue;
}
remainHp.add(heroAllAttributeMap.get(hero.getId()).get(HeroAttributeEnum.CurHP.getPropertyId()));
}
}
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();

View File

@ -2,9 +2,8 @@ package com.ljsd.jieling.kefu;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.ljsd.jieling.config.SErrorCodeEerverConfig;
import com.ljsd.jieling.config.SGameSetting;
import com.ljsd.jieling.config.SRechargeCommodityConfig;
import com.ljsd.jieling.config.*;
import com.ljsd.jieling.core.FunctionIdEnum;
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
import com.ljsd.jieling.dataReport.reportBeans_37.Repot37EventUtil;
import com.ljsd.jieling.db.mongo.MongoUtil;
@ -12,18 +11,17 @@ import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.activity.ActivityType;
import com.ljsd.jieling.logic.dao.ActivityManager;
import com.ljsd.jieling.logic.dao.PlayerManager;
import com.ljsd.jieling.logic.dao.RechargeInfo;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.logic.store.GiftGoodsType;
import com.ljsd.jieling.logic.store.StoreLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
@ -74,6 +72,28 @@ public class Cmd_changename extends GmRoleAbstract {
}
if("shop".equals(args[2])){
LOGGER.info("hotfix user={} store start",user.getId());
if(user.getActivityManager().getActivityMissionMap().containsKey(10)){
StoreManager storeManager = user.getStoreManager();
Map<Integer, StoreInfo> storeInfoMap = storeManager.getStoreInfoMap();
if(!storeInfoMap.containsKey(10) && !storeInfoMap.containsKey(15)){
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(10);
long userCreateTime = user.getPlayerInfoManager().getCreateTime();
long startTime = sGlobalActivity.getTimeLong(userCreateTime, 1);
long endTime = sGlobalActivity.getTimeLong(userCreateTime, 2);
StoreLogic.initOnsStoereWithTime(user,10,startTime,endTime);
LOGGER.info("hotfix user={} store end",user.getId());
}
}
}
if("endStore".equals(args[2])){
if(!user.getStoreManager().getStoreInfoMap().containsKey(13)){
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Endless);
StoreLogic.initOnsStoereWithTime(user, 13,openTimeOfFuntionCacheByType.getStartTime(),openTimeOfFuntionCacheByType.getEndTime());
}
}
if("recharge".equals(args[2])){
Gson gson = new Gson();
Map<String,String> rechargeInfoMap = new HashMap<>();

View File

@ -29,6 +29,7 @@ import com.ljsd.jieling.netty.cocdex.Tea;
import com.ljsd.jieling.network.server.ProtocolsManager;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.MapInfoProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
import com.ljsd.jieling.thread.task.RPCGmServerTask;
@ -167,10 +168,16 @@ public class GlobalDataManaager {
break;
case Endless:
MapLogic.getInstance().updateEndlessSeason(timeControllerOfFunction.getTimes());
serverConfigTmp.setWorldLevel(calWorldLevel());
int level = calWorldLevel();
serverConfigTmp.setWorldLevel(level);
SEndlessDifficulty.setDifficult();
MongoUtil.getLjsdMongoTemplate().save(serverConfigTmp);
MapLogic.getInstance().setEndlessMapId(getEndleeMapIdByLevel());
Map<Integer, ISession> onlineUserMap = OnlineUserManager.sessionMap;
MapInfoProto.EndlessMapChange info = MapInfoProto.EndlessMapChange.newBuilder().setMapId(MapLogic.getEndlessMapId()).setWorldLevel(level).build();
for(Map.Entry<Integer, ISession> entry:onlineUserMap.entrySet()){
MessageUtil.sendIndicationMessage(entry.getValue(),1, MessageTypeProto.MessageType.ENDLESS_MAP_CHANGE_INDICATION_VALUE,info,true);
}
break;
default:
break;
@ -377,7 +384,18 @@ public class GlobalDataManaager {
}
private static int getEndleeMapIdByLevel() throws Exception {
ServerConfig config = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
int mapId = config.getWorldLevel() * 0 + 4002;
int mapId = 4001;
Map<Integer, SEndlessDifficulty> difficultyMap = SEndlessDifficulty.difficultyMap;
for(Map.Entry<Integer, SEndlessDifficulty> entry:difficultyMap.entrySet()){
if(config.getWorldLevel()>entry.getValue().getWorldLevel()[0]&&config.getWorldLevel()<=entry.getValue().getWorldLevel()[1]){
mapId = entry.getValue().getMapPool();
}
}
return mapId;
}
public TimeControllerOfFunction getOpenTimeOfFuntionCacheByType(FunctionIdEnum functionIdEnum ) {
return openTimeOfFuntionCache.get(functionIdEnum.getFunctionId());
}
}

View File

@ -8,6 +8,7 @@ import com.ljsd.jieling.config.SGuildSetting;
import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
import com.ljsd.jieling.logic.blood.BloodLogic;
import com.ljsd.jieling.logic.dao.*;
@ -18,6 +19,7 @@ import com.ljsd.jieling.logic.fight.CheckFight;
import com.ljsd.jieling.logic.fight.FightType;
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto;
@ -760,13 +762,20 @@ public class GuildFightLogic {
}else{
guildInfo.updateExp(guildInfo.getExp()+getExp);
}
//个人奖励
// //个人奖励
// Set<ZSetOperations.TypedTuple<String>> zsetreverseRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.FAMILY_FIGHT_STAR_RANK, String.valueOf(guildId), 0, 20);
// if(zsetreverseRangeWithScores.size()<1){
// continue;
// }
// Iterator<ZSetOperations.TypedTuple<String>> it = zsetreverseRangeWithScores.iterator();
// int rank = 1;
// int userRank = 1;
// int userResultRank = 1;
// Family.PersonalFightResultResponse.Builder response = Family.PersonalFightResultResponse.newBuilder();
//// response.addResult(Family.PersonalFightResult.newBuilder().setRank(userRank).set.build())
// while (it.hasNext()){
// rank++;
// ZSetOperations.TypedTuple<String> next = it.next();
//// MailLogic.getInstance().sendMail(Integer.parseInt(next.getValue()),"公会战奖励","恭喜你在此次工会战中获得第"+userResultRank,,Global.MAIL_EFFECTIVE_TIME);
// userRank++;
// }
}
MongoUtil.getLjsdMongoTemplate().lastUpdate();

View File

@ -550,9 +550,11 @@ public class GuildLogic {
MessageUtil.sendErrorResponse(session,0, msgId,"公会战期间不允许任命");
return;
}
if(guildInfo.getMembers().get(2)!=null&&guildInfo.getMembers().get(2).size()>=SGuildLevelConfig.sGuildLevelConfigMap.get(guildInfo.getLevel()).getOfficalNum()){
MessageUtil.sendErrorResponse(session,0,msgId,"官员人数已上限");
return;
if(position==2){
if(guildInfo.getMembers().get(2)!=null&&guildInfo.getMembers().get(2).size()>=SGuildLevelConfig.sGuildLevelConfigMap.get(guildInfo.getLevel()).getOfficalNum()){
MessageUtil.sendErrorResponse(session,0,msgId,"官员人数已上限");
return;
}
}
guildInfo.removeMember(targetType,targetUid);

View File

@ -69,6 +69,10 @@ public class MailLogic {
removeIds.add(cMail.getId());
continue;
}
if(cMail.getMailItem()!=null &&cMail.getMailItem().contains("null")){
removeIds.add(cMail.getId());
continue;
}
cMailList.add(cMail);
}
for(String removeId : removeIds){

View File

@ -130,6 +130,9 @@ public class StoreLogic {
StoreInfo storeInfo = it.next().getValue();
SStoreTypeConfig sStoreTypeConfig = SStoreTypeConfig.getsStoreTypeConfigMap().get(storeInfo.getId());
if (sStoreTypeConfig.getStoreOpenRule() ==2 || sStoreTypeConfig.getStoreOpenRule() ==5){
if(storeInfo.getEndTime()==0){
continue;
}
if (nowTime > storeInfo.getEndTime()){
removeStoreIds.add(storeInfo.getId());
}
@ -254,6 +257,7 @@ public class StoreLogic {
private static int getRewardId(int storeId,int sort,User user) {
PlayerManager playerInfoManager = user.getPlayerInfoManager();
List<SStoreConfig> sstoreConfigBuyStore = SStoreConfig.getSstoreConfigBuyStore().get(storeId);
LOGGER.info("getRewardId user={},storeId= {},sort={}",user.getId(),storeId,sort);
List<SStoreConfig> randomSstoreConfigList = new CopyOnWriteArrayList<>();
int totalWeight = 0;
for (SStoreConfig sStoreConfig : sstoreConfigBuyStore) {