修复等级条件类活动等级变更时不自动刷新的问题
parent
b1ee021450
commit
972238a752
|
|
@ -159,6 +159,8 @@ public class ActivityLogic implements IEventHandler{
|
|||
checkActivityIsFinish(user);
|
||||
sendLuckWheelPool(user,iSession);
|
||||
checkActivityOfUser(user, null);
|
||||
//修复部分活动更改开启等级条件的活动,导致没有及时刷新(之前只有升级的时候才刷新)
|
||||
this.refreshLevelActivty(user);
|
||||
}
|
||||
|
||||
public static class Instance {
|
||||
|
|
@ -2096,4 +2098,31 @@ public class ActivityLogic implements IEventHandler{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新因为活动等级降低的活动,防止只有升级的时候才会刷新
|
||||
* @param user
|
||||
*/
|
||||
public void refreshLevelActivty(User user){
|
||||
List<SGlobalActivity> sGlobalActivities = SGlobalActivity.sGlobalActivityMapByOpenRules.getOrDefault(2,new ArrayList<>(0));
|
||||
for(SGlobalActivity sGlobalActivity : sGlobalActivities){
|
||||
int[] openRules = sGlobalActivity.getOpenRules();
|
||||
if(openRules == null || openRules.length <=0){
|
||||
continue;
|
||||
}
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(sGlobalActivity.getId());
|
||||
if(activityMission!=null && activityMission.getActivityState() == ActivityType.UNOPEN_STATE){
|
||||
if(user.getPlayerInfoManager().getLevel()>=openRules[1]){
|
||||
activityMission.setActivityState(ActivityType.OPEN_STATE);
|
||||
ActivityLogic.getInstance().sendActivityInfo(user,sGlobalActivity.getId());
|
||||
Poster.getPoster().dispatchEvent(new ActivityStateChangeEvent(user.getId(),sGlobalActivity.getId(),ActivityType.OPEN_STATE));
|
||||
if(sGlobalActivity.getType() == ActivityType.GrowthFund){
|
||||
ActivityTypeEnum.getActicityById(sGlobalActivity.getId()).update(user,user.getPlayerInfoManager().getLevel());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue