线上热更,vip刷新
parent
05f2ebf7eb
commit
0c55069829
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"version":"7",
|
||||
"version":"8",
|
||||
"tables":"GlobalActivity"
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"version":"6",
|
||||
"version":"7",
|
||||
"classes":[
|
||||
{"name":"PlayerManager.class","fullName":"com.ljsd.jieling.logic.dao.PlayerManager"}
|
||||
{"name":"PlayerManager.class","fullName":"com.ljsd.jieling.logic.dao.PlayerManager"},
|
||||
{"name":"PlayerLogic.class","fullName":"com.ljsd.jieling.logic.player.PlayerLogic"}
|
||||
]
|
||||
}
|
||||
|
|
@ -563,12 +563,15 @@ public class PlayerManager extends MongoBase {
|
|||
}
|
||||
|
||||
public void vipFlush(Set<Integer> removePrivileges) {
|
||||
System.out.println("开始刷新特权:"+removePrivileges);
|
||||
if (vipInfo.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
System.out.println("开始刷新特权,删除前特权数量:"+vipInfo.size());
|
||||
for (Integer remove : removePrivileges) {
|
||||
vipInfo.remove(remove);
|
||||
}
|
||||
System.out.println("开始刷新特权,删除后特权数量:"+vipInfo.size());
|
||||
for (Map.Entry<Integer, VipInfo> entry : vipInfo.entrySet()) {
|
||||
Integer id = entry.getKey();
|
||||
VipInfo info = entry.getValue();
|
||||
|
|
@ -584,6 +587,7 @@ public class PlayerManager extends MongoBase {
|
|||
vipInfo.put(id,refreshVipInfo);
|
||||
}
|
||||
}
|
||||
System.out.println("刷新特权完成,特权数量:"+vipInfo.size());
|
||||
updateString("vipInfo", vipInfo);
|
||||
setHadTakeDailyBoxVip(-1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -350,28 +350,31 @@ public class PlayerLogic {
|
|||
int nowInt = TimeUtils.nowInt();
|
||||
Map<Integer, VipInfo> vipInfo = playerInfoManager.getVipInfo();
|
||||
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
||||
Integer id = vipInfoItem.getKey();
|
||||
VipInfo info = vipInfoItem.getValue();
|
||||
//如果这个权限是活动 且永久了 那么需要修复
|
||||
SPrivilegeTypeConfig config = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey());
|
||||
SPrivilegeTypeConfig config = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(id);
|
||||
if (config == null){
|
||||
LOGGER.info("特权刷新删除日志1:{}-{}",vipInfoItem.getKey(),vipInfoItem.getValue().getEffectTime());
|
||||
removePrivileges.add(vipInfoItem.getKey());
|
||||
LOGGER.info("特权刷新删除日志1:{};{};{}",user.getId(), id, info.getEffectTime());
|
||||
removePrivileges.add(id);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(vipInfoItem.getValue().getEffectTime() == 0){
|
||||
if(info.getEffectTime() == 0){
|
||||
int unlockType = config.getUnlockType();
|
||||
if(unlockType==5 || (unlockType==4 && config.getContinueTime().length>0)){
|
||||
playerInfoManager.addVipByTime(vipInfoItem.getKey(), nowInt);
|
||||
playerInfoManager.addVipByTime(id, nowInt);
|
||||
}
|
||||
}
|
||||
else if(vipInfoItem.getValue().getEffectTime() <= nowInt){
|
||||
else if(info.getEffectTime() <= nowInt){
|
||||
if(config.getPrivilegeType() == VipPrivilegeType.ADVENTURE_BASE_REWARD){
|
||||
CombatLogic.getInstance().getNewAdventureReward(user,true,vipInfoItem.getValue().getEffectTime());
|
||||
CombatLogic.getInstance().getNewAdventureReward(user,true, info.getEffectTime());
|
||||
}
|
||||
removePrivileges.add(vipInfoItem.getKey());
|
||||
LOGGER.info("特权刷新删除日志2:{}-{}",vipInfoItem.getKey(),vipInfoItem.getValue().getEffectTime());
|
||||
removePrivileges.add(id);
|
||||
LOGGER.info("特权刷新删除日志2:{};{};{}",user.getId(), id, info.getEffectTime());
|
||||
}
|
||||
}
|
||||
LOGGER.info("特权刷新删除日志3:{};{}",user.getId(),removePrivileges);
|
||||
playerInfoManager.vipFlush(removePrivileges);
|
||||
|
||||
// vip刷新后才能发给前端
|
||||
|
|
|
|||
Loading…
Reference in New Issue