限时神装
parent
75336f12d9
commit
8966f25c5b
|
@ -22,7 +22,7 @@ class RechargeTotalActivity extends AbstractActivity {
|
||||||
User user = UserManager.getUser(session.getUid());
|
User user = UserManager.getUser(session.getUid());
|
||||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||||
int days = TimeUtils.differentDaysByHour(rechargeInfo.getCreateTime(), now,0) + 1;
|
int days = TimeUtils.differentDaysByHour(rechargeInfo.getCreateTime(), now,0) + 1;
|
||||||
if (missionProgress/1000 < values[0][0] || days < values[0][1]) {
|
if (missionProgress <= 0 || days < values[0][1]) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -32,18 +32,26 @@ public class LeveGiftEventHander implements IEventHandler {
|
||||||
public void onEvent(IEvent event) throws Exception {
|
public void onEvent(IEvent event) throws Exception {
|
||||||
|
|
||||||
if(event instanceof UserLevelEvent){
|
if(event instanceof UserLevelEvent){
|
||||||
|
User user = UserManager.getUser(((UserLevelEvent) event).getUid());
|
||||||
|
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||||
|
int[] shenZhuangRule = SSpecialConfig.getOnceArrayValue(SSpecialConfig.SHEN_ZHUANG);
|
||||||
|
if(((UserLevelEvent) event).getLevel()==shenZhuangRule[0]){
|
||||||
|
rechargeInfo.addDyGoodsCanBuyTimes(10001);
|
||||||
|
rechargeInfo.putLevelAndMoneyBagMap(-1,System.currentTimeMillis());
|
||||||
|
|
||||||
|
// rechargeInfo.putLevelAndMoneyBagMap(shenZhuangRule[1],System.currentTimeMillis());
|
||||||
|
giftIndication(user,new ArrayList<>(1));
|
||||||
|
}
|
||||||
int[] onceArrayValue = SSpecialConfig.getOnceArrayValue(SSpecialConfig.DISCOUNT_LEVEL);
|
int[] onceArrayValue = SSpecialConfig.getOnceArrayValue(SSpecialConfig.DISCOUNT_LEVEL);
|
||||||
int start = onceArrayValue[0];
|
int start = onceArrayValue[0];
|
||||||
int inter = onceArrayValue[1];
|
int inter = onceArrayValue[1];
|
||||||
if(((UserLevelEvent) event).getLevel()<start){
|
if(((UserLevelEvent) event).getLevel()<start){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
User user = UserManager.getUser(((UserLevelEvent) event).getUid());
|
|
||||||
boolean b = (((UserLevelEvent) event).getLevel() - start) % inter == 0;
|
boolean b = (((UserLevelEvent) event).getLevel() - start) % inter == 0;
|
||||||
if(!b){
|
if(!b){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
|
||||||
double saveAmt = rechargeInfo.getSaveAmt();
|
double saveAmt = rechargeInfo.getSaveAmt();
|
||||||
Map.Entry<Integer, Integer> entry = SRechargeCommodityConfig.rechargePlayerLevelMap.floorEntry((int)saveAmt);
|
Map.Entry<Integer, Integer> entry = SRechargeCommodityConfig.rechargePlayerLevelMap.floorEntry((int)saveAmt);
|
||||||
SRechargeCommodityConfig orDefault = STableManager.getConfig(SRechargeCommodityConfig.class).getOrDefault(entry.getValue(), null);
|
SRechargeCommodityConfig orDefault = STableManager.getConfig(SRechargeCommodityConfig.class).getOrDefault(entry.getValue(), null);
|
||||||
|
@ -67,18 +75,19 @@ public class LeveGiftEventHander implements IEventHandler {
|
||||||
// BuyGoodsLogic.sendGiftGooodsIndication(user.getId());
|
// BuyGoodsLogic.sendGiftGooodsIndication(user.getId());
|
||||||
|
|
||||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size());
|
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size());
|
||||||
BuyGoodsLogic.getGoodsBagInfo(user.getId(), goodsBagInfo,false);
|
giftIndication(user,goodsBagInfo);
|
||||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
}
|
||||||
if(session!=null){
|
}
|
||||||
if(null!= SimpleTransaction.current()){
|
|
||||||
//获得多个英雄进行协议合并
|
private void giftIndication(User user,List<CommonProto.GiftGoodsInfo> goodsBagInfo) throws Exception {
|
||||||
PlayerInfoProto.AllGiftGoodsIndication.Builder build = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo);
|
BuyGoodsLogic.getGoodsBagInfo(user.getId(), goodsBagInfo,false);
|
||||||
SimpleTransaction.current().dealWhileCommit(new SimpleTransaction.SendTask(build.build(), MessageTypeProto.MessageType.ALL_GIFTGOODS_INDICATION_VALUE));
|
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||||
}
|
if(session!=null){
|
||||||
|
if(null!= SimpleTransaction.current()){
|
||||||
|
//获得多个英雄进行协议合并
|
||||||
|
PlayerInfoProto.AllGiftGoodsIndication.Builder build = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo);
|
||||||
|
SimpleTransaction.current().dealWhileCommit(new SimpleTransaction.SendTask(build.build(), MessageTypeProto.MessageType.ALL_GIFTGOODS_INDICATION_VALUE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,7 @@ public class SSpecialConfig implements BaseConfig {
|
||||||
public static final String SKILL_EFFECT_TGMB = "skill_effect_tgmb";//天宫秘宝购买特权带来的攻击提升万分比(只在天宫生效)
|
public static final String SKILL_EFFECT_TGMB = "skill_effect_tgmb";//天宫秘宝购买特权带来的攻击提升万分比(只在天宫生效)
|
||||||
public static final String GUILD_LEADER_PASS_TIME = "GuildLeaderPassTime";//会长不上线移交时长
|
public static final String GUILD_LEADER_PASS_TIME = "GuildLeaderPassTime";//会长不上线移交时长
|
||||||
public static final String GUILD_DISMISS_TIME ="GuildDismissTime";//公会全员不上线解散时长
|
public static final String GUILD_DISMISS_TIME ="GuildDismissTime";//公会全员不上线解散时长
|
||||||
|
public static final String SHEN_ZHUANG = "ShenZhuang";//神装礼包推送等级
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue