Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
78905f7b0b
|
@ -1328,17 +1328,17 @@ public class TimeUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*获取传入时间的上个几时或下个几时
|
*获取传入时间的上个几时几分或下个几时几分
|
||||||
* @param hour
|
* @param hour
|
||||||
* @param lastOrUnder true为上个,false为下个
|
* @param lastOrUnder true为上个,false为下个
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static long getLastOrUnderHour(long time,int hour,boolean lastOrUnder){
|
public static long getLastOrUnderHour(long time,int hour,int minute,boolean lastOrUnder){
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
cal.setTimeInMillis(time);
|
cal.setTimeInMillis(time);
|
||||||
int i = cal.get(Calendar.HOUR_OF_DAY);
|
int i = cal.get(Calendar.HOUR_OF_DAY);
|
||||||
cal.set(Calendar.HOUR_OF_DAY,hour);
|
cal.set(Calendar.HOUR_OF_DAY,hour);
|
||||||
cal.set(Calendar.MINUTE,0);
|
cal.set(Calendar.MINUTE,minute);
|
||||||
cal.set(Calendar.SECOND,0);
|
cal.set(Calendar.SECOND,0);
|
||||||
cal.set(Calendar.MILLISECOND,0);
|
cal.set(Calendar.MILLISECOND,0);
|
||||||
long result = cal.getTimeInMillis();
|
long result = cal.getTimeInMillis();
|
||||||
|
|
|
@ -2589,8 +2589,10 @@ public class MapLogic {
|
||||||
}else{
|
}else{
|
||||||
//todo 加血逻辑
|
//todo 加血逻辑
|
||||||
int maxHp = propertyMap.get(HeroAttributeEnum.Hp.getPropertyId());
|
int maxHp = propertyMap.get(HeroAttributeEnum.Hp.getPropertyId());
|
||||||
propertyMap.put(HeroAttributeEnum.CurHP.getPropertyId(),curHp+maxHp*5000/10000);
|
int resultHp = Math.min(curHp+maxHp*5000/10000,maxHp);
|
||||||
|
propertyMap.put(HeroAttributeEnum.CurHP.getPropertyId(),resultHp);
|
||||||
trialInfo.getHeroInfo().get(heroId).setProperty(propertyMap);
|
trialInfo.getHeroInfo().get(heroId).setProperty(propertyMap);
|
||||||
|
mapManager.updateTrialAddHpCount(1);
|
||||||
mapManager.updateTrailHeroInfo(heroInfo);
|
mapManager.updateTrailHeroInfo(heroInfo);
|
||||||
}
|
}
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),null);
|
||||||
|
|
|
@ -803,6 +803,10 @@ public class MapManager extends MongoBase {
|
||||||
trialInfo.setQuitMapId(mapId);
|
trialInfo.setQuitMapId(mapId);
|
||||||
updateString("trialInfo",trialInfo);
|
updateString("trialInfo",trialInfo);
|
||||||
}
|
}
|
||||||
|
public void updateTrialAddHpCount(int count){
|
||||||
|
trialInfo.setAddHpCount(count+trialInfo.getAddHpCount());
|
||||||
|
updateString("trialInfo",trialInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -282,6 +282,7 @@ public class BehaviorUtil {
|
||||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||||
.setProperty(property.substring(0, property.length()-1))
|
.setProperty(property.substring(0, property.length()-1))
|
||||||
.setPosition(teamPosHeroInfo.getPosition())
|
.setPosition(teamPosHeroInfo.getPosition())
|
||||||
|
.setStar(trailHero.getStar())
|
||||||
.build();
|
.build();
|
||||||
heroFightInfos.add(heroFightInfo);
|
heroFightInfos.add(heroFightInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,7 @@ public class TowerMap extends AbstractMap {
|
||||||
if(!trialInfo.getMapInfo().isEmpty()&&mapManager.getCurMapId()==0){
|
if(!trialInfo.getMapInfo().isEmpty()&&mapManager.getCurMapId()==0){
|
||||||
mapManager.setMapInfo(trialInfo.getMapInfo());
|
mapManager.setMapInfo(trialInfo.getMapInfo());
|
||||||
mapManager.setCurMapId(trialInfo.getQuitMapId());
|
mapManager.setCurMapId(trialInfo.getQuitMapId());
|
||||||
|
mapManager.setCurXY(trialInfo.getCurXY());
|
||||||
List<CommonProto.Cell> cells = new ArrayList<>(trialInfo.getMapInfo().size());
|
List<CommonProto.Cell> cells = new ArrayList<>(trialInfo.getMapInfo().size());
|
||||||
for (Map.Entry<Integer, Cell> entry : trialInfo.getMapInfo().entrySet()) {
|
for (Map.Entry<Integer, Cell> entry : trialInfo.getMapInfo().entrySet()) {
|
||||||
cellToProto(cells, entry);
|
cellToProto(cells, entry);
|
||||||
|
@ -134,6 +135,7 @@ public class TowerMap extends AbstractMap {
|
||||||
if(teamPosHeroInfos!=null&&teamPosHeroInfos.size()==1){
|
if(teamPosHeroInfos!=null&&teamPosHeroInfos.size()==1){
|
||||||
mapEnterResponse.setCurHero(teamPosHeroInfos.get(0).getHeroId());
|
mapEnterResponse.setCurHero(teamPosHeroInfos.get(0).getHeroId());
|
||||||
}
|
}
|
||||||
|
mapEnterResponse.setAddHpCount(trialInfo.getAddHpCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -384,8 +386,8 @@ public class TowerMap extends AbstractMap {
|
||||||
createCell=callChief(user);
|
createCell=callChief(user);
|
||||||
}
|
}
|
||||||
remainHp = checkResult[2];
|
remainHp = checkResult[2];
|
||||||
|
BehaviorUtil.destoryApointXY(user, destoryXY);
|
||||||
}
|
}
|
||||||
BehaviorUtil.destoryApointXY(user, destoryXY);
|
|
||||||
//生成传送门,需要在删点之后
|
//生成传送门,需要在删点之后
|
||||||
if(createCell!=null){
|
if(createCell!=null){
|
||||||
mapManager.addOrUpdateCell(createCell.getCellId(),createCell);
|
mapManager.addOrUpdateCell(createCell.getCellId(),createCell);
|
||||||
|
|
|
@ -1289,7 +1289,7 @@ public class ActivityLogic implements IEventHandler{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getTreasureNextRefreshTime(ISession session,MessageTypeProto.MessageType messageType) throws Exception {
|
public void getTreasureNextRefreshTime(ISession session,MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
int dayRefreshTime=(int) (TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5, false)/1000);
|
int dayRefreshTime=(int) (TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5,0, false)/1000);
|
||||||
int weekRefreshTime = (int)(TimeUtils.getNextWeekendStartTime(1,5)/1000);
|
int weekRefreshTime = (int)(TimeUtils.getNextWeekendStartTime(1,5)/1000);
|
||||||
PlayerInfoProto.TreasureRefreshTimeResponse response = PlayerInfoProto.TreasureRefreshTimeResponse.newBuilder().setDayTime(dayRefreshTime).setWeekTime(weekRefreshTime).build();
|
PlayerInfoProto.TreasureRefreshTimeResponse response = PlayerInfoProto.TreasureRefreshTimeResponse.newBuilder().setDayTime(dayRefreshTime).setWeekTime(weekRefreshTime).build();
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
|
||||||
|
|
|
@ -367,7 +367,7 @@ public class PlayerManager extends MongoBase {
|
||||||
}else {
|
}else {
|
||||||
maxTime = TimeUtils.now()/1000+config.getContinueTime()[0];
|
maxTime = TimeUtils.now()/1000+config.getContinueTime()[0];
|
||||||
}
|
}
|
||||||
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,5,true)/1000);
|
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,5,0,true)/1000);
|
||||||
newVipInfo.setEffectTime((int)maxTime);
|
newVipInfo.setEffectTime((int)maxTime);
|
||||||
}
|
}
|
||||||
this.vipInfo.put(privilageId,newVipInfo);
|
this.vipInfo.put(privilageId,newVipInfo);
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class UserMissionManager extends MongoBase {
|
||||||
case TREASH_REFRESH:
|
case TREASH_REFRESH:
|
||||||
int[] refreshIds =resetTreasureTaskInfo(1,missionTypeEnumListMap,treasureCumulationData);
|
int[] refreshIds =resetTreasureTaskInfo(1,missionTypeEnumListMap,treasureCumulationData);
|
||||||
treasureCumulationData = new CumulationData();
|
treasureCumulationData = new CumulationData();
|
||||||
int dayRefreshTime=(int) (TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5, false)/1000);
|
int dayRefreshTime=(int) (TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5, 0,false)/1000);
|
||||||
CommonProto.RefreshTask.Builder task = treasureIndicationBuild(1, refreshIds).setRefreshTime(dayRefreshTime);
|
CommonProto.RefreshTask.Builder task = treasureIndicationBuild(1, refreshIds).setRefreshTime(dayRefreshTime);
|
||||||
PlayerInfoProto.TreasureRefreshIndication indication1 = PlayerInfoProto.TreasureRefreshIndication.newBuilder().addTasks(task.build()).build();
|
PlayerInfoProto.TreasureRefreshIndication indication1 = PlayerInfoProto.TreasureRefreshIndication.newBuilder().addTasks(task.build()).build();
|
||||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.TREASURE_REFRESH_INDICATION_VALUE,indication1,true);
|
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.TREASURE_REFRESH_INDICATION_VALUE,indication1,true);
|
||||||
|
|
|
@ -88,32 +88,51 @@ public class DeathPathLogic {
|
||||||
|
|
||||||
|
|
||||||
private void doCheck(){
|
private void doCheck(){
|
||||||
|
//初始化字段
|
||||||
|
int[] setting = SGuildSetting.sGuildSetting.getGuildWarOpenTime();
|
||||||
|
if(guildWarOpenTime==null) {
|
||||||
|
guildWarOpenTime = new int[8];
|
||||||
|
//判断开启类型
|
||||||
|
if(setting[0]==2){
|
||||||
|
for(int i = 1;i<setting.length;i++){
|
||||||
|
guildWarOpenTime[setting[i]]= 1;
|
||||||
|
if(setting[i]!=7){
|
||||||
|
guildWarOpenTime[setting[i]+1]= -1;
|
||||||
|
}else{
|
||||||
|
guildWarOpenTime[1] = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for(int i = 0 ; i<guildWarOpenTime.length;i++){
|
||||||
|
guildWarOpenTime[i] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(guildWarTime==null){
|
||||||
|
guildWarTime = SGuildSetting.sGuildSetting.getGuildWarTime();
|
||||||
|
}
|
||||||
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.DeathPath);
|
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.DeathPath);
|
||||||
if(timeControllerOfFunction==null){
|
if(timeControllerOfFunction==null){
|
||||||
status = -1;
|
status = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(guildWarOpenTime==null){
|
//第一次开启时间判断
|
||||||
guildWarOpenTime = new int[8];
|
long firstStartTime = TimeUtils.getLastOrUnderHour(timeControllerOfFunction.getStartTime(), guildWarTime[0][0], guildWarTime[0][1], false);
|
||||||
int[] setting = SGuildSetting.sGuildSetting.getGuildWarOpenTime();
|
if(setting[0]==2&&guildWarOpenTime!=null) {
|
||||||
if(setting[0]==2){
|
|
||||||
for(int i = 1;i<setting.length;i++){
|
int dayOfWeek = TimeUtils.getDayOfWeek(firstStartTime);
|
||||||
guildWarOpenTime[setting[i]]= 1;
|
while(guildWarOpenTime[dayOfWeek]==0){
|
||||||
if(setting[i]!=7){
|
if(dayOfWeek==0){
|
||||||
guildWarOpenTime[setting[i]+1]= -1;
|
dayOfWeek=7;
|
||||||
}else{
|
}
|
||||||
guildWarOpenTime[1] = -1;
|
firstStartTime+=firstStartTime+TimeUtils.DAY;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for(int i = 0 ; i<guildWarOpenTime.length;i++){
|
|
||||||
guildWarOpenTime[i] = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(guildWarTime==null){
|
if(TimeUtils.now()<firstStartTime){
|
||||||
guildWarTime = SGuildSetting.sGuildSetting.getGuildWarTime();
|
status = -1;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
isOpen();
|
isOpen();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue