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<>();
String key = RedisUtil.getInstence().getKey(RedisKey.CAR_DEALY_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(guildKey);
delKeys.add(guildKey);
delKeys.add(userLevelGuild);
Set<String> guildSet = RedisUtil.getInstence().getZset(guildKey, 0, -1);
guildSet.forEach(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");
Set<ZSetOperations.TypedTuple<String>> guildRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CAR_DEALY_GUILD_RANK, "", 0, -1);
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){
String value = item.getValue();
@ -77,6 +85,9 @@ public class CarDelayFunction implements FunctionManager {
}
rank++;
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});
for(Set<Integer> uids : values){
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 USER_LEVEL_GUILD_INFO = "USER_LEVEL_GUILD_INFO"; //车迟玩法挑战记录
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 battleRound = sWorldBossSetting.getBattleRound();
CommonProto.FightData fightData= null;
boolean isNew = guildInfo.addCarFightSb(uid);
boolean isNew = !guildInfo.getCarFightSb().containsKey(uid);
switch (type){
case 1:{
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];
fightData = fightResult.getFightData();
gainScore = (int) (hurt*(sWorldBossSetting.getScorePercent()/10000F));
RankEnum.toRank(RankEnum.CAR_DEALY_RANK.getType()).incrementRankScore(uid,"",gainScore);
double myscore = 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);
@ -133,7 +136,8 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
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();
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 int carPlayTime; //车迟上次玩的时间
private int carPlayProgress; // 车迟玩的阶段
@ -267,4 +268,13 @@ public class GuildMyInfo extends MongoBase {
public int getCarPlayTime() {
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;
}
int mod = sortId%5;
integers.add(sortId+2);
if(mod==3||mod==0){
if(mod==0){
integers.add(sortId+2);
return integers;
}
integers.add(sortId+3);
if(mod==3){
return integers;
}
integers.add(sortId+2);
return integers;
}
@ -794,7 +798,7 @@ public class ExpeditionLogic {
WorldBossTreasureStaticConfig worldBossTreasureStaticConfig = STableManager.getFigureConfig(WorldBossTreasureStaticConfig.class);
Map<Integer, Set<SWorldBossTreasureConfig>> idsByPeriods = worldBossTreasureStaticConfig.getIdsByPeriods();
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);
}

View File

@ -149,6 +149,10 @@ public class GuildLogic {
}
}
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());
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);
AyyncWorker ayyncWorker = new AyyncWorker(targetUser, true, new AynMissionWorker(GameEvent.JOIN_FAMILY));
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
RedisUtil.getInstence().removeMapEntrys(RedisKey.USER_LEVEL_GUILD_INFO,"",String.valueOf(applyId));
// targetUser.getUserMissionManager().onGameEvent(targetUser, GameEvent.JOIN_FAMILY);
}finally {
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清零之前调用
//退公会清除数据 补发奖励
sendGuildHelpRewardEmail(user);
int guildId = user.getPlayerInfoManager().getGuildId();
RedisUtil.getInstence().putMapEntry(RedisKey.USER_LEVEL_GUILD_INFO,"",String.valueOf(user.getId()),guildId);
//notify all
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){
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)) {
return;
}
}*/
UserMissionManager userMissionManager = user.getUserMissionManager();
AchieveMissionIdsType achievementMissionTypMap = userMissionManager.getAchievementMissionTypMap();

View File

@ -1122,7 +1122,7 @@ public class ItemUtil {
heroList.add(CBean2Proto.getHero(hero));
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
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()){
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,hero.getTemplateId(),0,0,0,0,0);
}