跨服灵脉秘境积分计算
parent
0fd3f53795
commit
d7c548f248
|
|
@ -69,15 +69,19 @@ public class CrossLingmaiLogic {
|
|||
SLodeConfig config = SLodeConfig.lodeConfig.get(map.getValue().getId());
|
||||
if (config != null) {
|
||||
int occupyTime = (int) map.getValue().getGetAwardTimeOrOccupyTime();
|
||||
int difVal = (nowTime - occupyTime) / 60 >= 10 ? 10 : (nowTime - occupyTime) / 60;
|
||||
//分钟
|
||||
int minute = (nowTime - occupyTime) / 60 >= 10 ? 10 : (nowTime - occupyTime) / 60;
|
||||
//秒
|
||||
int second = (nowTime - occupyTime) % 60 >= 60 ? 60 : (nowTime - occupyTime) % 60;
|
||||
//difVal =1 ;
|
||||
map.getValue().setOccupyTime(map.getValue().getOccupyTime() + difVal);
|
||||
map.getValue().setGetAwardTimeOrOccupyTime(TimeUtils.nowInt());
|
||||
LOGGER.error("玩家" + map.getValue().getUid() + "获得" + difVal);
|
||||
LOGGER.error("玩家" + map.getValue().getUid() + "原有秒:"+map.getValue().getOccupyTime()+" 获得秒:" + (minute*60+second));
|
||||
map.getValue().setOccupyTime(map.getValue().getOccupyTime() + minute*60+second);
|
||||
map.getValue().setGetAwardTimeOrOccupyTime(nowTime);
|
||||
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.CROSS_LINGMAISECRET_INFO,
|
||||
crossGroup + RedisKey.Delimiter_colon + group, map.getKey(), map.getValue());
|
||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.CROSS_LINGMAI_RANK_PERSON.getType());
|
||||
int score = map.getValue().getOccupyTime() * config.getRewardList()[0][1] + map.getValue().getScore1();
|
||||
int score = map.getValue().getOccupyTime() * (config.getRewardList()[0][1]/60) + map.getValue().getScore1();
|
||||
double test = rank.getScoreById(user.getId(), crossGroup + RedisKey.Delimiter_colon + group);
|
||||
LOGGER.error("之前是:" + test + "之后是:" + score);
|
||||
rank.addRank(user.getId(), String.valueOf(crossGroup) + RedisKey.Delimiter_colon + group, score);
|
||||
|
|
|
|||
Loading…
Reference in New Issue