特权商城修改、点金排行榜添加

back_recharge
lvxinran 2020-06-10 14:12:28 +08:00
parent 97782999d1
commit ea57ee2cf7
6 changed files with 51 additions and 3 deletions

View File

@ -265,6 +265,8 @@ public class RedisKey {
public final static String USER_LEVEL_GUILD_INFO = "USER_LEVEL_GUILD_INFO"; //车迟玩法挑战记录
public final static String GOLD_RANK = "GOLD_RANK";//点金排行
public static Set<String> familyKey = new HashSet<>();

View File

@ -10,6 +10,9 @@ import com.ljsd.jieling.logic.activity.event.UserOnlineEvent;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.logic.rank.RankContext;
import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
@ -111,4 +114,11 @@ class BuyGoldActivity extends AbstractActivity {
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.PRIVILLEGE_ADD_INDICATION_VALUE, indication.build(), true);
}
@Override
public void update(User user, int count) {
super.update(user, count);
AbstractRank rank = RankContext.getRankEnum(RankEnum.GOLD_RANK.getType());
rank.addRank(user.getId(),String.valueOf(id),count);
}
}

View File

@ -237,6 +237,11 @@ public class RechargeInfo extends MongoBase{
return refreshBagMap;
}
public void updateRefreshMapByKey(int key,Long time){
refreshBagMap.put(key,time);
updateString("refreshBagMap", refreshBagMap);
}
public int getMonthSaveAmt() {
return monthSaveAmt;
}

View File

@ -28,7 +28,8 @@ public enum RankEnum {
DEATH_PATH_EVERY_GUILD_RANK(16,RedisKey.DEATH_PATH_EVERY_GUILD_RANK, DeathPathEveryGuildRank::new),//param1当前阵公会伤害 param2当前工会挑战人数 param3:无
DEATH_PATH_TOTAL_PERSON_RANK(17,RedisKey.DEATH_PATH_TOTAL_PERSON_RANK,DeathPathTotalPersonRank::new),//param1玩家总伤害 param2无 param3:无
DEATH_PATH_TOTAL_GUILD_RANK(18,RedisKey.DEATH_PATH_TOTAL_GUILD_RANK,DeathPathTotalGuildRank::new),//param1工会总伤害 param2无 param3:无
GUILD_FORCE_RANK(20,RedisKey.GUILD_FORCE_RANK,GuildForceRank::new);//param1公会总战力 param2无 param3:无
GUILD_FORCE_RANK(20,RedisKey.GUILD_FORCE_RANK,GuildForceRank::new),//param1公会总战力 param2无 param3:无
GOLD_RANK(21,RedisKey.GOLD_RANK,GoldRank::new);//param1点金次数 param2无 param3:无
private int type;
private String redisKey;

View File

@ -0,0 +1,26 @@
package com.ljsd.jieling.logic.rank.rankImpl;
import util.TimeUtils;
/**
* @author lvxinran
* @date 2020/6/10
* @discribe
*/
public class GoldRank extends AbstractRank {
public GoldRank(int type, String redisKey) {
super(type, redisKey);
}
@Override
public int[] getDataByScore(Double score) {
return new int[]{score.intValue()};
}
@Override
public double getScore(double... data) {
return data[0]+ TimeUtils.getDoubleTime();
}
}

View File

@ -291,7 +291,9 @@ public class BuyGoodsLogic {
}
MailLogic.getInstance().sendMail(user.getId(),title,content,rewardStr,nowTime, Global.MAIL_EFFECTIVE_TIME);
}
if(sRechargeCommodityConfig.getTime() ==5){
rechargeInfo.updateRefreshMapByKey(sRechargeCommodityConfig.getId(),TimeUtils.now()+sRechargeCommodityConfig.getDailyUpdate()*TimeUtils.DAY);
}
resultRes.setResultCode(1);
KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent,goodsId,orderId,resultRes.getResultCode(),price);
notifyPaySuccessFul(uid,goodsId,amount != -999);
@ -561,7 +563,9 @@ public class BuyGoodsLogic {
endTime += SRechargeCommodityConfig.rechargeCommodityConfigMap.get(sRechargeCommodityConfig.getId()).getDailyUpdate() * TimeUtils.ONE_DAY ;
}
//tofix 不知道源作者想处理什么
if(!refreshBagMap.containsKey(sRechargeCommodityConfig.getId()) || refreshBagMap.get(sRechargeCommodityConfig.getId())!=endTime){
if(sRechargeCommodityConfig.getTime()==5){//5的话是根据玩家购买时间来设置时间
refreshBagMap.putIfAbsent(sRechargeCommodityConfig.getId(),endTime);
}else if(!refreshBagMap.containsKey(sRechargeCommodityConfig.getId()) || refreshBagMap.get(sRechargeCommodityConfig.getId())!=endTime){
refreshBagMap.put(sRechargeCommodityConfig.getId(),endTime);
}