back_recharge
lvxinran 2020-05-25 19:31:20 +08:00
commit b8a99d8662
8 changed files with 49 additions and 11 deletions

View File

@ -26,9 +26,10 @@ public class CarDelayFunction implements FunctionManager {
List<String> delKeys = new ArrayList<>(); List<String> delKeys = new ArrayList<>();
String key = RedisUtil.getInstence().getKey(RedisKey.CAR_DEALY_RANK, ""); String key = RedisUtil.getInstence().getKey(RedisKey.CAR_DEALY_RANK, "");
String guildKey = RedisUtil.getInstence().getKey(RedisKey.CAR_DEALY_GUILD_RANK, ""); String guildKey = RedisUtil.getInstence().getKey(RedisKey.CAR_DEALY_GUILD_RANK, "");
String userLevelGuild = RedisUtil.getInstence().getKey(RedisKey.USER_LEVEL_GUILD_INFO, "");
delKeys.add(key); delKeys.add(key);
delKeys.add(guildKey); delKeys.add(guildKey);
delKeys.add(guildKey); delKeys.add(userLevelGuild);
Set<String> guildSet = RedisUtil.getInstence().getZset(guildKey, 0, -1); Set<String> guildSet = RedisUtil.getInstence().getZset(guildKey, 0, -1);
guildSet.forEach(guildId->{ guildSet.forEach(guildId->{
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(Integer.parseInt(guildId)); GuildInfo guildInfo = GuilidManager.guildInfoMap.get(Integer.parseInt(guildId));
@ -66,6 +67,13 @@ public class CarDelayFunction implements FunctionManager {
String guildTitle = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_familyreward_title"); String guildTitle = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_familyreward_title");
Set<ZSetOperations.TypedTuple<String>> guildRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CAR_DEALY_GUILD_RANK, "", 0, -1); Set<ZSetOperations.TypedTuple<String>> guildRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CAR_DEALY_GUILD_RANK, "", 0, -1);
rank=0; rank=0;
Map<Integer, Integer> userLevelGuildMap = RedisUtil.getInstence().getMapValues(RedisKey.USER_LEVEL_GUILD_INFO, "", Integer.class, Integer.class);
Map<Integer,Set<Integer>> usersByGuildId = new HashMap<>();
userLevelGuildMap.forEach((userId,guildId)->{
usersByGuildId.putIfAbsent(guildId,new HashSet<>());
usersByGuildId.get(guildId).add(userId);
});
for(ZSetOperations.TypedTuple<String> item : guildRangeWithScores){ for(ZSetOperations.TypedTuple<String> item : guildRangeWithScores){
String value = item.getValue(); String value = item.getValue();
@ -77,6 +85,9 @@ public class CarDelayFunction implements FunctionManager {
} }
rank++; rank++;
Collection<Set<Integer>> values = guildInfo.getMembers().values(); Collection<Set<Integer>> values = guildInfo.getMembers().values();
if(userLevelGuildMap.containsKey(guildId)){
values.add(usersByGuildId.get(guildId));
}
String guildContent = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_familyreward_txt",new Object[]{rank}); String guildContent = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_familyreward_txt",new Object[]{rank});
for(Set<Integer> uids : values){ for(Set<Integer> uids : values){
for(Integer uid:uids){ for(Integer uid:uids){

View File

@ -262,6 +262,8 @@ public class RedisKey {
public final static String CAR_CHALLENGE_RECORD = "CAR_CHALLENGE_RECORD"; //车迟玩法挑战记录 public final static String CAR_CHALLENGE_RECORD = "CAR_CHALLENGE_RECORD"; //车迟玩法挑战记录
public final static String USER_LEVEL_GUILD_INFO = "USER_LEVEL_GUILD_INFO"; //车迟玩法挑战记录
public static Set<String> familyKey = new HashSet<>(); public static Set<String> familyKey = new HashSet<>();

View File

@ -77,7 +77,7 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
int challeageId = proto.getChalleageId(); int challeageId = proto.getChalleageId();
int battleRound = sWorldBossSetting.getBattleRound(); int battleRound = sWorldBossSetting.getBattleRound();
CommonProto.FightData fightData= null; CommonProto.FightData fightData= null;
boolean isNew = guildInfo.addCarFightSb(uid); boolean isNew = !guildInfo.getCarFightSb().containsKey(uid);
switch (type){ switch (type){
case 1:{ case 1:{
int monsterId = STableManager.getConfig(SWorldBossConfig.class).get(GuildFightLogic.carDelayProgressIndication.getBossIndexId()).getMonsterId(); int monsterId = STableManager.getConfig(SWorldBossConfig.class).get(GuildFightLogic.carDelayProgressIndication.getBossIndexId()).getMonsterId();
@ -86,8 +86,11 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
hurt = fightResult.getCheckResult()[1]; hurt = fightResult.getCheckResult()[1];
fightData = fightResult.getFightData(); fightData = fightResult.getFightData();
gainScore = (int) (hurt*(sWorldBossSetting.getScorePercent()/10000F)); gainScore = (int) (hurt*(sWorldBossSetting.getScorePercent()/10000F));
double myscore = gainScore;
RankEnum.toRank(RankEnum.CAR_DEALY_RANK.getType()).incrementRankScore(uid,"",gainScore); if(isNew){
myscore+=TimeUtils.getDoubleTime();
}
RankEnum.toRank(RankEnum.CAR_DEALY_RANK.getType()).incrementRankScore(uid,"",myscore);
RankEnum.toRank(RankEnum.CAR_DEALY_GUILD_RANK.getType()).incrementRankScore(guildInfo.getId(),"",gainScore,isNew?1:0); RankEnum.toRank(RankEnum.CAR_DEALY_GUILD_RANK.getType()).incrementRankScore(guildInfo.getId(),"",gainScore,isNew?1:0);
@ -133,7 +136,8 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
} }
user.getGuildMyInfo().setCarPlayTime(TimeUtils.nowInt()); guildInfo.addCarFightSb(uid);
user.getGuildMyInfo().setCarPlayTime(TimeUtils.nowInt());
FightInfoProto.FastFightChallengeResponse build = FightInfoProto.FastFightChallengeResponse.newBuilder().setHurt(hurt).setScore(gainScore).setFightData(fightData).build(); FightInfoProto.FastFightChallengeResponse build = FightInfoProto.FastFightChallengeResponse.newBuilder().setHurt(hurt).setScore(gainScore).setFightData(fightData).build();
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.FAST_FIGHT_CHALLENGE_RESPONSE_VALUE,build,true); MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.FAST_FIGHT_CHALLENGE_RESPONSE_VALUE,build,true);
} }

View File

@ -36,6 +36,7 @@ public class GuildMyInfo extends MongoBase {
private long guildHelpSendTime;//公会求助信息时间 5分钟 private long guildHelpSendTime;//公会求助信息时间 5分钟
private int carPlayTime; //车迟上次玩的时间 private int carPlayTime; //车迟上次玩的时间
private int carPlayProgress; // 车迟玩的阶段
@ -267,4 +268,13 @@ public class GuildMyInfo extends MongoBase {
public int getCarPlayTime() { public int getCarPlayTime() {
return carPlayTime; return carPlayTime;
} }
public int getCarPlayProgress() {
return carPlayProgress;
}
public void setCarPlayProgress(int carPlayProgress) {
this.carPlayProgress = carPlayProgress;
updateString("carPlayProgress",carPlayProgress);
}
} }

View File

@ -698,11 +698,15 @@ public class ExpeditionLogic {
return integers; return integers;
} }
int mod = sortId%5; int mod = sortId%5;
integers.add(sortId+2); if(mod==0){
if(mod==3||mod==0){ integers.add(sortId+2);
return integers; return integers;
} }
integers.add(sortId+3); integers.add(sortId+3);
if(mod==3){
return integers;
}
integers.add(sortId+2);
return integers; return integers;
} }
@ -794,7 +798,7 @@ public class ExpeditionLogic {
WorldBossTreasureStaticConfig worldBossTreasureStaticConfig = STableManager.getFigureConfig(WorldBossTreasureStaticConfig.class); WorldBossTreasureStaticConfig worldBossTreasureStaticConfig = STableManager.getFigureConfig(WorldBossTreasureStaticConfig.class);
Map<Integer, Set<SWorldBossTreasureConfig>> idsByPeriods = worldBossTreasureStaticConfig.getIdsByPeriods(); Map<Integer, Set<SWorldBossTreasureConfig>> idsByPeriods = worldBossTreasureStaticConfig.getIdsByPeriods();
Map<Integer,Integer> changeStateMap = new HashMap<>(rewardStatusMap); Map<Integer,Integer> changeStateMap = new HashMap<>(rewardStatusMap);
idsByPeriods.get(worldTreasureReward.getScore()).forEach(item->changeStateMap.putIfAbsent(item.getId(),0)); idsByPeriods.get(worldTreasureReward.getRound()).forEach(item->changeStateMap.putIfAbsent(item.getId(),0));
sendTreasureRewardUpdate(session,0,changeStateMap); sendTreasureRewardUpdate(session,0,changeStateMap);
} }

View File

@ -149,6 +149,10 @@ public class GuildLogic {
} }
} }
builder.setCarDelayProgressIndication(GuildFightLogic.carDelayProgressIndication); builder.setCarDelayProgressIndication(GuildFightLogic.carDelayProgressIndication);
if(GuildFightLogic.carDelayProgressIndication.getProgress() != user.getGuildMyInfo().getCarPlayProgress()){
user.getGuildMyInfo().setCarPlayTime(0);
user.getGuildMyInfo().setCarPlayProgress(GuildFightLogic.carDelayProgressIndication.getProgress());
}
builder.setCarPlayTime(user.getGuildMyInfo().getCarPlayTime()); builder.setCarPlayTime(user.getGuildMyInfo().getCarPlayTime());
MessageUtil.sendMessage(session,1,msgId,builder.build(),true); MessageUtil.sendMessage(session,1,msgId,builder.build(),true);
} }
@ -586,6 +590,7 @@ public class GuildLogic {
RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(applyId),cache); RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(applyId),cache);
AyyncWorker ayyncWorker = new AyyncWorker(targetUser, true, new AynMissionWorker(GameEvent.JOIN_FAMILY)); AyyncWorker ayyncWorker = new AyyncWorker(targetUser, true, new AynMissionWorker(GameEvent.JOIN_FAMILY));
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker); ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
RedisUtil.getInstence().removeMapEntrys(RedisKey.USER_LEVEL_GUILD_INFO,"",String.valueOf(applyId));
// targetUser.getUserMissionManager().onGameEvent(targetUser, GameEvent.JOIN_FAMILY); // targetUser.getUserMissionManager().onGameEvent(targetUser, GameEvent.JOIN_FAMILY);
}finally { }finally {
RedisUtil.getInstence().releaseDistributedLock(RedisKey.OPERATE_FAMILY_APPLY_JOIN,Integer.toString(applyId), Integer.toString(applyId)); RedisUtil.getInstence().releaseDistributedLock(RedisKey.OPERATE_FAMILY_APPLY_JOIN,Integer.toString(applyId), Integer.toString(applyId));
@ -1354,6 +1359,8 @@ public class GuildLogic {
//TODO lock all 公会id清零之前调用 //TODO lock all 公会id清零之前调用
//退公会清除数据 补发奖励 //退公会清除数据 补发奖励
sendGuildHelpRewardEmail(user); sendGuildHelpRewardEmail(user);
int guildId = user.getPlayerInfoManager().getGuildId();
RedisUtil.getInstence().putMapEntry(RedisKey.USER_LEVEL_GUILD_INFO,"",String.valueOf(user.getId()),guildId);
//notify all //notify all
Family.GuildHelpInfoIndication.Builder build = Family.GuildHelpInfoIndication.newBuilder(); Family.GuildHelpInfoIndication.Builder build = Family.GuildHelpInfoIndication.newBuilder();

View File

@ -320,10 +320,10 @@ public class MissionLoigc {
} }
public static void getAchieveMission(User user ,List<CommonProto.UserMissionInfo> missionList){ public static void getAchieveMission(User user ,List<CommonProto.UserMissionInfo> missionList){
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.Achieve.getFunctionType()); /* SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.Achieve.getFunctionType());
if (sGlobalSystemConfig!=null&&!HandlerLogicThread.checkOpen(user,sGlobalSystemConfig)) { if (sGlobalSystemConfig!=null&&!HandlerLogicThread.checkOpen(user,sGlobalSystemConfig)) {
return; return;
} }*/
UserMissionManager userMissionManager = user.getUserMissionManager(); UserMissionManager userMissionManager = user.getUserMissionManager();
AchieveMissionIdsType achievementMissionTypMap = userMissionManager.getAchievementMissionTypMap(); AchieveMissionIdsType achievementMissionTypMap = userMissionManager.getAchievementMissionTypMap();

View File

@ -1122,7 +1122,7 @@ public class ItemUtil {
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.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级 if (scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_content", new Object[]{playerInfoManager.getNickName(), scHero.getNatural(), scHero.getReadingName()}); String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_content", new Object[]{playerInfoManager.getNickName(), scHero.getStar(), 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);
} }