达人排行榜榜单调整 连续充值周期更新
parent
89ffd40206
commit
7d0388eaed
|
|
@ -70,6 +70,9 @@ public class ActivityLogic {
|
|||
Map<Integer, SGlobalActivity> sGlobalActivityMap = SGlobalActivity.getsGlobalActivityMap();
|
||||
for (SGlobalActivity sGlobalActivity : sGlobalActivityMap.values()) {
|
||||
int time = sGlobalActivity.getTime();
|
||||
if(ActivityTypeEnum.getActicityCacheSize()==0){//init cache
|
||||
ActivityTypeEnum.getActicityType(sGlobalActivity.getId());
|
||||
}
|
||||
if (time == 2) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -937,7 +940,7 @@ public class ActivityLogic {
|
|||
|
||||
int start = 0;
|
||||
int maxSize = SGameSetting.getGameSetting().getShowRank();
|
||||
List<CommonProto.ExpertInfo> expertInfos = new ArrayList<>(maxSize);
|
||||
List<CommonProto.ExpertInfo> expertInfos = new LinkedList<>();
|
||||
Set<ZSetOperations.TypedTuple<String>> rankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.FORCE_RANK, Integer.toString(acitvityId), 0, maxSize - 1);
|
||||
for (ZSetOperations.TypedTuple<String> item : rankInfo) {
|
||||
String value = item.getValue();
|
||||
|
|
@ -949,17 +952,21 @@ public class ActivityLogic {
|
|||
CommonProto.ExpertInfo personInfoBuild = CommonProto.ExpertInfo.newBuilder()
|
||||
.setName(playerInfoManager.getNickName())
|
||||
.setScore(score)
|
||||
.setLevel(playerInfoManager.getLevel())
|
||||
.setHeadFrame(playerInfoManager.getHeadFrame())
|
||||
.setHead(0)
|
||||
.setRank(++start)
|
||||
.build();
|
||||
expertInfos.add(personInfoBuild);
|
||||
}
|
||||
|
||||
if (rankInfo.size() > 2 * maxSize) {
|
||||
//删除多余数据 预留一些 长度maxSize
|
||||
String key = RedisKey.getKey(RedisKey.EXPERT_RANK, String.valueOf(acitvityId), false);
|
||||
int size = RedisUtil.getInstence().getZsetSize(key);
|
||||
RedisUtil.getInstence().removeZSetRangeByRank(key, maxSize, size);
|
||||
}
|
||||
//策划要全部数据
|
||||
// if (rankInfo.size() > 2 * maxSize) {
|
||||
// //删除多余数据 预留一些 长度maxSize
|
||||
// String key = RedisKey.getKey(RedisKey.EXPERT_RANK, String.valueOf(acitvityId), false);
|
||||
// int size = RedisUtil.getInstence().getZsetSize(key);
|
||||
// RedisUtil.getInstence().removeZSetRangeByRank(key, maxSize, size);
|
||||
// }
|
||||
|
||||
int uid = session.getUid();
|
||||
int score = RedisUtil.getInstence().getZSetScore(RedisKey.EXPERT_RANK, Integer.toString(acitvityId), Integer.toString(uid)).intValue();
|
||||
|
|
@ -967,10 +974,10 @@ public class ActivityLogic {
|
|||
|
||||
PlayerInfoProto.GetExpertInfoResponse buildResponse = PlayerInfoProto.GetExpertInfoResponse.newBuilder()
|
||||
.setMyRank(myRank)
|
||||
.setMyScore(score)
|
||||
.addAllExpert(expertInfos)
|
||||
.setMyScore(score)
|
||||
.build();
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.GETF_EXPERT_RANK_INFO_REQUEST_VALUE, buildResponse, true);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.GETF_EXPERT_RANK_INFO_RESPONSE_VALUE, buildResponse, true);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ public enum ActivityTypeEnum {
|
|||
}
|
||||
|
||||
public AbstractActivity toActivity(int id) {
|
||||
|
||||
if (acticityCache.containsKey(id)) {
|
||||
return acticityCache.get(id);
|
||||
}
|
||||
|
|
@ -90,6 +89,10 @@ public enum ActivityTypeEnum {
|
|||
// }
|
||||
}
|
||||
|
||||
public static Integer getActicityCacheSize() {
|
||||
return acticityCache.size();
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,13 @@ class RechargeSumDayActivity extends AbstractActivity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onResume(User user) throws Exception {
|
||||
public void onResume(User user) {
|
||||
ActivityManager activityManager = user.getActivityManager();
|
||||
ActivityMission activityMission = activityManager.getActivityMissionMap().get(id);
|
||||
activityMission.setValue(0);
|
||||
if (activityMission.getValue() == SActivityRewardConfig.getsActivityRewardConfigByActivityId(id).size()) {
|
||||
activityMission.initMissionInfo(id);
|
||||
return;
|
||||
}
|
||||
int missionId = SActivityRewardConfig.getRechargeDaySum().get(activityMission.getValue() + 1);
|
||||
if (user.getPlayerInfoManager().getRechargedaily() > SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId).getValues()[0][0]) {
|
||||
activityMission.setValue(activityMission.getValue() + 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue