特权优化
parent
480eb4a62f
commit
d07a2260a7
|
@ -368,9 +368,15 @@ public class PlayerLogic {
|
|||
Set<Integer> fixVipId = new HashSet<>();
|
||||
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
||||
//如果这个权限是活动 且永久了 那么需要修复
|
||||
SPrivilegeTypeConfig config = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey());
|
||||
if(vipInfoItem.getValue().getEffectTime()==0){
|
||||
int unlockType = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getUnlockType();
|
||||
if(unlockType==5||(unlockType==4&&SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getContinueTime().length>0)){
|
||||
if (config == null){
|
||||
LOGGER.info("特权刷新删除日志1:{}-{}",vipInfoItem.getKey(),vipInfoItem.getValue().getEffectTime());
|
||||
removePrivileges.add(vipInfoItem.getKey());
|
||||
continue;
|
||||
}
|
||||
int unlockType = config.getUnlockType();
|
||||
if(unlockType==5||(unlockType==4&& config.getContinueTime().length>0)){
|
||||
fixVipId.add(vipInfoItem.getKey());
|
||||
}
|
||||
}
|
||||
|
@ -391,28 +397,23 @@ public class PlayerLogic {
|
|||
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
||||
privilegeList.add(CommonProto.Privilege.newBuilder()
|
||||
.setId(vipInfoItem.getKey())
|
||||
. setUsedTimes(vipInfoItem.getValue().getCount())
|
||||
.setUsedTimes(vipInfoItem.getValue().getCount())
|
||||
.setEffectTime(vipInfoItem.getValue().getEffectTime())
|
||||
.build());
|
||||
}
|
||||
fBuilder.setHadTakeDailyBox(playerInfoManager.getHadTakeDailyBoxVip())
|
||||
.addAllPrivilege(privilegeList);
|
||||
fBuilder.setHadTakeDailyBox(playerInfoManager.getHadTakeDailyBoxVip()).addAllPrivilege(privilegeList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Set<CommonProto.Privilege> getPrivilege(User user, Collection<Integer> collection) {
|
||||
Map<Integer, VipInfo> vipInfo = user.getPlayerInfoManager().getVipInfo();
|
||||
Set<CommonProto.Privilege> collect = vipInfo.entrySet().stream()
|
||||
return vipInfo.entrySet().stream()
|
||||
.filter(integerVipInfoEntry -> collection.contains(integerVipInfoEntry.getKey()))
|
||||
.map(integerVipInfoEntry -> CommonProto.Privilege.newBuilder()
|
||||
.setId(integerVipInfoEntry.getKey())
|
||||
.setUsedTimes(integerVipInfoEntry.getValue().getCount())
|
||||
.setEffectTime(integerVipInfoEntry.getValue().getEffectTime())
|
||||
.build()).collect(Collectors.toSet());
|
||||
return collect;
|
||||
}
|
||||
|
||||
public void sendVipDailyOrLevlUpReward(User user, int vipLevel,int reson) throws Exception {
|
||||
|
|
Loading…
Reference in New Issue