# Conflicts:
#	serverlogic/src/main/java/com/ljsd/jieling/network/server/ProtocolsManager.java
back_recharge
gaojie 2019-07-03 19:16:48 +08:00
commit 19c2e880ee
7 changed files with 92 additions and 40 deletions

View File

@ -54,5 +54,13 @@ netty.writeTimeout=32
netty.allTimeout=35
#core
services.core.ip=60.1.1.153
services.core.port=7900
services.core.area=1000
services.core.id=1
services.core.weight=5
logging.config = conf/logback-boot.xml

View File

@ -102,10 +102,11 @@ public class EventType {
public static final int thirtyEight = 38;
public static final int thirtyNine = 39;
public static final int fourty = 40;
public static final int fourtyOne = 41;
public static final int fourtyTwo = 42;
public static final int fourtyThree = 43;
public static final int updatePonintEvent = 1;
public static final int fightEvent = 2;
public static final int shopEvent = 3;

View File

@ -14,7 +14,6 @@ import com.ljsd.jieling.handler.mission.Mission;
import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.fight.CheckFight;
import com.ljsd.jieling.logic.fight.CombatLogic;
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
@ -141,16 +140,15 @@ public class MapLogic {
return;
}
int type = sChallengeConfig.getType();
Map<Integer, CrossInfo> crossInfoMap = mapManager.getCrossInfoMap();
if (type == 1) {
if (crossInfoMap.containsKey(mapId)) {
if (crossInfoMap.get(mapId).getStars().contains(STAR_1)) {
boolean enough = ItemUtil.itemCost(user, new int[][]{{Global.GENERALSTORY_TICKET, 1}}, BIReason.MAP_ENTER_CONSUME, mapId);
if (!enough) {
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "no ticket");
return;
}
if (mapManager.getPlayGenMaps().contains(mapId)) {
boolean enough = ItemUtil.itemCost(user, new int[][]{{Global.GENERALSTORY_TICKET, 1}}, BIReason.MAP_ENTER_CONSUME, mapId);
if (!enough) {
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "no ticket");
return;
}
}else{
mapManager.updatePlayGenMaps(mapId);
}
}else if(type == 3){
boolean enough = ItemUtil.itemCost(user, new int[][]{{Global.HEROSTORY_TICKET, 1}},BIReason.MAP_ENTER_CONSUME,mapId);
@ -825,6 +823,7 @@ public class MapLogic {
mapManager.setTowerUnusedBuffer(null);
};
LOGGER.info("退出地图");
mapManager.setEssenceValue(0);
boolean result = onlyLevelMap(user, true);
if (!result) {
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "");
@ -832,18 +831,12 @@ public class MapLogic {
}
}
int time = (int)(mapManager.getCurrTowerTime())/1000;
// mapManager.setCurrTowerTime(TimeUtils.now());
// if(mapManager.getTower()==1){
// time = 0;
// mapManager.setCurrTowerTime(TimeUtils.now());
//
// }
builder.setUseTime(time);
LOGGER.info("当前层使用时间{}",time);
if(mapManager.getTower()>mapManager.getHighestTower()){
mapManager.setHighestTower(mapManager.getTower());
}
mapManager.setCurrTowerTime(0);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), builder.build(), true);
return;
}
@ -1004,6 +997,7 @@ public class MapLogic {
.setResult(resultCode)
.setEnventDrop(dropBuilder)
.addAllRemainHpList(remainHp)
.setEssenceValue(mapManager.getEssenceValue())
.build();
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse, true);
return;
@ -1028,6 +1022,7 @@ public class MapLogic {
fastFightResponse.setEnventDrop(drop.build());
fastFightResponse.setResult(resultCode);
fastFightResponse.addAllRemainHpList(remainHp);
fastFightResponse.setEssenceValue(mapManager.getEssenceValue());
fastFightResponse.build();
if (sChallengeConfig.getType() == 2) {
STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTower());
@ -1203,8 +1198,9 @@ public class MapLogic {
fightEndResponse.setResult(resultCode);
fightEndResponse.setEnventDrop(dropBuilder);
fightEndResponse.addAllRemainHpList(remainHp);
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==2&&mapManager.getTower()==STrialConfig.getHighestTower()){
fightEndResponse.setLastTowerTime((int)mapManager.getCurrTowerTime()/1000);
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==2){
// &&mapManager.getTower()==STrialConfig.getHighestTower()
fightEndResponse.setLastTowerTime((int)(mapManager.getCurrTowerTime()/1000));
}
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
return;
@ -1494,26 +1490,35 @@ public class MapLogic {
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "");
return;
}
//todo vip
/* SChallengeSetting sChallengeSetting = SChallengeSetting.challengeSetting;
int dailyLimitPrivilege = sChallengeSetting.getDailyLimitPrivilege();
VipPrivilegeType.
if (mapManager.getDayFightCount() + count > sChallengeSetting.getLimit() + mapManager.getBuyFightCount()) {
LOGGER.info("sweep over max count: {}", (mapManager.getDayFightCount() + count));
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
return;
}*/
SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
MapInfoProto.MapSweepResponse.Builder mapSweepResponse = MapInfoProto.MapSweepResponse.newBuilder();
for (int i = 0; i < count; i++) {
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, sChallengeMapConfig.getSweepingAward(), 1, 0, BIReason.MAP_SWEEP_REWARD);
mapSweepResponse.addDrop(dropBuilder);
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapId);
int type = sChallengeConfig.getType();
if(type==3 || type==1){
int itemId = Global.GENERALSTORY_TICKET;
if (type == 3) {
itemId = Global.HEROSTORY_TICKET;
}
boolean enough = ItemUtil.itemCost(user, new int[][]{{itemId ,count}}, BIReason.MAP_ENTER_CONSUME, mapId);
if (!enough) {
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "no ticket");
return;
}
SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
MapInfoProto.MapSweepResponse.Builder mapSweepResponse = MapInfoProto.MapSweepResponse.newBuilder();
for (int i = 0; i < count; i++) {
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, sChallengeMapConfig.getSweepingAward(), 1, 0, BIReason.MAP_SWEEP_REWARD);
mapSweepResponse.addDrop(dropBuilder);
}
user.getUserMissionManager().onGameEvent(user, GameEvent.STORY_FIGHT, mapId,1,count);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapSweepResponse.build(), true);
}else{
LOGGER.info("uid={},type={}",uid,type);
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "now sweep");
}
user.getUserMissionManager().onGameEvent(user, GameEvent.STORY_FIGHT, mapId,1,count);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapSweepResponse.build(), true);
}
/**
*
*
@ -1578,6 +1583,7 @@ public class MapLogic {
.setTowerUseTime((int)(mapManager.getCurrTowerTime()/1000))
.build();
builder.setTowerCopyInfo(towerCopyInfo);
builder.addAllPlayedGenMapId(mapManager.getPlayGenMaps());
LOGGER.info("关卡信息{}",towerCopyInfo.toString());
MessageUtil.sendMessage(iSession, 1, msgId, builder.build(), true);
}
@ -1967,7 +1973,7 @@ public class MapLogic {
public String initTrialMap(MapManager mapManager, User user) throws Exception {
STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTower());
if(mapManager.getTower()>1){
if(mapManager.getTower()>1&&mapManager.getMapIntoFlag()==0){
for(int i = 1 ; i <mapManager.getTower();i++){
ItemUtil.drop(user,STrialConfig.sTrialConfigMap.get(i).getReward(),1.0f,1,BIReason.TOWER_SWEEP_REWARD);
int type = MathUtils.randomFromWeight(STrialConfig.sTrialConfigMap.get(i).getRandomMonsterType());

View File

@ -71,6 +71,10 @@ public class MapManager extends MongoBase {
// 副本星级奖励领取进度 challengeStarBox id
private int starReward;
//已玩普通副本地图
private Set<Integer> playGenMaps = new HashSet<>();
// 爬塔副本当前层数
private int tower = 1;
// 爬塔副本战斗次数
@ -579,4 +583,13 @@ public class MapManager extends MongoBase {
this.setBossXY(0);
this.setBossType(0);
}
public Set<Integer> getPlayGenMaps() {
return playGenMaps;
}
public void updatePlayGenMaps(int mapId) {
playGenMaps.add(mapId);
updateString("playGenMaps",playGenMaps);
}
}

View File

@ -0,0 +1,20 @@
package com.ljsd.jieling.handler.map.behavior;
import com.ljsd.jieling.handler.map.EventType;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.protocols.MapInfoProto;
import org.springframework.stereotype.Component;
@Component
public class FourtyOneBehavior extends BaseBehavior {
@Override
public int getBehaviorType() {
return EventType.fourtyOne;
}
@Override
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
BehaviorUtil.fightReady(user.getId(), behaviorTypeValues[0][0] + "#" + Integer.toString(optionId));
return true;
}
}

View File

@ -31,12 +31,15 @@ public class FourtyTwoBehavior extends BaseBehavior{
LOGGER.info("当前层为{},进入下一层",mapManager.getTower());
mapManager.removeBoss();
mapManager.setTower(mapManager.getTower()+1);
// if(mapManager.getTower()==5){
// mapManager.setTower();
// }
mapManager.setEssenceValue(0);
long time = TimeUtils.now()-mapManager.getTowerStartTime();
mapManager.setCurrTowerTime(time);
LOGGER.info("上层使用时间{}",time);
mapManager.setStartExporeTime(0);
mapManager.setMapIntoFlag(1);
user.getUserMissionManager().onGameEvent(user, GameEvent.COPY_TOWER_LEVEL,mapManager.getTower());
MapLogic.getInstance().initTrialMap(mapManager, user);
return true;

View File

@ -672,7 +672,8 @@ public class CombatLogic {
//发送击杀boss奖励和发现者奖励
if(fightResult == 1){
i = i+1;
sendRewardOfBossKilled(adventureBoss.getFindUserId(),uid,bossGroupId,adventureBoss.getArenaId(),adventureBoss.getArenaLevel());
String killReward = sendRewardOfBossKilled(adventureBoss.getFindUserId(), uid, bossGroupId, adventureBoss.getArenaId(), adventureBoss.getArenaLevel());
builder.setKillRewards(killReward);
user.getUserMissionManager().onGameEvent(user, GameEvent.KILLINVASIONBOSS);
RedisUtil.getInstence().removeMapEntrys(RedisKey.ADVENTRUEN_BOSS_INFO,"",bossId);
ISession findSession = OnlineUserManager.getSessionByUid(adventureBoss.getFindUserId());
@ -706,7 +707,7 @@ public class CombatLogic {
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ADVENTURE_BOSS_CHALLENGE_RESPONSE_VALUE,build,true);
}
private void sendRewardOfBossKilled(int findUserId,int killUid,int killBossGroupId, int arenaId,int arenaLevel) throws Exception {
private String sendRewardOfBossKilled(int findUserId,int killUid,int killBossGroupId, int arenaId,int arenaLevel) throws Exception {
SMonsterGroup sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(killBossGroupId);
int[] killReward = sMonsterGroup.getRewardgroup();
SAdventureConfig sAdventureConfig = SAdventureConfig.getConfig().get(arenaId);
@ -728,7 +729,7 @@ public class CombatLogic {
title = SErrorCodeEerverConfig.getI18NMessage("adventuren_boss_kill_reward_title");
content = SErrorCodeEerverConfig.getI18NMessage("adventuren_boss_kill_reward__txt");
MailLogic.getInstance().sendMail(killUid,title,content,killRewardMail,nowTime, Global.MAIL_EFFECTIVE_TIME);
return killRewardMail;
}
public int updateBossAndGetHurtForFight(int[] checkResult,AdventureBoss adventureBoss){