活动特权修复
parent
742dfb5cbb
commit
6fda647587
|
@ -407,9 +407,10 @@ public class PlayerManager extends MongoBase {
|
||||||
* @param time 以s为单位 结束时间
|
* @param time 以s为单位 结束时间
|
||||||
*/
|
*/
|
||||||
public void addVipByTime(int privilageId,int time){
|
public void addVipByTime(int privilageId,int time){
|
||||||
VipInfo vipInfo = new VipInfo();
|
VipInfo addInfo = new VipInfo();
|
||||||
vipInfo.setEffectTime(time);
|
addInfo.setEffectTime(time);
|
||||||
this.vipInfo.put(privilageId,vipInfo);
|
vipInfo.put(privilageId,addInfo);
|
||||||
|
updateString("vipInfo", this.vipInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean containPrivilageId(int privilageId) {
|
public boolean containPrivilageId(int privilageId) {
|
||||||
|
|
|
@ -306,7 +306,12 @@ public class PlayerLogic {
|
||||||
sendVipDailyOrLevlUpReward(user, vipLevel,BIReason.VIP_DAY_REWARD);
|
sendVipDailyOrLevlUpReward(user, vipLevel,BIReason.VIP_DAY_REWARD);
|
||||||
List<CommonProto.Privilege> privilegeList = new ArrayList<>();
|
List<CommonProto.Privilege> privilegeList = new ArrayList<>();
|
||||||
Map<Integer, VipInfo> vipInfo = playerInfoManager.getVipInfo();
|
Map<Integer, VipInfo> vipInfo = playerInfoManager.getVipInfo();
|
||||||
|
Set<Integer> fixVipId = new HashSet<>();
|
||||||
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
||||||
|
//如果这个权限是活动 且永久了 那么需要修复
|
||||||
|
if(vipInfoItem.getValue().getEffectTime()==0&&SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getPrivilegeType()==5){
|
||||||
|
fixVipId.add(vipInfoItem.getKey());
|
||||||
|
}
|
||||||
if(vipInfoItem.getValue().getEffectTime()!=0 && vipInfoItem.getValue().getEffectTime()<=(TimeUtils.now()/1000)){
|
if(vipInfoItem.getValue().getEffectTime()!=0 && vipInfoItem.getValue().getEffectTime()<=(TimeUtils.now()/1000)){
|
||||||
if(SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getPrivilegeType()==VipPrivilegeType.ADVENTURE_BASE_REWARD){
|
if(SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getPrivilegeType()==VipPrivilegeType.ADVENTURE_BASE_REWARD){
|
||||||
CombatLogic.getInstance().getNewAdventureReward(user,true,vipInfoItem.getValue().getEffectTime());
|
CombatLogic.getInstance().getNewAdventureReward(user,true,vipInfoItem.getValue().getEffectTime());
|
||||||
|
@ -315,6 +320,9 @@ public class PlayerLogic {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!fixVipId.isEmpty()){
|
||||||
|
fixVipId.forEach(n->playerInfoManager.addVipByTime(n,(int)((TimeUtils.now()+TimeUtils.WEEK)/1000)));
|
||||||
|
}
|
||||||
playerInfoManager.vipFlush(removePrivileges);
|
playerInfoManager.vipFlush(removePrivileges);
|
||||||
//vip刷新后才能发给前端
|
//vip刷新后才能发给前端
|
||||||
if(fBuilder!=null){
|
if(fBuilder!=null){
|
||||||
|
|
Loading…
Reference in New Issue