兽潮排行榜

lvxinran 2019-12-17 05:46:08 +08:00
parent bacf2fc3b3
commit c8ddf8c077
3 changed files with 10 additions and 4 deletions

View File

@ -19,7 +19,7 @@ public class RankHandler extends BaseHandler<PlayerInfoProto.RankRequest> {
@Override @Override
public void processWithProto(ISession iSession, PlayerInfoProto.RankRequest proto) throws Exception { public void processWithProto(ISession iSession, PlayerInfoProto.RankRequest proto) throws Exception {
MapLogic.getInstance().getTowerRank(iSession,proto.getType(),MessageTypeProto.MessageType.GET_ONE_RANK_RESPONSE); // MapLogic.getInstance().getTowerRank(iSession,proto.getType(),MessageTypeProto.MessageType.GET_ONE_RANK_RESPONSE);
// RankLogic.getInstance().getRank(iSession,proto.getType(),MessageTypeProto.MessageType.GET_ONE_RANK_RESPONSE); RankLogic.getInstance().getRank(iSession,proto.getType(),MessageTypeProto.MessageType.GET_ONE_RANK_RESPONSE);
} }
} }

View File

@ -20,6 +20,8 @@ import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.fight.*; import com.ljsd.jieling.logic.fight.*;
import com.ljsd.jieling.logic.fight.result.FightResult; import com.ljsd.jieling.logic.fight.result.FightResult;
import com.ljsd.jieling.logic.mission.GameEvent; import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.rank.RankContext;
import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.network.session.ISession; import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto; import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.FightInfoProto; import com.ljsd.jieling.protocols.FightInfoProto;
@ -117,8 +119,9 @@ public class QuickStartMonsterFighter extends BaseHandler<FightInfoProto.QuickSt
} }
//排行榜 //排行榜
String rankKey = RedisKey.getKey(RedisKey.MONSTER_ATTACK_RANK,"", false); // String rankKey = RedisKey.getKey(RedisKey.MONSTER_ATTACK_RANK,"", false);
RedisUtil.getInstence().zsetAddOneOffsetByTime(rankKey, String.valueOf(user.getId()), fightId); // RedisUtil.getInstence().zsetAddOneOffsetByTime(rankKey, String.valueOf(user.getId()), fightId);
RankContext.getRankEnum(RankEnum.MONSTER_ATTACK_RANK.getType()).addRank(uid,fightId);
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sFloodConfig.getReward(), BIReason.MONSTERATTACK_REWARD); CommonProto.Drop.Builder drop = ItemUtil.drop(user, sFloodConfig.getReward(), BIReason.MONSTERATTACK_REWARD);
FightInfoProto.QuickStartMonsterFightResponse builder = FightInfoProto.QuickStartMonsterFightResponse.newBuilder() FightInfoProto.QuickStartMonsterFightResponse builder = FightInfoProto.QuickStartMonsterFightResponse.newBuilder()

View File

@ -40,6 +40,9 @@ public abstract class AbstractRank implements IRank {
} }
int start = (page - 1) * rankEndLine, end = page * rankEndLine - 1; int start = (page - 1) * rankEndLine, end = page * rankEndLine - 1;
Set<ZSetOperations.TypedTuple<String>> zsetreverseRangeWithScores = getRankByKey(start,end); Set<ZSetOperations.TypedTuple<String>> zsetreverseRangeWithScores = getRankByKey(start,end);
if(start==0){
start=1;
}
PlayerInfoProto.RankResponse.Builder allUserResponse = getAllUserResponse(zsetreverseRangeWithScores,start); PlayerInfoProto.RankResponse.Builder allUserResponse = getAllUserResponse(zsetreverseRangeWithScores,start);
//当前用户信息 //当前用户信息
getMyInfo(user,allUserResponse); getMyInfo(user,allUserResponse);