back_recharge
zhangshanxue 2019-12-12 11:04:10 +08:00
commit efb20d445e
4 changed files with 23 additions and 3 deletions

View File

@ -1155,8 +1155,7 @@ public class ActivityLogic {
} }
public void getNextActivityId(ISession session, int activityId, MessageTypeProto.MessageType messageType) throws Exception { public void getNextActivityId(ISession session, int activityId, MessageTypeProto.MessageType messageType) throws Exception {
User user = UserManager.getUser(session.getUid()); User user = UserManager.getUser(session.getUid());
int type = SGlobalActivity.getsGlobalActivityMap().get(activityId).getType(); List<SGlobalActivity> sGlobalActivities = SGlobalActivity.sGlobalActivityMapByType.get(activityId);
List<SGlobalActivity> sGlobalActivities = SGlobalActivity.sGlobalActivityMapByType.get(type);
if(sGlobalActivities.isEmpty()){ if(sGlobalActivities.isEmpty()){
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN); throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
} }

View File

@ -36,6 +36,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import util.MathUtils; import util.MathUtils;
import util.StringUtil; import util.StringUtil;
import util.TimeUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
@ -186,7 +187,10 @@ public class HeroLogic{
heroManager.updateFirstTenth(); heroManager.updateFirstTenth();
} }
if(sLotterySetting.getLotteryType()==3){ if(sLotterySetting.getLotteryType()==3){
if(!ActivityLogic.getInstance().getActivityStatusByType(user,sLotterySetting.getActivityId())){ //活动抽卡校验
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(sLotterySetting.getActivityId());
long endTimeLong = ToolsUtil.getEndTimeLong(sGlobalActivity.getStartTimeLong(), sGlobalActivity.getEndTimeLong(), sGlobalActivity.getTime(), user.getPlayerInfoManager().getCreateTime(), sGlobalActivity.getGapTime());
if(!ActivityLogic.getInstance().getActivityStatusByType(user,sLotterySetting.getActivityId())|| TimeUtils.now()>endTimeLong){
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN); throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
} }
} }

View File

@ -22,6 +22,13 @@ public class ToolsUtil {
} }
return startTime; return startTime;
} }
public static long getEndTimeLong(long startTimeLong , long endTimeLong,int time,long createUserTime,int dayOut){
long timeLong = getTimeLong(startTimeLong, endTimeLong, time, createUserTime, 2);
long endTime = timeLong - TimeUtils.DAY * dayOut;
return endTime;
}
// //
// /** // /**

View File

@ -46,6 +46,8 @@ public class SGlobalActivity implements BaseConfig {
private int[] foreshow; private int[] foreshow;
private int gapTime;
public static Map<Integer, List<SGlobalActivity>> sGlobalActivityMapByType; public static Map<Integer, List<SGlobalActivity>> sGlobalActivityMapByType;
@ -149,4 +151,12 @@ public class SGlobalActivity implements BaseConfig {
public int[] getForeshow() { public int[] getForeshow() {
return foreshow; return foreshow;
} }
public int getGapTime() {
return gapTime;
}
public void setType(int type) {
this.type = type;
}
} }