跨服十绝阵第二版
parent
fb5da8c93b
commit
5cd2499af6
File diff suppressed because it is too large
Load Diff
|
|
@ -4061,6 +4061,30 @@ public final class MessageTypeProto {
|
|||
* <code>SeletSubRewardPoolResponse = 303672;</code>
|
||||
*/
|
||||
SeletSubRewardPoolResponse(655, 303672),
|
||||
/**
|
||||
* <code>NewGeneralAttackRequest = 303691;</code>
|
||||
*
|
||||
* <pre>
|
||||
*303691 - 303692 新将来袭
|
||||
* </pre>
|
||||
*/
|
||||
NewGeneralAttackRequest(656, 303691),
|
||||
/**
|
||||
* <code>NewGeneralAttackResponse = 303692;</code>
|
||||
*/
|
||||
NewGeneralAttackResponse(657, 303692),
|
||||
/**
|
||||
* <code>UpgradeGodTreeRequest = 303701;</code>
|
||||
*
|
||||
* <pre>
|
||||
* 303701 - 303702 建木神树
|
||||
* </pre>
|
||||
*/
|
||||
UpgradeGodTreeRequest(658, 303701),
|
||||
/**
|
||||
* <code>UpgradeGodTreeResponse = 303702;</code>
|
||||
*/
|
||||
UpgradeGodTreeResponse(659, 303702),
|
||||
/**
|
||||
* <code>GetWorldServerRequest = 800001;</code>
|
||||
*
|
||||
|
|
@ -4068,11 +4092,11 @@ public final class MessageTypeProto {
|
|||
*800000起为global 协议
|
||||
* </pre>
|
||||
*/
|
||||
GetWorldServerRequest(656, 800001),
|
||||
GetWorldServerRequest(660, 800001),
|
||||
/**
|
||||
* <code>GetWorldServerResponse = 800002;</code>
|
||||
*/
|
||||
GetWorldServerResponse(657, 800002),
|
||||
GetWorldServerResponse(661, 800002),
|
||||
/**
|
||||
* <code>GetWorldArenaInfoRequest = 900001;</code>
|
||||
*
|
||||
|
|
@ -4080,11 +4104,11 @@ public final class MessageTypeProto {
|
|||
*900000起为跨服消息 世界服服返回消息gs只负责透传
|
||||
* </pre>
|
||||
*/
|
||||
GetWorldArenaInfoRequest(658, 900001),
|
||||
GetWorldArenaInfoRequest(662, 900001),
|
||||
/**
|
||||
* <code>GetWorldArenaInfoResponse = 900002;</code>
|
||||
*/
|
||||
GetWorldArenaInfoResponse(659, 900002),
|
||||
GetWorldArenaInfoResponse(663, 900002),
|
||||
/**
|
||||
* <code>GetWorldArenaChallengeRequest = 900003;</code>
|
||||
*
|
||||
|
|
@ -4092,11 +4116,11 @@ public final class MessageTypeProto {
|
|||
*跨服天梯挑战
|
||||
* </pre>
|
||||
*/
|
||||
GetWorldArenaChallengeRequest(660, 900003),
|
||||
GetWorldArenaChallengeRequest(664, 900003),
|
||||
/**
|
||||
* <code>GetWorldArenaChallengeResponse = 900004;</code>
|
||||
*/
|
||||
GetWorldArenaChallengeResponse(661, 900004),
|
||||
GetWorldArenaChallengeResponse(665, 900004),
|
||||
/**
|
||||
* <code>GetWorldArenaProudRequest = 900005;</code>
|
||||
*
|
||||
|
|
@ -4104,11 +4128,11 @@ public final class MessageTypeProto {
|
|||
*膜拜
|
||||
* </pre>
|
||||
*/
|
||||
GetWorldArenaProudRequest(662, 900005),
|
||||
GetWorldArenaProudRequest(666, 900005),
|
||||
/**
|
||||
* <code>GetWorldArenaProudResponse = 900006;</code>
|
||||
*/
|
||||
GetWorldArenaProudResponse(663, 900006),
|
||||
GetWorldArenaProudResponse(667, 900006),
|
||||
/**
|
||||
* <code>GetWorldArenaRecordInfoRequest = 900007;</code>
|
||||
*
|
||||
|
|
@ -4116,11 +4140,11 @@ public final class MessageTypeProto {
|
|||
*跨服天梯挑战与被挑战 战斗记录
|
||||
* </pre>
|
||||
*/
|
||||
GetWorldArenaRecordInfoRequest(664, 900007),
|
||||
GetWorldArenaRecordInfoRequest(668, 900007),
|
||||
/**
|
||||
* <code>GetWorldArenaRecordInfoResponse = 900008;</code>
|
||||
*/
|
||||
GetWorldArenaRecordInfoResponse(665, 900008),
|
||||
GetWorldArenaRecordInfoResponse(669, 900008),
|
||||
/**
|
||||
* <code>GetGSUserArenaInfoRequest = 900009;</code>
|
||||
*
|
||||
|
|
@ -4128,15 +4152,27 @@ public final class MessageTypeProto {
|
|||
*gs --》word
|
||||
* </pre>
|
||||
*/
|
||||
GetGSUserArenaInfoRequest(666, 900009),
|
||||
GetGSUserArenaInfoRequest(670, 900009),
|
||||
/**
|
||||
* <code>GetGSUserArenaInfoResponse = 900010;</code>
|
||||
*/
|
||||
GetGSUserArenaInfoResponse(667, 900010),
|
||||
GetGSUserArenaInfoResponse(671, 900010),
|
||||
/**
|
||||
* <code>GetRankRequest = 900011;</code>
|
||||
*/
|
||||
GetRankRequest(668, 900011),
|
||||
GetRankRequest(672, 900011),
|
||||
/**
|
||||
* <code>AddDeathPathRankRequest = 900012;</code>
|
||||
*/
|
||||
AddDeathPathRankRequest(673, 900012),
|
||||
/**
|
||||
* <code>GetDeathPathFirstRequest = 900013;</code>
|
||||
*/
|
||||
GetDeathPathFirstRequest(674, 900013),
|
||||
/**
|
||||
* <code>GetDeathPathRewardRequest = 900014;</code>
|
||||
*/
|
||||
GetDeathPathRewardRequest(675, 900014),
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
@ -8187,6 +8223,30 @@ public final class MessageTypeProto {
|
|||
* <code>SeletSubRewardPoolResponse = 303672;</code>
|
||||
*/
|
||||
public static final int SeletSubRewardPoolResponse_VALUE = 303672;
|
||||
/**
|
||||
* <code>NewGeneralAttackRequest = 303691;</code>
|
||||
*
|
||||
* <pre>
|
||||
*303691 - 303692 新将来袭
|
||||
* </pre>
|
||||
*/
|
||||
public static final int NewGeneralAttackRequest_VALUE = 303691;
|
||||
/**
|
||||
* <code>NewGeneralAttackResponse = 303692;</code>
|
||||
*/
|
||||
public static final int NewGeneralAttackResponse_VALUE = 303692;
|
||||
/**
|
||||
* <code>UpgradeGodTreeRequest = 303701;</code>
|
||||
*
|
||||
* <pre>
|
||||
* 303701 - 303702 建木神树
|
||||
* </pre>
|
||||
*/
|
||||
public static final int UpgradeGodTreeRequest_VALUE = 303701;
|
||||
/**
|
||||
* <code>UpgradeGodTreeResponse = 303702;</code>
|
||||
*/
|
||||
public static final int UpgradeGodTreeResponse_VALUE = 303702;
|
||||
/**
|
||||
* <code>GetWorldServerRequest = 800001;</code>
|
||||
*
|
||||
|
|
@ -8263,6 +8323,18 @@ public final class MessageTypeProto {
|
|||
* <code>GetRankRequest = 900011;</code>
|
||||
*/
|
||||
public static final int GetRankRequest_VALUE = 900011;
|
||||
/**
|
||||
* <code>AddDeathPathRankRequest = 900012;</code>
|
||||
*/
|
||||
public static final int AddDeathPathRankRequest_VALUE = 900012;
|
||||
/**
|
||||
* <code>GetDeathPathFirstRequest = 900013;</code>
|
||||
*/
|
||||
public static final int GetDeathPathFirstRequest_VALUE = 900013;
|
||||
/**
|
||||
* <code>GetDeathPathRewardRequest = 900014;</code>
|
||||
*/
|
||||
public static final int GetDeathPathRewardRequest_VALUE = 900014;
|
||||
|
||||
|
||||
public final int getNumber() { return value; }
|
||||
|
|
@ -8925,6 +8997,10 @@ public final class MessageTypeProto {
|
|||
case 303656: return GetShejiAwardResponse;
|
||||
case 303671: return SeletSubRewardPoolRequest;
|
||||
case 303672: return SeletSubRewardPoolResponse;
|
||||
case 303691: return NewGeneralAttackRequest;
|
||||
case 303692: return NewGeneralAttackResponse;
|
||||
case 303701: return UpgradeGodTreeRequest;
|
||||
case 303702: return UpgradeGodTreeResponse;
|
||||
case 800001: return GetWorldServerRequest;
|
||||
case 800002: return GetWorldServerResponse;
|
||||
case 900001: return GetWorldArenaInfoRequest;
|
||||
|
|
@ -8938,6 +9014,9 @@ public final class MessageTypeProto {
|
|||
case 900009: return GetGSUserArenaInfoRequest;
|
||||
case 900010: return GetGSUserArenaInfoResponse;
|
||||
case 900011: return GetRankRequest;
|
||||
case 900012: return AddDeathPathRankRequest;
|
||||
case 900013: return GetDeathPathFirstRequest;
|
||||
case 900014: return GetDeathPathRewardRequest;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -8999,7 +9078,7 @@ public final class MessageTypeProto {
|
|||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\026MessageTypeProto.proto\022\rrpc.protocols*" +
|
||||
"\207\253\001\n\013MessageType\022\027\n\022HEART_BEAT_REQUEST\020\350" +
|
||||
"\341\254\001\n\013MessageType\022\027\n\022HEART_BEAT_REQUEST\020\350" +
|
||||
"\007\022\030\n\023HEART_BEAT_RESPONSE\020\351\007\022\036\n\031ACTIVITE_" +
|
||||
"WORKSHOP_REQUEST\020\224N\022\037\n\032ACTIVITE_WORKSHOP" +
|
||||
"_RESPONSE\020\225N\022\027\n\022ARENA_INFO_REQUEST\020\226N\022\030\n" +
|
||||
|
|
@ -9535,18 +9614,23 @@ public final class MessageTypeProto {
|
|||
"tivityItemResponse\020\246\304\022\022\032\n\024GetShejiAwardR" +
|
||||
"equest\020\247\304\022\022\033\n\025GetShejiAwardResponse\020\250\304\022\022" +
|
||||
"\037\n\031SeletSubRewardPoolRequest\020\267\304\022\022 \n\032Sele" +
|
||||
"tSubRewardPoolResponse\020\270\304\022\022\033\n\025GetWorldSe" +
|
||||
"rverRequest\020\201\3520\022\034\n\026GetWorldServerRespons" +
|
||||
"e\020\202\3520\022\036\n\030GetWorldArenaInfoRequest\020\241\3676\022\037\n",
|
||||
"\031GetWorldArenaInfoResponse\020\242\3676\022#\n\035GetWor" +
|
||||
"ldArenaChallengeRequest\020\243\3676\022$\n\036GetWorldA" +
|
||||
"renaChallengeResponse\020\244\3676\022\037\n\031GetWorldAre" +
|
||||
"naProudRequest\020\245\3676\022 \n\032GetWorldArenaProud" +
|
||||
"Response\020\246\3676\022$\n\036GetWorldArenaRecordInfoR" +
|
||||
"equest\020\247\3676\022%\n\037GetWorldArenaRecordInfoRes" +
|
||||
"ponse\020\250\3676\022\037\n\031GetGSUserArenaInfoRequest\020\251" +
|
||||
"\3676\022 \n\032GetGSUserArenaInfoResponse\020\252\3676\022\024\n\016" +
|
||||
"GetRankRequest\020\253\3676B\002H\001"
|
||||
"tSubRewardPoolResponse\020\270\304\022\022\035\n\027NewGeneral" +
|
||||
"AttackRequest\020\313\304\022\022\036\n\030NewGeneralAttackRes" +
|
||||
"ponse\020\314\304\022\022\033\n\025UpgradeGodTreeRequest\020\325\304\022\022\034",
|
||||
"\n\026UpgradeGodTreeResponse\020\326\304\022\022\033\n\025GetWorld" +
|
||||
"ServerRequest\020\201\3520\022\034\n\026GetWorldServerRespo" +
|
||||
"nse\020\202\3520\022\036\n\030GetWorldArenaInfoRequest\020\241\3676\022" +
|
||||
"\037\n\031GetWorldArenaInfoResponse\020\242\3676\022#\n\035GetW" +
|
||||
"orldArenaChallengeRequest\020\243\3676\022$\n\036GetWorl" +
|
||||
"dArenaChallengeResponse\020\244\3676\022\037\n\031GetWorldA" +
|
||||
"renaProudRequest\020\245\3676\022 \n\032GetWorldArenaPro" +
|
||||
"udResponse\020\246\3676\022$\n\036GetWorldArenaRecordInf" +
|
||||
"oRequest\020\247\3676\022%\n\037GetWorldArenaRecordInfoR" +
|
||||
"esponse\020\250\3676\022\037\n\031GetGSUserArenaInfoRequest",
|
||||
"\020\251\3676\022 \n\032GetGSUserArenaInfoResponse\020\252\3676\022\024" +
|
||||
"\n\016GetRankRequest\020\253\3676\022\035\n\027AddDeathPathRank" +
|
||||
"Request\020\254\3676\022\036\n\030GetDeathPathFirstRequest\020" +
|
||||
"\255\3676\022\037\n\031GetDeathPathRewardRequest\020\256\3676B\002H\001"
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -212,7 +212,7 @@ public class AreaManager {
|
|||
|
||||
try {
|
||||
//结算十绝阵
|
||||
DeathPathLogic.deleteDeathPathInfo();
|
||||
DeathPathLogic.getInstance().deleteDeathPathInfo();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,8 +210,8 @@ public class DeathPathLogic {
|
|||
switch (status){
|
||||
case 0:
|
||||
try {
|
||||
groupId = 0;
|
||||
deleteDeathPathInfo();
|
||||
groupId = 0;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -537,11 +537,20 @@ public class DeathPathLogic {
|
|||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
// 根据排名进行随机奖励
|
||||
Long rank = RedisUtil.getInstence().getZSetreverseRank(RedisKey.DEATH_PATH_TOTAL_GUILD_RANK, "", String.valueOf(user.getPlayerInfoManager().getGuildId()));
|
||||
if(rank==-1){
|
||||
int rank;
|
||||
if(groupId>0){
|
||||
WorldProto.GetDeathPathRewardResponse worldResponse = WorldHelper.sendMessageToWorldWithResult(uid, WorldProto.GetDeathPathRewardRequest.newBuilder().setGroupId(groupId).setGuildId(user.getPlayerInfoManager().getGuildId()).build(), WorldProto.GetDeathPathRewardResponse.class);
|
||||
if(worldResponse==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int[] reward = getRewardByRank(rank.intValue());
|
||||
rank = worldResponse.getRankTotal();
|
||||
}else {
|
||||
rank = RedisUtil.getInstence().getZSetreverseRank(RedisKey.DEATH_PATH_TOTAL_GUILD_RANK, "", String.valueOf(user.getPlayerInfoManager().getGuildId())).intValue();
|
||||
}
|
||||
if(rank==-1||rank==0){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int[] reward = getRewardByRank(rank);
|
||||
countInfo.putUserReward(uid,new DeathReward(reward[0],reward[1],position,user.getPlayerInfoManager().getNickName()));
|
||||
RedisUtil.getInstence().set(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(guildId),countInfo);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, new int[][]{reward}, BIReason.DEATH_PAHT_RANDOM_REWARD);
|
||||
|
|
@ -571,10 +580,33 @@ public class DeathPathLogic {
|
|||
return new int[]{reward[0],reward[1]};
|
||||
}
|
||||
//清除排行信息
|
||||
public static void deleteDeathPathInfo() throws Exception {
|
||||
|
||||
//todo 邮件自动发奖
|
||||
public void deleteDeathPathInfo() throws Exception {
|
||||
RedisUtil redisUtil = RedisUtil.getInstence();
|
||||
String mailTitle = SErrorCodeEerverConfig.getI18NMessage("guildwar_reward_title");
|
||||
String mailContent = SErrorCodeEerverConfig.getI18NMessage("guildwar_reward_txt");
|
||||
|
||||
if(groupId>0){
|
||||
//是否跨服
|
||||
WorldProto.DeathPathWorldRewardResponse rewardResponse = WorldHelper.sendMessageToWorldWithResult(0, WorldProto.DeathPathWorldRewardRequest.newBuilder().build(), WorldProto.DeathPathWorldRewardResponse.class);
|
||||
|
||||
if(rewardResponse==null){
|
||||
LOGGER.error("无排行信息");
|
||||
return;
|
||||
}
|
||||
for(WorldProto.GuildRank rank:rewardResponse.getRanksList()){
|
||||
int[] rewardByRank = getRewardByRank(rank.getRank());
|
||||
DeathChallengeCount reward = redisUtil.getObject(String.valueOf(rank.getGuildId()), DeathChallengeCount.class);
|
||||
if(reward!=null&&reward.getUserReward().size()!=0){
|
||||
Map<Integer, DeathReward> userReward = reward.getUserReward();
|
||||
for(Map.Entry<Integer, DeathReward> rewardEntry:userReward.entrySet()){
|
||||
if(rewardEntry.getValue().getPosition()==0){
|
||||
MailLogic.getInstance().sendMail(rewardEntry.getKey(),mailTitle,mailContent,rewardByRank[0]+"#"+rewardByRank[1],TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//本服发奖
|
||||
AbstractRank guildRank = RankContext.getRankEnum(RankEnum.DEATH_PATH_TOTAL_GUILD_RANK.getType());
|
||||
AbstractRank personRank = RankContext.getRankEnum(RankEnum.DEATH_PATH_TOTAL_PERSON_RANK.getType());
|
||||
Set<ZSetOperations.TypedTuple<String>> guildRankSet = guildRank.getRankByKey("", 0, -1);
|
||||
|
|
@ -594,8 +626,7 @@ public class DeathPathLogic {
|
|||
removePersonKey[index] = RedisKey.getKey(RedisKey.DEATH_PATH_CHALLENGE_COUNT, item.getValue(),false);
|
||||
index++;
|
||||
}
|
||||
String mailTitle = SErrorCodeEerverConfig.getI18NMessage("guildwar_reward_title");
|
||||
String mailContent = SErrorCodeEerverConfig.getI18NMessage("guildwar_reward_txt");
|
||||
|
||||
index = 1;
|
||||
for(String key:removeGuildKey){
|
||||
int[] rewardByRank = getRewardByRank(index);
|
||||
|
|
@ -618,6 +649,8 @@ public class DeathPathLogic {
|
|||
}
|
||||
redisUtil.del(RedisKey.getKey(guildRank.getRedisKey(),"",false));
|
||||
redisUtil.del(RedisKey.getKey(personRank.getRedisKey(),"",false));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static int nextDiscrete(double[] probs) {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,14 @@ import com.world.logic.rank.AbstractCrossRank;
|
|||
import com.world.logic.rank.DeathPathCrossEveryPersonRank;
|
||||
import com.world.redis.RedisKey;
|
||||
import com.world.redis.RedisUtil;
|
||||
import org.luaj.vm2.ast.Str;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import rpc.net.RpcMessage;
|
||||
import rpc.net.gtGBaseHandler;
|
||||
import rpc.world.WorldProto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
|
|
@ -23,13 +26,23 @@ public class AddDeathPathRankRequestHandler extends gtGBaseHandler<WorldProto.Ad
|
|||
RedisUtil redisUtil = RedisUtil.getInstence();
|
||||
//操作每个关的公会、个人数据
|
||||
BigDecimal decimal = new BigDecimal(String.valueOf(proto.getDamage())).divide(new BigDecimal(String.valueOf(Math.pow(10,15))));
|
||||
int everyGuildChangeScore = proto.getDamage()*1000;
|
||||
long everyGuildChangeScore = (long)proto.getDamage()*1000;
|
||||
if(redisUtil.getZSetScore(proto.getGroupId()+":"+RedisKey.DEATH_PATH_EVERY_PERSON_RANK,String.valueOf(proto.getPathId()), String.valueOf(proto.getUid()))==-1){
|
||||
decimal = decimal.add(new BigDecimal(1));
|
||||
// decimal = decimal.add(new BigDecimal(0));
|
||||
//记录人数操作
|
||||
everyGuildChangeScore = everyGuildChangeScore+1;
|
||||
}
|
||||
|
||||
String before= firstGuild(redisUtil, proto.getGroupId(), proto.getPathId());
|
||||
redisUtil.incrementZsetScore(proto.getGroupId()+":"+RedisKey.DEATH_PATH_EVERY_GUILD_RANK,String.valueOf(proto.getPathId()),String.valueOf(proto.getGuildId()), everyGuildChangeScore);
|
||||
String after = firstGuild(redisUtil, proto.getGroupId(), proto.getPathId());
|
||||
if(!before.equals(after)){
|
||||
decimal = decimal.add(new BigDecimal(1));
|
||||
if(!"".equals(before)){
|
||||
redisUtil.incrementZsetScore(proto.getGroupId()+":"+RedisKey.DEATH_PATH_TOTAL_GUILD_RANK,"",before, -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
redisUtil.incrementZsetScore(proto.getGroupId()+":"+RedisKey.DEATH_PATH_EVERY_PERSON_RANK,String.valueOf(proto.getPathId()),String.valueOf(proto.getUid()), proto.getDamage());
|
||||
|
||||
|
|
@ -39,9 +52,17 @@ public class AddDeathPathRankRequestHandler extends gtGBaseHandler<WorldProto.Ad
|
|||
redisUtil.incrementZsetScore(proto.getGroupId()+":"+RedisKey.DEATH_PATH_TOTAL_PERSON_RANK,"",String.valueOf(proto.getUid()), proto.getDamage());
|
||||
|
||||
//操作总的工会伤害
|
||||
|
||||
redisUtil.incrementZsetScore(proto.getGroupId()+":"+RedisKey.DEATH_PATH_TOTAL_GUILD_RANK,"",String.valueOf(proto.getGuildId()), decimal.doubleValue());
|
||||
|
||||
redisUtil.hset(RedisKey.DEATH_PATH_EVERY_OVER_HASH,String.valueOf(rpcMessage.getServerId()),1);
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
private String firstGuild(RedisUtil redisUtil,int groupId,int pathId){
|
||||
Set<ZSetOperations.TypedTuple<String>> scores = redisUtil.getZsetreverseRangeWithScores(groupId + ":" + RedisKey.DEATH_PATH_EVERY_GUILD_RANK, String.valueOf(pathId), 0, 0);
|
||||
return scores.iterator().hasNext()?scores.iterator().next().getValue():"";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.world.handler;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.logic.dao.GuildInfoCache;
|
||||
import com.ljsd.jieling.logic.dao.PlayerInfoCache;
|
||||
import com.world.logic.rank.AbstractCrossRank;
|
||||
import com.world.logic.rank.DeathPathCrossEveryGuildRank;
|
||||
import com.world.logic.rank.DeathPathCrossTotalGuildRank;
|
||||
import com.world.redis.RedisKey;
|
||||
import com.world.redis.RedisUtil;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import rpc.net.RpcMessage;
|
||||
import rpc.net.gtGBaseHandler;
|
||||
import rpc.world.WorldProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/12/15
|
||||
* @discribe
|
||||
*/
|
||||
public class DeathPathWorldRewardRequestHandler extends gtGBaseHandler<WorldProto.DeathPathWorldRewardRequest> {
|
||||
private static Set<Integer> groupIds = new HashSet<>();
|
||||
@Override
|
||||
public WorldProto.DeathPathWorldRewardResponse processWithProto(RpcMessage rpcMessage, WorldProto.DeathPathWorldRewardRequest proto) throws Exception {
|
||||
if(TimeUtils.getHourOfDay()!=0){
|
||||
return null;
|
||||
}
|
||||
groupIds.add(proto.getGroupId());
|
||||
int serverId = rpcMessage.getServerId();
|
||||
Set<ZSetOperations.TypedTuple<String>> values = RedisUtil.getInstence().getZsetreverseRangeWithScores(proto.getGroupId()+":" + RedisKey.DEATH_PATH_TOTAL_GUILD_RANK, "", 0, -1);
|
||||
|
||||
WorldProto.DeathPathWorldRewardResponse.Builder builder = WorldProto.DeathPathWorldRewardResponse.newBuilder();
|
||||
int rank =0;
|
||||
for(ZSetOperations.TypedTuple<String> value:values){
|
||||
rank++;
|
||||
GuildInfoCache guild = new DeathPathCrossTotalGuildRank(RedisKey.DEATH_PATH_TOTAL_PERSON_RANK).getCrossGuild(Integer.valueOf(value.getValue()));
|
||||
if(guild==null||guild.getServerId()!=serverId){
|
||||
continue;
|
||||
}
|
||||
builder.addRanks(WorldProto.GuildRank.newBuilder().setGuildId(Integer.parseInt(value.getValue())).setRank(rank).build());
|
||||
}
|
||||
RedisUtil.getInstence().hdel(RedisKey.DEATH_PATH_EVERY_OVER_HASH,String.valueOf(rpcMessage.getServerId()));
|
||||
|
||||
Map<Object, Object> hmget = RedisUtil.getInstence().hmget(RedisKey.DEATH_PATH_EVERY_OVER_HASH);
|
||||
groupIds.add(proto.getGroupId());
|
||||
if(hmget==null||hmget.size()<1){
|
||||
groupIds.forEach(n->{
|
||||
RedisUtil.getInstence().del(n+":"+RedisKey.DEATH_PATH_EVERY_GUILD_RANK+"*");
|
||||
RedisUtil.getInstence().del(n+":"+RedisKey.DEATH_PATH_EVERY_PERSON_RANK+"*");
|
||||
RedisUtil.getInstence().del(n+":"+RedisKey.DEATH_PATH_TOTAL_GUILD_RANK+"*");
|
||||
RedisUtil.getInstence().del(n+":"+RedisKey.DEATH_PATH_TOTAL_PERSON_RANK+"*");
|
||||
|
||||
});
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ public class GetDeathPathFirstRequestHandler extends gtGBaseHandler<WorldProto.G
|
|||
ZSetOperations.TypedTuple<String> next = iterator.next();
|
||||
int guildId = Integer.parseInt(next.getValue());
|
||||
GuildInfoCache crossGuild = deathPathCrossEveryGuildRank.getCrossGuild(guildId);
|
||||
String name = MongoUtil.getInstence().getServerNameById(rpcMessage.getServerId());
|
||||
String name = MongoUtil.getInstence().getServerNameById(crossGuild.getServerId());
|
||||
WorldProto.EvertDeathPath info = WorldProto.EvertDeathPath.newBuilder().setGuildName(crossGuild.getGuildName()).setPathId(i).setGid(guildId).setServerName(name).build();
|
||||
response.addDeathPathInfo(info);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.world.handler;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.world.redis.RedisKey;
|
||||
import com.world.redis.RedisUtil;
|
||||
import rpc.net.RpcMessage;
|
||||
import rpc.net.gtGBaseHandler;
|
||||
import rpc.world.WorldProto;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/12/14
|
||||
* @discribe
|
||||
*/
|
||||
public class GetDeathPathRewardRequestHandler extends gtGBaseHandler<WorldProto.GetDeathPathRewardRequest> {
|
||||
@Override
|
||||
public WorldProto.GetDeathPathRewardResponse processWithProto(RpcMessage rpcMessage, WorldProto.GetDeathPathRewardRequest proto) throws Exception {
|
||||
|
||||
int rank = RedisUtil.getInstence().getZSetreverseRank(proto.getGroupId() + ":" + RedisKey.DEATH_PATH_TOTAL_GUILD_RANK, "", String.valueOf(proto.getGuildId())).intValue();
|
||||
|
||||
|
||||
return WorldProto.GetDeathPathRewardResponse.newBuilder().setRankTotal(rank).build();
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,8 @@ package com.world.handler;
|
|||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.world.logic.arean.ArenaEnemy;
|
||||
import com.world.logic.arean.ArenaLogic;
|
||||
import com.world.redis.RedisKey;
|
||||
import com.world.redis.RedisUtil;
|
||||
import rpc.net.RpcMessage;
|
||||
import rpc.net.gtGBaseHandler;
|
||||
import rpc.protocols.CommonProto;
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ public abstract class AbstractCrossRank extends AbstractRank {
|
|||
return RedisUtil.getInstence().getZSetScore(redisKey,rkey, String.valueOf(uid));
|
||||
}
|
||||
|
||||
protected PlayerInfoCache getCrossUser(int id){
|
||||
public PlayerInfoCache getCrossUser(int id){
|
||||
PlayerInfoCache crossUser = crossUserMap.get(id);
|
||||
if(crossUser==null){
|
||||
crossUser = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(id), PlayerInfoCache.class);
|
||||
|
|
|
|||
|
|
@ -41,4 +41,6 @@ public class RedisKey {
|
|||
|
||||
public static final String WORLD_ARENA_MY_PRON = "WORLD_ARENA_MY_PRON";//我的膜拜记录
|
||||
|
||||
public static final String DEATH_PATH_EVERY_OVER_HASH = "DEATH_PATH_EVERY_OVER_HASH";//结算标识
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue