Merge branch 'master' of 60.1.1.230:backend/jieling_server

back_recharge
wangyuan 2019-07-03 14:08:59 +08:00
commit 46e9d4c318
5 changed files with 71 additions and 29 deletions

View File

@ -0,0 +1,5 @@
package com.ljsd.jieling.config.reportData;
public class LoginFlow {
}

View File

@ -109,14 +109,14 @@ public class HandlerLogicThread extends Thread{
}
if(msgId != MessageTypeProto.MessageType.GET_CHAT_MESSAGE_REQUEST_VALUE){
LOGGER.info("doWork->uid={},mType={};start", userId, MessageTypeProto.MessageType.valueOf(msgId));
// LOGGER.info("doWork->uid={},mType={};start", userId, MessageTypeProto.MessageType.valueOf(msgId));
}
MissionEventDistributor.requestStart();
baseHandler.execute(session, packetNetData);
MissionEventDistributor.requestEnd(session,true);
if(msgId != MessageTypeProto.MessageType.GET_CHAT_MESSAGE_REQUEST_VALUE){
LOGGER.info("doWork->uid={},mType={};end", userId, MessageTypeProto.MessageType.valueOf(msgId));
// LOGGER.info("doWork->uid={},mType={};end", userId, MessageTypeProto.MessageType.valueOf(msgId));
}
MongoUtil.getInstence().lastUpdate();

View File

@ -824,6 +824,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(), "");
@ -831,13 +832,6 @@ 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()){
@ -1032,7 +1026,7 @@ public class MapLogic {
STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTower());
int[][] randomMonsterType = sTrialConfig.getRandomMonsterType();
if(cell.getCellId()!=mapManager.getBossXY()){
if (randomMonsterType[0][1] == cell.getPointId()&&mapManager.getEssenceValue()==-1) {
if (randomMonsterType[0][1] == cell.getPointId()&&mapManager.getEssenceValue()!=-1) {
mapManager.setEssenceValue(mapManager.getEssenceValue() + sTrialConfig.getNormalEnergy());
} else {
mapManager.setEssenceValue(mapManager.getEssenceValue() + sTrialConfig.getEliteEnergy());
@ -1203,7 +1197,7 @@ public class MapLogic {
fightEndResponse.setEnventDrop(dropBuilder);
fightEndResponse.addAllRemainHpList(remainHp);
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==2&&mapManager.getTower()==STrialConfig.getHighestTower()){
fightEndResponse.setLastTowerTime((int)mapManager.getCurrTowerTime());
fightEndResponse.setLastTowerTime((int)mapManager.getCurrTowerTime()/1000);
}
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
return;
@ -1259,7 +1253,7 @@ public class MapLogic {
}
// if(mapManager.getBossType()==1)
if(mapManager.getTower()==STrialConfig.getHighestTower()&&mapManager.getBossType()!=0){
fightEndResponse.setLastTowerTime((int)(TimeUtils.now()-mapManager.getTowerStartTime())/1000);
fightEndResponse.setLastTowerTime((int)(mapManager.getTowerStartTime()/1000));
}else{
fightEndResponse.setLastTowerTime(0);
}
@ -2084,7 +2078,7 @@ public class MapLogic {
return "";
}
/**ouou
/**
*
*
* @param session
@ -2108,12 +2102,12 @@ public class MapLogic {
int[][] bossType = config.getRandomBossType();
type = MathUtils.randomFromWeight(bossType);
if(mapManager.getTower()<=3){
type = 3;
}
// if(mapManager.getTower()<=4){
// type = 2;
// }
// }else if(mapManager.getTower()==2){
// type = 3;
clearNormalMonster(user);
int[][][] pointId = config.getRandomMapPointId();
int mapId = config.getMapId();
SChallengeMapConfig challengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
@ -2192,13 +2186,13 @@ public class MapLogic {
MessageUtil.sendErrorResponse(session,0,messageType.getNumber(),"无炸弹");
return;
}
Map<Integer, Cell> mapInfo = mapManager.getMapInfo();
Map<Integer,SEventPointConfig> sEventPointConfig = SEventPointConfig.sEventPointConfigMap;
Set<Integer> destoryCell = new HashSet<>();
Map<Integer, MapPointConfig> configMap = MapPointConfig.scMapEventMap;
Map<int[],Float> rewardMap = new HashMap<>();
List<Integer> rewardRevert = new ArrayList<>();
int mosterAmount = 0;
Map<Integer, Cell> mapInfo = mapManager.getMapInfo();
for(Map.Entry<Integer,Cell> entry:mapInfo.entrySet()){
int monsterType = configMap.get(entry.getValue().getPointId()).getStyle();
if(monsterType==1||monsterType==11){
@ -2214,11 +2208,14 @@ public class MapLogic {
for(int i = 0 ; i <sMonsterGroup.getRewardgroup().length;i++){
rewardRevert.add(sMonsterGroup.getRewardgroup()[i]);
}
// rewardMap.put(,1f);
}
destoryCell.add(entry.getValue().getPointId());
}
}
LOGGER.info("几种:{}",mapInfo.size());
int[] x = Arrays.stream(destoryCell.toArray(new Integer[destoryCell.size()])).mapToInt(Integer::valueOf).toArray();
BehaviorUtil.destoryPoints(user,x);
int[] y = new int[rewardRevert.size()];
for(int i = 0 ; i <rewardRevert.size();i++){
y[i] = rewardRevert.get(i);
@ -2226,10 +2223,7 @@ public class MapLogic {
rewardMap.put(y,1f);
LOGGER.info("怪物数量:{}",mosterAmount);
CommonProto.Drop.Builder drop = ItemUtil.drop(user, rewardMap, BIReason.BOMB_REWARD);
LOGGER.info("几种:{}",mapInfo.size());
int[] x = Arrays.stream(destoryCell.toArray(new Integer[destoryCell.size()])).mapToInt(Integer::valueOf).toArray();
BehaviorUtil.destoryPoints(user,x);
mapManager.setEssenceValue(100);
MapInfoProto.MapTowerUseBombResponse.Builder response = MapInfoProto.MapTowerUseBombResponse.newBuilder();
@ -2238,6 +2232,25 @@ public class MapLogic {
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
}
public void clearNormalMonster(User user) throws Exception {
LOGGER.info("删除当前地图小怪!!");
Map<Integer, MapPointConfig> configMap = MapPointConfig.scMapEventMap;
Set<Integer> destoryCell = new HashSet<>();
Map<Integer, Cell> mapInfo = user.getMapManager().getMapInfo();
for(Map.Entry<Integer,Cell> entry:mapInfo.entrySet()){
int monsterType = configMap.get(entry.getValue().getPointId()).getStyle();
if(monsterType==1||monsterType==11){
if(entry.getValue().getEventId() == -1){
continue;
}
destoryCell.add(entry.getValue().getPointId());
}
}
LOGGER.info("几种:{}",mapInfo.size());
int[] x = Arrays.stream(destoryCell.toArray(new Integer[destoryCell.size()])).mapToInt(Integer::valueOf).toArray();
BehaviorUtil.destoryPoints(user,x);
}
/**
*
* @param iSession
@ -2259,9 +2272,13 @@ public class MapLogic {
return;
}
playerInfoManager.updateVipPrivilage(VipPrivilegeType.TOWER_RESRT_NUM,1);
int afterResetTower = mapManager.getTower()-(mapManager.getTower()%5);
if(mapManager.getHighestTower()==0){
MessageUtil.sendErrorResponse(iSession,0,messageType.getNumber(),"最高层数为0无需重置。");
return;
}
int afterResetTower = mapManager.getHighestTower()-(mapManager.getHighestTower()%5);
LOGGER.info("重置当前层,当前层为{},重置为{}",mapManager.getTower(),afterResetTower);
if(mapManager.getTower()>5){
if(mapManager.getTower()>=5){
mapManager.setTower(afterResetTower);
}else{
mapManager.setTower(1);

View File

@ -9,10 +9,7 @@ import com.ljsd.jieling.handler.mission.Mission;
import com.ljsd.jieling.logic.dao.Item;
import com.ljsd.jieling.logic.dao.PlayerManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MathUtils;
import com.ljsd.jieling.util.StringUtil;
import com.ljsd.jieling.util.TimeUtils;
import com.ljsd.jieling.util.*;
import java.util.HashMap;
import java.util.HashSet;
@ -126,6 +123,7 @@ public class MapManager extends MongoBase {
}
public void setCurXY(int curXY) throws Exception {
System.out.println("设置位置!!!==============坐标"+ CellUtil.pos2XY(curXY)[0]+","+CellUtil.pos2XY(curXY)[1]);
updateString("curXY", curXY);
this.curXY = curXY;
}

View File

@ -124,10 +124,32 @@ public class ProtocolsManager implements ProtocolsAbstract {
}
final ISession session = (ISession) gameSession;
PacketNetData packetNetData = new PacketNetData((byte[]) obj);
// int msgId = packetNetData.getMsgId();
// MessageTypeProto.MessageType messageType = MessageTypeProto.MessageType.valueOf(msgId);
// FileWriter fw = null;
// if (!gameMessageForLogin.containsKey(messageType)){
// gameMessageForLogin.put(messageType,messageType + "=" + gson.toJson(obj));
// try {
// fw = new FileWriter("tmp/1.txt",true);
// fw.write(messageType + "=" + gson.toJson(obj));
// fw.write("\r\n");
// fw.flush();
// } catch (IOException e) {
// e.printStackTrace();
// try {
// fw.close();
// } catch (IOException e1) {
// e1.printStackTrace();
// }
// }
// }
// if (packetNetData.getMsgId() ==MessageTypeProto.MessageType.GET_FRIEND_INFO_REQUEST_VALUE ){
// try {
// if (fw != null){
// fw.close();
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
if (packetNetData.getMsgId()==1000){
dealHeartBeat(session);