地图提交

back_recharge
jiahuiwen 2019-03-28 18:20:18 +08:00
parent a500703394
commit d40956b247
5 changed files with 10 additions and 21 deletions

View File

@ -50,7 +50,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
} }
CommonProto.Player player = CBean2Proto.getPlayer(userId, user.getPlayerInfoManager(), user.getMapManager().getMaxMapId(), user.getMapManager().getCurMapId()); CommonProto.Player player = CBean2Proto.getPlayer(userId, user.getPlayerInfoManager(), user.getPlayerInfoManager().getMapId(), user.getMapManager().getCurMapId());
PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse
= PlayerInfoProto.GetPlayerInfoResponse.newBuilder() = PlayerInfoProto.GetPlayerInfoResponse.newBuilder()
.setPlayer(player) .setPlayer(player)

View File

@ -75,7 +75,7 @@ public class MapLogic {
return; return;
} }
// 初始序章地图 // 初始序章地图
if (mapManager.getMaxMapId() == 0) { if (user.getPlayerInfoManager().getMapId() == 0) {
String error = initTeamInfo(teamId, uid, user, mapManager); String error = initTeamInfo(teamId, uid, user, mapManager);
if (!error.isEmpty()){ if (!error.isEmpty()){
LOGGER.info("enterMap() uid=>{} error =>{} ", uid, error); LOGGER.info("enterMap() uid=>{} error =>{} ", uid, error);
@ -84,7 +84,6 @@ public class MapLogic {
} }
user.getPlayerInfoManager().setMapId(100); user.getPlayerInfoManager().setMapId(100);
mapManager.setCurMapId(100); mapManager.setCurMapId(100);
mapManager.setMaxMapId(100);
initMap(mapManager, user); initMap(mapManager, user);
user.setMapManager(mapManager); user.setMapManager(mapManager);
} }
@ -111,11 +110,11 @@ public class MapLogic {
return; return;
} }
} }
if (mapManager.getMaxMapId() < mapId) { if (user.getPlayerInfoManager().getMapId() < mapId) {
mapManager.setMaxMapId(mapId); user.getPlayerInfoManager().setMapId(mapId);
} }
if (mapId > mapManager.getMaxMapId()) { if (mapId > user.getPlayerInfoManager().getMapId()) {
LOGGER.info("enterMap() uid=>{} mapManager.getMaxMapId()=>{} mapId =>{} ", uid, mapManager.getMaxMapId(), mapId); LOGGER.info("enterMap() uid=>{} mapManager.getMaxMapId()=>{} mapId =>{} ", uid, user.getPlayerInfoManager().getMapId(), mapId);
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), ""); MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
return; return;
} }
@ -270,7 +269,7 @@ public class MapLogic {
newMap.put(xy, cellValue); newMap.put(xy, cellValue);
} }
} }
if (mapManager.getMaxMapId() == 100) { if (user.getPlayerInfoManager().getMapId() == 100) {
SGameSetting sGameSetting = SGameSetting.getGameSetting(); SGameSetting sGameSetting = SGameSetting.getGameSetting();
int xy = CellUtil.xy2Pos(sGameSetting.getBornPosition()[0], sGameSetting.getBornPosition()[1]); int xy = CellUtil.xy2Pos(sGameSetting.getBornPosition()[0], sGameSetting.getBornPosition()[1]);
mapManager.setCurXY(xy); mapManager.setCurXY(xy);

View File

@ -4,6 +4,7 @@ package com.ljsd.jieling.handler.map;
import com.ljsd.common.mogodb.MongoBase; import com.ljsd.common.mogodb.MongoBase;
import com.ljsd.jieling.config.SAccomplishmentConfig; import com.ljsd.jieling.config.SAccomplishmentConfig;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.dao.root.User;
import org.springframework.data.mongodb.core.mapping.Field; import org.springframework.data.mongodb.core.mapping.Field;
@ -19,7 +20,6 @@ public class MapManager extends MongoBase {
private int triggerXY; private int triggerXY;
private int maxMapId;
// 使用编队id // 使用编队id
private int teamId; private int teamId;
@ -126,15 +126,6 @@ public class MapManager extends MongoBase {
} }
} }
public int getMaxMapId() {
return maxMapId;
}
public void setMaxMapId(int maxMapId) throws Exception {
updateString( "maxMapId", maxMapId);
this.maxMapId = maxMapId;
}
public int getTotalStep() { public int getTotalStep() {
return totalStep; return totalStep;
} }

View File

@ -17,7 +17,7 @@ public class JumpBehavior extends BaseBehavior {
public boolean process(User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception { public boolean process(User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
if (behaviorTypeValues[0][0] != 0) { if (behaviorTypeValues[0][0] != 0) {
user.getMapManager().setCurMapId(behaviorTypeValues[0][0]); user.getMapManager().setCurMapId(behaviorTypeValues[0][0]);
user.getMapManager().setMaxMapId(behaviorTypeValues[0][0]); user.getPlayerInfoManager().setMapId(behaviorTypeValues[0][0]);
MapLogic.getInstance().initMap(user.getMapManager(), user); MapLogic.getInstance().initMap(user.getMapManager(), user);
return true; return true;
} else { } else {

View File

@ -140,8 +140,7 @@ public class PlayerManager extends MongoBase {
public void setMapId(int mapId) throws Exception { public void setMapId(int mapId) throws Exception {
if(mapId == 0){ if(mapId == 0){
setLastUpdateEnergyTime((int)(System.currentTimeMillis()/1000)); setLastUpdateEnergyTime((int)(System.currentTimeMillis()/1000));
} } else {
if(mapId != 0 ){
setLastUpdateEnergyTime(GlobalsDef.BATTLING); setLastUpdateEnergyTime(GlobalsDef.BATTLING);
} }
updateString("mapId", mapId); updateString("mapId", mapId);