爬塔副本
parent
ee1234ad2c
commit
c3037991e6
|
|
@ -1479,7 +1479,7 @@ public class MapLogic {
|
|||
builder.setStarNum(sChallengeStarBox.getStarNum());
|
||||
List<MapInfoProto.TowerShopInfo> towerShopInfos = CBean2Proto.getTowerShopInfo(mapManager.getTowerShopInfos());
|
||||
MapInfoProto.TowerCopyInfo towerCopyInfo = MapInfoProto.TowerCopyInfo.newBuilder()
|
||||
.setTower(mapManager.getTower())
|
||||
.setTower(mapManager.getHighestTower() == 0 ? 1 : mapManager.getHighestTower())
|
||||
.setFightCount(mapManager.getFightCount())
|
||||
.setResetCount(mapManager.getResetCount())
|
||||
.setHighestTower(mapManager.getHighestTower())
|
||||
|
|
@ -1882,6 +1882,11 @@ public class MapLogic {
|
|||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
|
||||
return;
|
||||
}
|
||||
if (mapManager.getCurMapId() > 0) {
|
||||
LOGGER.info("enterTowerCopy() uid=>{} mapManager.getCurMapId() > 0 =>{} ", uid, mapManager.getCurMapId());
|
||||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
|
||||
return;
|
||||
}
|
||||
int tower = mapManager.getTower();
|
||||
if (tower == 0) {
|
||||
mapManager.setTower(1);
|
||||
|
|
@ -2015,6 +2020,23 @@ public class MapLogic {
|
|||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void towerStartFight(ISession session, MessageTypeProto.MessageType messageType) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void towerEndFight(ISession session, String frames, MessageTypeProto.MessageType messageType) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 召唤首领
|
||||
|
|
@ -2054,7 +2076,9 @@ public class MapLogic {
|
|||
int uid = iSession.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
MapManager mapManager = user.getMapManager();
|
||||
mapManager.setTower(0);
|
||||
// TODO 检测重置次数
|
||||
|
||||
mapManager.setTower(1);
|
||||
mapManager.setFightCount(0);
|
||||
mapManager.setEssenceValue(0);
|
||||
Map<Integer, Integer> towerShopInfos = mapManager.getTowerShopInfos();
|
||||
|
|
@ -2062,6 +2086,12 @@ public class MapLogic {
|
|||
mapManager.setTowerShopInfos(null);
|
||||
}
|
||||
resetMapInfo(user, true);
|
||||
MapInfoProto.MapTowerResetResponse mapTowerResetResponse = MapInfoProto.MapTowerResetResponse
|
||||
.newBuilder()
|
||||
.setResetCount(mapManager.getResetCount())
|
||||
.setTower(1)
|
||||
.build();
|
||||
MessageUtil.sendMessage(uid, 1, messageType.getNumber(), mapTowerResetResponse, true);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
|
|
@ -6,6 +6,7 @@ import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
|||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.FightInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
|
|
@ -29,6 +30,10 @@ public class FightEndRequestHandler extends BaseHandler {
|
|||
MapLogic.getInstance().endFight(iSession, frames, MessageTypeProto.MessageType.FIGHT_END_RESPONSE);
|
||||
}else if(type == 3){
|
||||
MapLogic.getInstance().endSuddlenlyFight(iSession, frames, MessageTypeProto.MessageType.FIGHT_END_RESPONSE);
|
||||
} else if(type == 4){
|
||||
MapLogic.getInstance().towerEndFight(iSession, frames, MessageTypeProto.MessageType.FIGHT_END_RESPONSE);
|
||||
} else {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.FIGHT_END_RESPONSE.getNumber(),"type is wrong:" + type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,5 @@ public class MapEnterRequestHandler extends BaseHandler{
|
|||
MapInfoProto.MapEnterRequest mapEnterRequest = MapInfoProto.MapEnterRequest.parseFrom(message);
|
||||
int teamId = mapEnterRequest.getTeamId();
|
||||
MapLogic.getInstance().enterMap(iSession, mapEnterRequest.getMapId(), teamId, MessageTypeProto.MessageType.MAP_ENTER_RESPONSE);
|
||||
|
||||
MapLogic.getInstance().enterTowerCopy(iSession, 1, MessageTypeProto.MessageType.MAP_ENTER_RESPONSE );
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
|
@ -15,6 +16,6 @@ public class MapTowerOutRequest extends BaseHandler {
|
|||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
|
||||
MapLogic.getInstance().outTowerCopy(iSession, MessageTypeProto.MessageType.MAP_TOWER_OUT_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ public class MapTowerResetRequestHandler extends BaseHandler {
|
|||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
MapLogic.getInstance().outTowerCopy(iSession, MessageTypeProto.MessageType.MAP_TOWER_RESET_RESPONSE);
|
||||
MapLogic.getInstance().towerReset(iSession, MessageTypeProto.MessageType.MAP_TOWER_RESET_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,10 @@ public class StartFightRequestHandler extends BaseHandler{
|
|||
|
||||
}else if(type == 3){
|
||||
MapLogic.getInstance().startSuddlenlyFight(iSession,teamId, MessageTypeProto.MessageType.FIGHT_START_RESPONSE);
|
||||
}else{
|
||||
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.FIGHT_START_RESPONSE.getNumber(),"type is wrong");
|
||||
}else if (type == 4){
|
||||
MapLogic.getInstance().towerStartFight(iSession, MessageTypeProto.MessageType.FIGHT_START_RESPONSE);
|
||||
} else {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.FIGHT_START_RESPONSE.getNumber(),"type is wrong:" + type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue