排行榜长度修改
parent
0f336e3bd1
commit
cb38612620
|
@ -11,7 +11,7 @@ public enum ActivityTypeEnum {
|
||||||
ONLINEREWARD(ActivityType.OnlineReward, OnlineRewardActivity::new),
|
ONLINEREWARD(ActivityType.OnlineReward, OnlineRewardActivity::new),
|
||||||
SEVENLOGIN(ActivityType.SevenLogin, SevenLoginActivity::new),
|
SEVENLOGIN(ActivityType.SevenLogin, SevenLoginActivity::new),
|
||||||
CHAPTERREWARD(ActivityType.ChapterReward, ChapterRewardActivity::new),
|
CHAPTERREWARD(ActivityType.ChapterReward, ChapterRewardActivity::new),
|
||||||
FIRSTRECHARGE(ActivityType.RechargeTotal, FirstRechargeActivity::new),
|
FIRSTRECHARGE(ActivityType.RechargeTotal, RechargeTotalActivity::new),
|
||||||
// RECHARGETOTAL(ActivityType.RechargeTotal, RechargeTotalActivity::new),
|
// RECHARGETOTAL(ActivityType.RechargeTotal, RechargeTotalActivity::new),
|
||||||
GROWTHFUND(ActivityType.GrowthFund, GrowthFundActivity::new),
|
GROWTHFUND(ActivityType.GrowthFund, GrowthFundActivity::new),
|
||||||
BLESSACTIVITY(ActivityType.BLESSACTIVITY, BlessActivity::new),
|
BLESSACTIVITY(ActivityType.BLESSACTIVITY, BlessActivity::new),
|
||||||
|
|
|
@ -90,11 +90,11 @@ public class UserManager {
|
||||||
|
|
||||||
private static User registerUser(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id) throws Exception {
|
private static User registerUser(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id) throws Exception {
|
||||||
User user = new User(uid);
|
User user = new User(uid);
|
||||||
|
ReportUtil.onReportEvent(user, ReportEventEnum.CREATE_ROLE.getType());//先发送注册事件
|
||||||
UserManager.addUser(user);
|
UserManager.addUser(user);
|
||||||
initPlayer(user,openId,channel,pid,gid,platform,ip,channle_id,bundle_id);
|
initPlayer(user,openId,channel,pid,gid,platform,ip,channle_id,bundle_id);
|
||||||
MongoUtil.getInstence().getMyMongoTemplate().save(user);
|
MongoUtil.getInstence().getMyMongoTemplate().save(user);
|
||||||
PlayerLogic.getInstance().sendTestWelfareMail(user,1,1);
|
PlayerLogic.getInstance().sendTestWelfareMail(user,1,1);
|
||||||
ReportUtil.onReportEvent(user, ReportEventEnum.CREATE_ROLE.getType());
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -301,7 +301,7 @@ public class DeathPathLogic {
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||||
SGuildWarConfig config = STableManager.getConfig(SGuildWarConfig.class).get(pathId);
|
SGuildWarConfig config = STableManager.getConfig(SGuildWarConfig.class).get(pathId);
|
||||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), GlobalsDef.DEATH_PATH_TEAM, 1000, "", GameFightType.DeathPathChallenge, config.getMonsterId(), 3);
|
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), GlobalsDef.DEATH_PATH_TEAM, SGuildSetting.sGuildSetting.getWarTime(), "", GameFightType.DeathPathChallenge, config.getMonsterId(), 3);
|
||||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||||
int damage = fightResult.getCheckResult()[1];
|
int damage = fightResult.getCheckResult()[1];
|
||||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||||
|
|
|
@ -13,7 +13,7 @@ public interface IRank {
|
||||||
|
|
||||||
void addRank(int uid,String rkey,double... data);
|
void addRank(int uid,String rkey,double... data);
|
||||||
|
|
||||||
int getParam1(Double data);
|
long getParam1(Double data);
|
||||||
|
|
||||||
int getParam2(Double data);
|
int getParam2(Double data);
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ public abstract class AbstractRank implements IRank {
|
||||||
* @param score
|
* @param score
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public abstract int[] getDataByScore(Double score);
|
public abstract long[] getDataByScore(Double score);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子类需重写此方法来获得向Redis里添加的数据,根据需要的参数进行组合
|
* 子类需重写此方法来获得向Redis里添加的数据,根据需要的参数进行组合
|
||||||
|
@ -187,19 +187,19 @@ public abstract class AbstractRank implements IRank {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int getParam1(Double data) {
|
public long getParam1(Double data) {
|
||||||
|
|
||||||
return getDataByScore(data).length>0?getDataByScore(data)[0]:0;
|
return getDataByScore(data).length>0?getDataByScore(data)[0]:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getParam2(Double data) {
|
public int getParam2(Double data) {
|
||||||
return getDataByScore(data).length>1?getDataByScore(data)[1]:0;
|
return getDataByScore(data).length>1?(int)(getDataByScore(data)[1]):0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getParam3(Double data) {
|
public int getParam3(Double data) {
|
||||||
return getDataByScore(data).length>2?getDataByScore(data)[2]:0;
|
return getDataByScore(data).length>2?(int)(getDataByScore(data)[2]):0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getScoreById(int uid,String rkey){
|
public double getScoreById(int uid,String rkey){
|
||||||
|
|
|
@ -16,8 +16,8 @@ public class CarDealyGuildRank extends AbstractRank{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{(int) (score.longValue()/1000),(int) (score.longValue()%1000)};
|
return new long[]{(int) (score.longValue()/1000),(int) (score.longValue()%1000)};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,8 +14,8 @@ public class CarDealyRank extends AbstractRank{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -34,8 +34,8 @@ public class DeathPathEveryGuildRank extends AbstractRank {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{(int)(score/1000),(int)(score%1000)};
|
return new long[]{(long)(score/1000),(int)(score%1000)};
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getScore(double... data) {
|
public double getScore(double... data) {
|
||||||
|
|
|
@ -14,8 +14,8 @@ public class DeathPathEveryPersonRank extends AbstractRank {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.longValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -23,9 +23,9 @@ public class DeathPathTotalGuildRank extends AbstractRank{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
BigDecimal bigDecimal = new BigDecimal(score.toString()).subtract(new BigDecimal(score.intValue())).multiply(new BigDecimal(String.valueOf(Math.pow(10,15))));
|
BigDecimal bigDecimal = new BigDecimal(score.toString()).subtract(new BigDecimal(score.intValue())).multiply(new BigDecimal(String.valueOf(Math.pow(10,15))));
|
||||||
return new int[]{bigDecimal.intValue(),score.intValue()};
|
return new long[]{bigDecimal.longValue(),score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,7 +38,7 @@ public class DeathPathTotalGuildRank extends AbstractRank{
|
||||||
return decimal.doubleValue();
|
return decimal.doubleValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void getOptional(int index, ZSetOperations.TypedTuple<String> data, PlayerInfoProto.RankResponse.Builder builder) throws Exception {
|
protected void getOptional(int index, ZSetOperations.TypedTuple<String> data, PlayerInfoProto.RankResponse.Builder builder) throws Exception {
|
||||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(Integer.parseInt(data.getValue()));
|
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(Integer.parseInt(data.getValue()));
|
||||||
DeathChallengeCount countInfo = RedisUtil.getInstence().get(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(guildInfo.getId()), DeathChallengeCount.class);
|
DeathChallengeCount countInfo = RedisUtil.getInstence().get(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(guildInfo.getId()), DeathChallengeCount.class);
|
||||||
CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder()
|
CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder()
|
||||||
|
|
|
@ -14,8 +14,8 @@ public class DeathPathTotalPersonRank extends AbstractRank {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.longValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -37,8 +37,8 @@ public class ForceCurrRank extends AbstractRank implements IEventHandler{
|
||||||
private static ScheduledThreadPoolExecutor executor;
|
private static ScheduledThreadPoolExecutor executor;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,8 +13,8 @@ public class ForceRank extends AbstractRank {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -15,8 +15,8 @@ public class GoldRank extends AbstractRank {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,8 +10,8 @@ public class GuildBossRank extends AbstractRank{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -25,8 +25,8 @@ public class GuildForceRank extends AbstractRank {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -22,8 +22,8 @@ public class GuildRedPackageRank extends AbstractRank {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -22,9 +22,9 @@ public class MainLevelRank extends AbstractRank {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
int i = score.intValue();
|
int i = score.intValue();
|
||||||
return new int[]{i%10_000_000};
|
return new long[]{i%10_000_000};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,8 +13,8 @@ public class MonsterAttackRank extends AbstractRank{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -70,8 +70,8 @@ public class RandomCardPerfectRank extends AbstractRank {
|
||||||
builder.addRanks(everyRank);
|
builder.addRanks(everyRank);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,8 +13,8 @@ public class RandomCardRank extends AbstractRank {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
return new int[]{score.intValue()};
|
return new long[]{score.intValue()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,8 +21,8 @@ public class TowerRank extends AbstractRank {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getDataByScore(Double score) {
|
public long[] getDataByScore(Double score) {
|
||||||
int[] array = new int [2];
|
long[] array = new long [2];
|
||||||
int scoreInt = score.intValue();
|
int scoreInt = score.intValue();
|
||||||
array[0] = scoreInt/3601;
|
array[0] = scoreInt/3601;
|
||||||
array[1] =3600-scoreInt%3601;
|
array[1] =3600-scoreInt%3601;
|
||||||
|
|
Loading…
Reference in New Issue