十绝阵删除信息修改

lvxinran 2020-12-25 10:19:50 +08:00
parent 5cd2499af6
commit e086fd1e97
4 changed files with 48 additions and 27 deletions

View File

@ -4173,6 +4173,10 @@ public final class MessageTypeProto {
* <code>GetDeathPathRewardRequest = 900014;</code>
*/
GetDeathPathRewardRequest(675, 900014),
/**
* <code>DeathPathWorldRewardRequest = 900015;</code>
*/
DeathPathWorldRewardRequest(676, 900015),
;
/**
@ -8335,6 +8339,10 @@ public final class MessageTypeProto {
* <code>GetDeathPathRewardRequest = 900014;</code>
*/
public static final int GetDeathPathRewardRequest_VALUE = 900014;
/**
* <code>DeathPathWorldRewardRequest = 900015;</code>
*/
public static final int DeathPathWorldRewardRequest_VALUE = 900015;
public final int getNumber() { return value; }
@ -9017,6 +9025,7 @@ public final class MessageTypeProto {
case 900012: return AddDeathPathRankRequest;
case 900013: return GetDeathPathFirstRequest;
case 900014: return GetDeathPathRewardRequest;
case 900015: return DeathPathWorldRewardRequest;
default: return null;
}
}
@ -9078,7 +9087,7 @@ public final class MessageTypeProto {
static {
java.lang.String[] descriptorData = {
"\n\026MessageTypeProto.proto\022\rrpc.protocols*" +
"\341\254\001\n\013MessageType\022\027\n\022HEART_BEAT_REQUEST\020\350" +
"\204\255\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" +
@ -9630,7 +9639,8 @@ public final class MessageTypeProto {
"\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"
"\255\3676\022\037\n\031GetDeathPathRewardRequest\020\256\3676\022!\n\033" +
"DeathPathWorldRewardRequest\020\257\3676B\002H\001"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {

View File

@ -28,6 +28,7 @@ import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
import com.ljsd.jieling.network.server.GlobalidHelper;
import com.ljsd.jieling.network.server.WorldHelper;
import com.ljsd.jieling.network.session.ISession;
import org.springframework.data.redis.core.Cursor;
import rpc.protocols.CommonProto;
import rpc.protocols.Family;
import rpc.protocols.MessageTypeProto;
@ -223,8 +224,8 @@ public class DeathPathLogic {
tasks.clear();
taskExecutor = new DeathPathExecutor(tasks);
taskExecutor.start();
groupId = GlobalidHelper.getWorldInfo().getMyGroup();
}
groupId = GlobalidHelper.getWorldInfo().getMyGroup();
break;
case 2:
long appointTime = TimeUtils.getAppointTime(0, 0)+TimeUtils.DAY;
@ -263,12 +264,6 @@ public class DeathPathLogic {
*/
public void getStatus(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
int uid = session.getUid();
String key = RedisKey.getKey(RedisKey.DEATH_PATH_CHALLENGE_COUNT, String.valueOf(uid), false);
AbstractRank personRank = RankContext.getRankEnum(RankEnum.DEATH_PATH_TOTAL_PERSON_RANK.getType());
double scoreById = personRank.getScoreById(uid, "");
if(RedisUtil.getInstence().get(key)!=null&&scoreById==-1){
RedisUtil.getInstence().del(key);
}
GuildMyInfo info = UserManager.getUser(uid).getGuildMyInfo();
int joinType =0;
if(info.getJoinTime()<startTime||info.getJoinTime()>overTime) {
@ -641,16 +636,24 @@ public class DeathPathLogic {
}
index++;
}
redisUtil.del(removeGuildKey);
redisUtil.del(removePersonKey);
for(int i = 1; i <=10;i++){
redisUtil.del(RedisKey.getKey(RankEnum.DEATH_PATH_EVERY_GUILD_RANK.getRedisKey(),String.valueOf(i),false));
redisUtil.del(RedisKey.getKey(RankEnum.DEATH_PATH_EVERY_PERSON_RANK.getRedisKey(),String.valueOf(i),false));
}
redisUtil.del(RedisKey.getKey(guildRank.getRedisKey(),"",false));
redisUtil.del(RedisKey.getKey(personRank.getRedisKey(),"",false));
// redisUtil.del(removeGuildKey);
// redisUtil.del(removePersonKey);
// for(int i = 1; i <=10;i++){
// redisUtil.del(RedisKey.getKey(RankEnum.DEATH_PATH_EVERY_GUILD_RANK.getRedisKey(),String.valueOf(i),false));
// redisUtil.del(RedisKey.getKey(RankEnum.DEATH_PATH_EVERY_PERSON_RANK.getRedisKey(),String.valueOf(i),false));
// }
// redisUtil.del(RedisKey.getKey(guildRank.getRedisKey(),"",false));
// redisUtil.del(RedisKey.getKey(personRank.getRedisKey(),"",false));
}
Cursor<String> cursor = RedisUtil.getInstence().scan(GameApplication.serverId+":DEATH_PATH*", -1);
while (cursor.hasNext()) {
//找到一次就添加一次
String next = cursor.next();
LOGGER.info("删除排行{}",next);
RedisUtil.getInstence().del(next);
}
}
public static int nextDiscrete(double[] probs) {

View File

@ -8,6 +8,7 @@ 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.Cursor;
import org.springframework.data.redis.core.ZSetOperations;
import rpc.net.RpcMessage;
import rpc.net.gtGBaseHandler;
@ -25,14 +26,15 @@ public class DeathPathWorldRewardRequestHandler extends gtGBaseHandler<WorldProt
private static Set<Integer> groupIds = new HashSet<>();
@Override
public WorldProto.DeathPathWorldRewardResponse processWithProto(RpcMessage rpcMessage, WorldProto.DeathPathWorldRewardRequest proto) throws Exception {
WorldProto.DeathPathWorldRewardResponse.Builder builder = WorldProto.DeathPathWorldRewardResponse.newBuilder();
if(TimeUtils.getHourOfDay()!=0){
return null;
return builder.build();
}
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++;
@ -45,14 +47,18 @@ public class DeathPathWorldRewardRequestHandler extends gtGBaseHandler<WorldProt
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(proto.getGroupId()!=0)
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+"*");
Cursor<String> cursor = RedisUtil.getInstence().scan(n+":DEATH_PATH*", -1);
while (cursor.hasNext()) {
//找到一次就添加一次
String next = cursor.next();
LOGGER.info("删除排行{}",next);
RedisUtil.getInstence().del(next);
}
});
}
return builder.build();

View File

@ -748,10 +748,12 @@ public class RedisUtil {
}
public Cursor<String> scan(String match, int count){
ScanOptions scanOptions = ScanOptions.scanOptions().match(match).count(count).build();
ScanOptions.ScanOptionsBuilder match1 = ScanOptions.scanOptions().match(match);
if(count!=-1)
match1.count(count);
RedisSerializer<String> redisSerializer = (RedisSerializer<String>) redisTemplate.getKeySerializer();
return (Cursor) redisTemplate.executeWithStickyConnection((RedisCallback) redisConnection ->
new ConvertingCursor<>(redisConnection.scan(scanOptions), redisSerializer::deserialize));
new ConvertingCursor<>(redisConnection.scan(match1.build()), redisSerializer::deserialize));
}
private final static String UNLOCK_SCRIPT = "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end";