排行榜分数修正

back_recharge
duhui 2023-02-15 11:03:07 +08:00
parent d516374225
commit 860a126523
3 changed files with 11 additions and 7 deletions

View File

@ -1732,6 +1732,14 @@ public class TimeUtils {
return (Integer.MAX_VALUE - nowInt()) / Math.pow(10, 9);
}
/**
* Integer-now();
*
* @return
*/
public static long getNanoTime() {
return Long.MAX_VALUE - System.nanoTime();
}
/**
* hour

View File

@ -20,12 +20,13 @@ public class CrossRank extends AbstractRank {
@Override
public long[] getDataByScore(Double score) {
return new long[]{score.intValue()};
return new long[]{score.longValue()};
}
@Override
public double getScore(double... data) {
return data[0]+ TimeUtils.getDoubleTime();
String str = (long)data[0] + "." + TimeUtils.getNanoTime();
return Double.parseDouble(str);
}
}

View File

@ -30,11 +30,6 @@ public class GuildForceRank extends AbstractRank {
@Override
public double getScore(double... data) {
// Double zSetScore = RedisUtil.getInstence().getZSetScore(redisKey, "", Integer.toString((int) data[0]));
// if (zSetScore <= 0) {
// return 1800;
// }
// return zSetScore;
return data[0];
}