Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn
commit
447ac9d61b
|
@ -1621,6 +1621,23 @@ public class TimeUtils {
|
|||
// 结果
|
||||
return nowTime - startTime >= weekTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 距离第一时间第几周
|
||||
* 指定时间距离指定时间周末为一周
|
||||
* @param before
|
||||
* @param after
|
||||
* @return
|
||||
*/
|
||||
public static long AfterTimeByWeek(long before, long after) {
|
||||
// 开始时间
|
||||
long startTime = getCurWeekdayByTime(1, 0, before);
|
||||
// 当前时间
|
||||
long nowTime = getCurWeekdayByTime(1, 0, after);
|
||||
// 结果
|
||||
return ((nowTime - startTime)/WEEK)+1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -49,24 +49,18 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler<WorldProto.GetW
|
|||
|
||||
|
||||
WorldProto.GetWorldArenaInfoResponse.Builder builder = WorldProto.GetWorldArenaInfoResponse.newBuilder();
|
||||
long lastOrUnderHour = TimeUtils.getLastOrUnderHour(GameApplication.serverConfig.getCacheOpenTime(), 1, 0, 0, true);
|
||||
SMServerArenaSetting setting = STableManager.getConfig(SMServerArenaSetting.class).get(1);
|
||||
if(setting==null){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
lastOrUnderHour+=TimeUtils.WEEK*(setting.getOpenWeek()-1);
|
||||
if(TimeUtils.now()<lastOrUnderHour){
|
||||
builder.setIsStart(0);
|
||||
}else{
|
||||
builder.setIsStart(1);
|
||||
}
|
||||
long before = TimeUtils.stringToTimeLong2(GameApplication.serverConfig.getOpenTime());
|
||||
long week = TimeUtils.AfterTimeByWeek(before, TimeUtils.now());
|
||||
builder.setIsStart((int) week);
|
||||
|
||||
if (!HandlerLogicThread.checkOpen(UserManager.getUser(iSession.getUid()),sGlobalSystemConfig)) {
|
||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.GetWorldArenaInfoResponse.getNumber(),builder.build(),true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.World_Arena);
|
||||
long diff = (System.currentTimeMillis() - timeControllerOfFunction.getStartTime())/1000;
|
||||
|
||||
|
|
|
@ -46,28 +46,18 @@ public class SevenWorldActivity extends AbstractActivity {
|
|||
SevenWorldActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, SuperBoxEvent.class);
|
||||
Poster.getPoster().listenEvent(this, SevenWorldIntegralEvent.class);
|
||||
// Poster.getPoster().listenEvent(this, SevenWorldIntegralEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
int uid = 0;
|
||||
int param1 = 0;
|
||||
int param2 = 0;
|
||||
// 购买礼包
|
||||
if (event instanceof SuperBoxEvent) {
|
||||
SuperBoxEvent event1 = (SuperBoxEvent) event;
|
||||
uid = event1.getUserId();
|
||||
param1 = event1.getGiftId();
|
||||
}
|
||||
if (event instanceof SevenWorldIntegralEvent) {
|
||||
SevenWorldIntegralEvent event1 = (SevenWorldIntegralEvent) event;
|
||||
uid = event1.getUid();
|
||||
param2 = event1.getIntegral();
|
||||
}
|
||||
if (uid == 0) {
|
||||
if (!(event instanceof SuperBoxEvent)) {
|
||||
return;
|
||||
}
|
||||
SuperBoxEvent event1 = (SuperBoxEvent) event;
|
||||
int uid = event1.getUserId();
|
||||
int param1 = event1.getGiftId();
|
||||
// 验证玩家信息和活动信息
|
||||
User user = UserManager.getUser(uid);
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
|
@ -76,19 +66,10 @@ public class SevenWorldActivity extends AbstractActivity {
|
|||
}
|
||||
// 已购买礼包
|
||||
if (param1 == GIFT) {
|
||||
ActivityProgressInfo info = Optional.ofNullable(mission.getActivityMissionMap()).map(v -> v.get(-1)).orElse(null);
|
||||
if (info != null) {
|
||||
info.setState(1);
|
||||
mission.getActivityMissionMap().put(-1, info);
|
||||
}
|
||||
ActivityProgressInfo info = new ActivityProgressInfo();
|
||||
info.setState(1);
|
||||
mission.getActivityMissionMap().put(-1, info);
|
||||
}
|
||||
// 七界秘宝积分
|
||||
if (param2 > 0){
|
||||
int integralId = STableManager.getConfig(SQijieStage.class).get(FIRST_CHECKPOINT).getTreasureIntegral()[0];
|
||||
ItemUtil.drop(user,new int[][]{{integralId,param2}},BIReason.SEVEN_WORLD_CHALLENGE);
|
||||
}
|
||||
// 状态推送
|
||||
sendActivityProgress(user, mission, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -360,8 +360,6 @@ public class SevenWorldLogic {
|
|||
ItemUtil.drop(user,rewardMap,drop,BIReason.SEVEN_WORLD_CHALLENGE);
|
||||
// 七界秘宝积分,没有加成
|
||||
ItemUtil.drop(user,new int[][]{stage.getTreasureIntegral()},drop,BIReason.SEVEN_WORLD_CHALLENGE);
|
||||
// 事件监听
|
||||
Poster.getPoster().dispatchEvent(new SevenWorldIntegralEvent(user.getId(),stage.getTreasureIntegral()[1]));
|
||||
|
||||
response.setDrop(drop);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ public class SEquipSuiteConfig implements BaseConfig {
|
|||
|
||||
private int[][] suiteValue;
|
||||
|
||||
private int[][] suiteSkill;
|
||||
|
||||
private Map<Integer,Map<Integer,Long>> suiteMap;
|
||||
public static Map<Integer, SEquipSuiteConfig> config;
|
||||
|
||||
|
@ -52,5 +54,7 @@ public class SEquipSuiteConfig implements BaseConfig {
|
|||
return suiteValue;
|
||||
}
|
||||
|
||||
|
||||
public int[][] getSuiteSkill() {
|
||||
return suiteSkill;
|
||||
}
|
||||
}
|
|
@ -46,6 +46,10 @@ public class SMServerArenaSetting implements BaseConfig {
|
|||
|
||||
private int[] privId;
|
||||
private int treasureOpen;
|
||||
|
||||
private int[] scoreRange;
|
||||
|
||||
private int basicScore;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
@ -132,4 +136,12 @@ public class SMServerArenaSetting implements BaseConfig {
|
|||
public int getTreasureOpen() {
|
||||
return treasureOpen;
|
||||
}
|
||||
|
||||
public int[] getScoreRange() {
|
||||
return scoreRange;
|
||||
}
|
||||
|
||||
public int getBasicScore() {
|
||||
return basicScore;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue