【车迟斗法】没有收到前公会的排行奖励
parent
e8307d5664
commit
940625d330
|
@ -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){
|
||||||
|
|
|
@ -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<>();
|
||||||
|
|
|
@ -590,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));
|
||||||
|
@ -1358,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();
|
||||||
|
|
Loading…
Reference in New Issue