back_recharge
zhangshanxue 2020-05-22 23:46:11 +08:00
commit d34556c29c
1 changed files with 22 additions and 0 deletions

View File

@ -318,6 +318,9 @@ public class DeathPathLogic {
guildTotalRank.addRank(task.getGuildId(),"",task.getDamage(),1);
//操作每个关的个人数据
doRankAdd(personRank,guildRank,task);
//第一名推送
sendChangeIndication(task.getGuildId(),task.getPathId());
}else{
ZSetOperations.TypedTuple<String> next = iterator.next();
firstGuildId = Integer.valueOf(next.getValue());
@ -329,6 +332,8 @@ public class DeathPathLogic {
if(currFirstGuildId==firstGuildId){
guildTotalRank.addRank(task.getGuildId(),"",task.getDamage());
}else{
//第一名更改时推送
sendChangeIndication(currFirstGuildId,task.getPathId());
guildTotalRank.addRank(currFirstGuildId,"",task.getDamage(),1);
guildTotalRank.addRank(firstGuildId,"",0,-1);
}
@ -336,6 +341,23 @@ public class DeathPathLogic {
}
private void sendChangeIndication(int currFirstGuildId,int pathId){
AbstractRank guildTotalRank = RankContext.getRankEnum(RankEnum.DEATH_PATH_TOTAL_GUILD_RANK.getType());
Set<ZSetOperations.TypedTuple<String>> allGuild = guildTotalRank.getRankByKey("", 0, -1);
String name = GuilidManager.guildInfoMap.get(currFirstGuildId).getName();
allGuild.forEach(n-> {
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(Integer.parseInt(n.getValue()));
Family.DeathPathInfo info = Family.DeathPathInfo.newBuilder().setGuildName(name).setGid(currFirstGuildId).setPathId(pathId).build();
Family.DeathPathFirstChangeIndication indication = Family.DeathPathFirstChangeIndication.newBuilder().setChangeInfo(info).build();
GuildLogic.sendIndicationToMember(guildInfo, MessageTypeProto.MessageType.DEATH_PATH_FIRST_CHANGE_INDICATION,indication);
});
LOGGER.info("信息修改,需要推送");
}
//判断改阵排行榜中是否有我打过的信息,没有加个人数
private void doRankAdd(AbstractRank personRank,AbstractRank guildRank ,DeathPathTask task){
if(personRank.getScoreById(task.getUid(),String.valueOf(task.getPathId()))==-1){