acitvity
parent
b0e090433a
commit
00d007663e
|
|
@ -121,11 +121,9 @@ public class ActivityLogic {
|
|||
ActivityManager activityManager = user.getActivityManager();
|
||||
Map<Integer, SGlobalActivity> sGlobalActivityMap = SGlobalActivity.getsGlobalActivityMap();
|
||||
for (Integer openActivityId : openActivityIds) {
|
||||
if (activityManager.initAllActivityMission(openActivityId)) {
|
||||
continue;
|
||||
}
|
||||
if(activityManager.getActivityMissionMap().containsKey(openActivityId)){
|
||||
continue;
|
||||
SGlobalActivity sGlobalActivity = sGlobalActivityMap.get(openActivityId);
|
||||
if(!initOtherActivity(user, sGlobalActivity)){
|
||||
activityManager.initAllActivityMission(openActivityId);
|
||||
}
|
||||
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityType(openActivityId);
|
||||
if (abstractActivity == null) {
|
||||
|
|
@ -164,8 +162,9 @@ public class ActivityLogic {
|
|||
if (activityMission != null) {
|
||||
continue;
|
||||
}
|
||||
activityManager.initAllActivityMission(activityId);
|
||||
initOtherActivity(user, sGlobalActivity);
|
||||
if(!initOtherActivity(user, sGlobalActivity)){
|
||||
activityManager.initAllActivityMission(activityId);
|
||||
}
|
||||
openNewActivityIds.add(activityId);
|
||||
} else {
|
||||
ActivityMission activityMission = activityMissionMap.get(activityId);
|
||||
|
|
@ -183,22 +182,24 @@ public class ActivityLogic {
|
|||
|
||||
}
|
||||
|
||||
public void initOtherActivity(User user, SGlobalActivity sGlobalActivity) throws Exception {
|
||||
public boolean initOtherActivity(User user, SGlobalActivity sGlobalActivity) throws Exception {
|
||||
int type = sGlobalActivity.getType();
|
||||
switch (type) {
|
||||
case ActivityType.BLESSACTIVITY:
|
||||
blessInfoInit(user.getActivityManager(), sGlobalActivity.getId());
|
||||
break;
|
||||
return true;
|
||||
case ActivityType.TREASURE:
|
||||
case ActivityType.LUCKYCAT:
|
||||
case ActivityType.SERVERHAPPY:
|
||||
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityType(sGlobalActivity.getId());
|
||||
if (abstractActivity == null) {
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
abstractActivity.initActivity(user);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,28 +22,22 @@ class HeroUpExpectRankActivity extends ExpectRankActivity {
|
|||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if (!(event instanceof HeroUpExpectRankActivity))
|
||||
if (!(event instanceof HeroUpStarEvent))
|
||||
return;
|
||||
User user = UserManager.getUser(((HeroUpStarEvent) event).getUid());
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
// User user = UserManager.getUser(((HeroUpStarEvent) event).getUid());
|
||||
// HeroManager heroManager = user.getHeroManager();
|
||||
SActivityRewardConfig sActivityRewardConfig = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id).get(0);
|
||||
if(sActivityRewardConfig==null)
|
||||
return;
|
||||
int count = 0;
|
||||
for (Hero targetHero:heroManager.getHeroMap().values()) {
|
||||
if(targetHero.getStar()>=sActivityRewardConfig.getValues()[0][0]){
|
||||
count++;
|
||||
}
|
||||
}
|
||||
update(UserManager.getUser(((HeroUpStarEvent) event).getUid()), count);
|
||||
// int count = 0;
|
||||
// for (Hero targetHero:heroManager.getHeroMap().values()) {
|
||||
// if(targetHero.getStar()>=sActivityRewardConfig.getValues()[0][0]){
|
||||
// count++;
|
||||
// }
|
||||
// }
|
||||
update(UserManager.getUser(((HeroUpStarEvent) event).getUid()), 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
void updateProgress(User user, ActivityMission activityMission, int count) {
|
||||
activityMission.setValue(count+activityMission.getValue());
|
||||
String key = RedisKey.getKey(RedisKey.EXPERT_RANK, String.valueOf(id), false);
|
||||
RedisUtil.getInstence().zsetAddOne(key, String.valueOf(user.getId()), count);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ public class StoreLogic {
|
|||
if(SStoreTypeConfig.getsStoreTypeConfigMap().get(storeId).getStoreType() != StoreType.GIFT_STORE.getType()){
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BUY_MATERIAL,sStoreConfig.getGoods()[0][0],itemNum);
|
||||
}
|
||||
if(itemId==10015){
|
||||
if(itemId==10005){
|
||||
Poster.getPoster().dispatchEvent(new GoldEvent(user.getId()));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue