跨服,返回第几周
parent
b81acfa9dc
commit
a52efb87e1
|
@ -1621,6 +1621,23 @@ public class TimeUtils {
|
||||||
// 结果
|
// 结果
|
||||||
return nowTime - startTime >= weekTime;
|
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
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -49,24 +49,18 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler<WorldProto.GetW
|
||||||
|
|
||||||
|
|
||||||
WorldProto.GetWorldArenaInfoResponse.Builder builder = WorldProto.GetWorldArenaInfoResponse.newBuilder();
|
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);
|
SMServerArenaSetting setting = STableManager.getConfig(SMServerArenaSetting.class).get(1);
|
||||||
if(setting==null){
|
if(setting==null){
|
||||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||||
}
|
}
|
||||||
lastOrUnderHour+=TimeUtils.WEEK*(setting.getOpenWeek()-1);
|
long before = TimeUtils.stringToTimeLong2(GameApplication.serverConfig.getOpenTime());
|
||||||
if(TimeUtils.now()<lastOrUnderHour){
|
long week = TimeUtils.AfterTimeByWeek(before, TimeUtils.now());
|
||||||
builder.setIsStart(0);
|
builder.setIsStart((int) week);
|
||||||
}else{
|
|
||||||
builder.setIsStart(1);
|
|
||||||
}
|
|
||||||
if (!HandlerLogicThread.checkOpen(UserManager.getUser(iSession.getUid()),sGlobalSystemConfig)) {
|
if (!HandlerLogicThread.checkOpen(UserManager.getUser(iSession.getUid()),sGlobalSystemConfig)) {
|
||||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.GetWorldArenaInfoResponse.getNumber(),builder.build(),true);
|
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.GetWorldArenaInfoResponse.getNumber(),builder.build(),true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.World_Arena);
|
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.World_Arena);
|
||||||
long diff = (System.currentTimeMillis() - timeControllerOfFunction.getStartTime())/1000;
|
long diff = (System.currentTimeMillis() - timeControllerOfFunction.getStartTime())/1000;
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ public class SEquipSuiteConfig implements BaseConfig {
|
||||||
|
|
||||||
private int[][] suiteValue;
|
private int[][] suiteValue;
|
||||||
|
|
||||||
|
private int[][] suiteSkill;
|
||||||
|
|
||||||
private Map<Integer,Map<Integer,Long>> suiteMap;
|
private Map<Integer,Map<Integer,Long>> suiteMap;
|
||||||
public static Map<Integer, SEquipSuiteConfig> config;
|
public static Map<Integer, SEquipSuiteConfig> config;
|
||||||
|
|
||||||
|
@ -52,5 +54,7 @@ public class SEquipSuiteConfig implements BaseConfig {
|
||||||
return suiteValue;
|
return suiteValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[][] getSuiteSkill() {
|
||||||
|
return suiteSkill;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -46,6 +46,10 @@ public class SMServerArenaSetting implements BaseConfig {
|
||||||
|
|
||||||
private int[] privId;
|
private int[] privId;
|
||||||
private int treasureOpen;
|
private int treasureOpen;
|
||||||
|
|
||||||
|
private int[] scoreRange;
|
||||||
|
|
||||||
|
private int basicScore;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
@ -132,4 +136,12 @@ public class SMServerArenaSetting implements BaseConfig {
|
||||||
public int getTreasureOpen() {
|
public int getTreasureOpen() {
|
||||||
return treasureOpen;
|
return treasureOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[] getScoreRange() {
|
||||||
|
return scoreRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBasicScore() {
|
||||||
|
return basicScore;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue