新礼包
parent
2019129057
commit
c0271abb3d
|
@ -119,8 +119,8 @@ public class ActivityLogic implements IEventHandler{
|
||||||
|
|
||||||
public void flushForLogin(User user,ISession iSession) throws Exception {
|
public void flushForLogin(User user,ISession iSession) throws Exception {
|
||||||
checkActivityIsFinish(user);
|
checkActivityIsFinish(user);
|
||||||
checkActivityOfUser(user, null);
|
|
||||||
sendLuckWheelPool(user,iSession);
|
sendLuckWheelPool(user,iSession);
|
||||||
|
checkActivityOfUser(user, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Instance {
|
public static class Instance {
|
||||||
|
@ -1491,4 +1491,21 @@ public class ActivityLogic implements IEventHandler{
|
||||||
}
|
}
|
||||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.FU_XING_STORE_BUY_RESPONSE_VALUE,null,true);
|
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.FU_XING_STORE_BUY_RESPONSE_VALUE,null,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long[] getStartAndEndTime(User user,int activityId){
|
||||||
|
long[] result = new long[2];
|
||||||
|
long startTime = 0;
|
||||||
|
long endTime = 0;
|
||||||
|
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(activityId);
|
||||||
|
if (sGlobalActivity.getTime() == ActivityType.OPEN_TYPE_ROLE) {
|
||||||
|
startTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(), sGlobalActivity.getEndTimeLong(), sGlobalActivity.getTime(), user.getPlayerInfoManager().getCreateTime(), 1);
|
||||||
|
endTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(), sGlobalActivity.getEndTimeLong(), sGlobalActivity.getTime(), user.getPlayerInfoManager().getCreateTime(), 2);
|
||||||
|
}else{
|
||||||
|
startTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),0, 1);
|
||||||
|
endTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),0, 2);
|
||||||
|
}
|
||||||
|
result[0] = startTime;
|
||||||
|
result[1] = endTime;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -706,6 +706,9 @@ public class BuyGoodsNewLogic {
|
||||||
|
|
||||||
public static void sendReward(int uid,int id,ReceiveWelfareBag bag,int type) throws Exception{
|
public static void sendReward(int uid,int id,ReceiveWelfareBag bag,int type) throws Exception{
|
||||||
int nowTime = (int)(System.currentTimeMillis()/1000);
|
int nowTime = (int)(System.currentTimeMillis()/1000);
|
||||||
|
if(bag.getGetRewardTime() == 0){
|
||||||
|
bag.setGetRewardTime(TimeUtils.getTodayZero() - 24*3600*1000);
|
||||||
|
}
|
||||||
int getDays = TimeUtils.differentDays(bag.getLastBuyTime(),bag.getGetRewardTime());
|
int getDays = TimeUtils.differentDays(bag.getLastBuyTime(),bag.getGetRewardTime());
|
||||||
int canget = TimeUtils.differentDays(bag.getGetRewardTime(),System.currentTimeMillis());
|
int canget = TimeUtils.differentDays(bag.getGetRewardTime(),System.currentTimeMillis());
|
||||||
getRewards(uid,id,getDays,canget,bag.getContinueDays());
|
getRewards(uid,id,getDays,canget,bag.getContinueDays());
|
||||||
|
|
|
@ -9,6 +9,8 @@ import config.SGlobalActivity;
|
||||||
import config.SRechargeCommodityNewConfig;
|
import config.SRechargeCommodityNewConfig;
|
||||||
import util.TimeUtils;
|
import util.TimeUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 时限礼包(活动)
|
* 时限礼包(活动)
|
||||||
*/
|
*/
|
||||||
|
@ -19,9 +21,9 @@ public class TimeLimitWelfareBag extends AbstractWelfareBag {
|
||||||
for(String[] I : getCondition()){
|
for(String[] I : getCondition()){
|
||||||
if(I[0].equals("3")){
|
if(I[0].equals("3")){
|
||||||
if(ActivityLogic.checkActivityOpen(user,Integer.parseInt(I[1]))){
|
if(ActivityLogic.checkActivityOpen(user,Integer.parseInt(I[1]))){
|
||||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(Integer.parseInt(I[1]));
|
long[] result = ActivityLogic.getStartAndEndTime(user,Integer.parseInt(I[1]));
|
||||||
setStartTime(sGlobalActivity.getStartTimeLong());
|
setStartTime(result[0]);
|
||||||
setEndTime(sGlobalActivity.getEndTimeLong());
|
setEndTime(result[1]);
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue