五星成长礼注释
parent
67b85decc5
commit
b838d8b25b
|
@ -13,8 +13,6 @@ import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||||
import com.ljsd.jieling.logic.fight.DefFightSnapData;
|
import com.ljsd.jieling.logic.fight.DefFightSnapData;
|
||||||
import com.ljsd.jieling.logic.fight.FightUtil;
|
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||||
import com.ljsd.jieling.logic.fight.GameFightType;
|
import com.ljsd.jieling.logic.fight.GameFightType;
|
||||||
import com.ljsd.jieling.logic.fight.PVPFightEvent;
|
|
||||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
|
||||||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
|
|
@ -13,13 +13,9 @@ import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||||
import com.ljsd.jieling.logic.activity.FightMainEventHandler;
|
import com.ljsd.jieling.logic.activity.FightMainEventHandler;
|
||||||
import com.ljsd.jieling.logic.activity.RemoveEventHeroHandler;
|
import com.ljsd.jieling.logic.activity.RemoveEventHeroHandler;
|
||||||
import com.ljsd.jieling.logic.activity.UserLevelEventHandler;
|
import com.ljsd.jieling.logic.activity.UserLevelEventHandler;
|
||||||
import com.ljsd.jieling.logic.activity.event.HeroFiveStarGetEvent;
|
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
|
||||||
import com.ljsd.jieling.logic.activity.eventhandler.BuyGoodsDirectHandler;
|
import com.ljsd.jieling.logic.activity.eventhandler.BuyGoodsDirectHandler;
|
||||||
import com.ljsd.jieling.logic.activity.eventhandler.HeroFiveStarGetEventHandler;
|
|
||||||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
||||||
import com.ljsd.jieling.logic.dao.ExpeditionManager;
|
|
||||||
import com.ljsd.jieling.logic.dao.ServerConfig;
|
import com.ljsd.jieling.logic.dao.ServerConfig;
|
||||||
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
||||||
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
||||||
|
|
|
@ -35,6 +35,7 @@ public class HeroFiveStarGetEventHandler implements IEventHandler {
|
||||||
if (!(event instanceof HeroFiveStarGetEvent))
|
if (!(event instanceof HeroFiveStarGetEvent))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//动态控制购买数量
|
||||||
User user = UserManager.getUser(((HeroFiveStarGetEvent) event).getUid());
|
User user = UserManager.getUser(((HeroFiveStarGetEvent) event).getUid());
|
||||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
|
|
|
@ -381,8 +381,6 @@ public class BuyGoodsLogic {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int[] discountType = sRechargeCommodityConfig.getDiscountType();
|
int[] discountType = sRechargeCommodityConfig.getDiscountType();
|
||||||
int time = sRechargeCommodityConfig.getTime();
|
int time = sRechargeCommodityConfig.getTime();
|
||||||
long startTime=0;
|
long startTime=0;
|
||||||
|
@ -404,25 +402,27 @@ public class BuyGoodsLogic {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(type == 4){
|
if(type == 4){
|
||||||
|
//4#妖灵师星级#持续时间
|
||||||
if(!typeBagMap.containsKey(value)){
|
if(!typeBagMap.containsKey(value)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
startTime = typeBagMap.get(value);
|
startTime = typeBagMap.get(value);
|
||||||
|
|
||||||
int addtime = discountType[2];
|
int addtime = discountType[2]*3600;//minute
|
||||||
int diffHour = (int) ((now - startTime) / 3600 / 1000);
|
int diffHour = (int) ((now - startTime) / 1000);
|
||||||
if (diffHour >= addtime) {
|
if (diffHour >= addtime) {
|
||||||
|
//超过2小时重置动态购买次数
|
||||||
rechargeInfo.removeDyGoodsCanBuyTimes(goodsId);
|
rechargeInfo.removeDyGoodsCanBuyTimes(goodsId);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
endTime = startTime + addtime * 3600 * 1000;
|
endTime = startTime + addtime * 1000;//minute
|
||||||
|
|
||||||
if (rechargeInfo.getCacheSendedTypes().containsKey(value)) {
|
if (rechargeInfo.getCacheSendedTypes().containsKey(value)) {
|
||||||
long lasttime = rechargeInfo.getCacheSendedTypes().get(value);
|
long lasttime = rechargeInfo.getCacheSendedTypes().get(value);
|
||||||
if(lasttime != startTime){
|
if(lasttime != startTime){
|
||||||
needChange = true;
|
needChange = true;
|
||||||
rechargeInfo.getCacheSendedTypes().put(value, startTime);
|
rechargeInfo.getCacheSendedTypes().put(value, startTime);
|
||||||
int diffHourTemp = (int) ((now - lasttime) / 3600 / 1000);
|
int diffHourTemp = (int) ((now - lasttime) / 1000);//minute
|
||||||
if (diffHourTemp < addtime) {
|
if (diffHourTemp < addtime) {
|
||||||
startTime =0;
|
startTime =0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue