Merge branch 'master_test_hw' of http://60.1.1.230/backend/jieling_server into master_test_hw
commit
409b7a3468
|
@ -22,7 +22,7 @@ class RechargeTotalActivity extends AbstractActivity {
|
|||
User user = UserManager.getUser(session.getUid());
|
||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||
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 true;
|
||||
|
|
|
@ -32,18 +32,26 @@ public class LeveGiftEventHander implements IEventHandler {
|
|||
public void onEvent(IEvent event) throws Exception {
|
||||
|
||||
if(event instanceof UserLevelEvent){
|
||||
User user = UserManager.getUser(((UserLevelEvent) event).getUid());
|
||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||
int[] shenZhuangRule = SSpecialConfig.getOnceArrayValue(SSpecialConfig.SHEN_ZHUANG);
|
||||
if(shenZhuangRule!=null&&shenZhuangRule.length>0&&((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 start = onceArrayValue[0];
|
||||
int inter = onceArrayValue[1];
|
||||
if(((UserLevelEvent) event).getLevel()<start){
|
||||
return;
|
||||
}
|
||||
User user = UserManager.getUser(((UserLevelEvent) event).getUid());
|
||||
boolean b = (((UserLevelEvent) event).getLevel() - start) % inter == 0;
|
||||
if(!b){
|
||||
return;
|
||||
}
|
||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||
double saveAmt = rechargeInfo.getSaveAmt();
|
||||
Map.Entry<Integer, Integer> entry = SRechargeCommodityConfig.rechargePlayerLevelMap.floorEntry((int)saveAmt);
|
||||
SRechargeCommodityConfig orDefault = STableManager.getConfig(SRechargeCommodityConfig.class).getOrDefault(entry.getValue(), null);
|
||||
|
@ -67,18 +75,19 @@ public class LeveGiftEventHander implements IEventHandler {
|
|||
// BuyGoodsLogic.sendGiftGooodsIndication(user.getId());
|
||||
|
||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size());
|
||||
BuyGoodsLogic.getGoodsBagInfo(user.getId(), goodsBagInfo,false);
|
||||
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));
|
||||
}
|
||||
giftIndication(user,goodsBagInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void giftIndication(User user,List<CommonProto.GiftGoodsInfo> goodsBagInfo) throws Exception {
|
||||
BuyGoodsLogic.getGoodsBagInfo(user.getId(), goodsBagInfo,false);
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -188,6 +188,15 @@ public class SessionManager implements INetSession<ISession>, INetReceived<ISess
|
|||
LOGGER.error("您的账号已经在其他设备上登陆,请确认账号安全!"+iSession.getId()+"\r\nnew "+newSession.getId());
|
||||
serverKick(iSession,ErrorCode.reloginCode,"您的账号已经在其他设备上登陆,请确认账号安全!");
|
||||
return 1;
|
||||
}else{
|
||||
ISession session = OnlineUserManager.getSessionByUid(uid);
|
||||
if(session!=null){
|
||||
User userInMem = UserManager.getUserInMem(session.getUid());
|
||||
if(userInMem!=null){
|
||||
processUserOfflineData(userInMem,session);
|
||||
}
|
||||
OnlineUserManager.userOffline(session.getUid());
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -96,6 +96,7 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String SKILL_EFFECT_TGMB = "skill_effect_tgmb";//天宫秘宝购买特权带来的攻击提升万分比(只在天宫生效)
|
||||
public static final String GUILD_LEADER_PASS_TIME = "GuildLeaderPassTime";//会长不上线移交时长
|
||||
public static final String GUILD_DISMISS_TIME ="GuildDismissTime";//公会全员不上线解散时长
|
||||
public static final String SHEN_ZHUANG = "ShenZhuang";//神装礼包推送等级
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
|
Loading…
Reference in New Issue