地图提交
parent
a500703394
commit
d40956b247
|
@ -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.newBuilder()
|
||||
.setPlayer(player)
|
||||
|
|
|
@ -75,7 +75,7 @@ public class MapLogic {
|
|||
return;
|
||||
}
|
||||
// 初始序章地图
|
||||
if (mapManager.getMaxMapId() == 0) {
|
||||
if (user.getPlayerInfoManager().getMapId() == 0) {
|
||||
String error = initTeamInfo(teamId, uid, user, mapManager);
|
||||
if (!error.isEmpty()){
|
||||
LOGGER.info("enterMap() uid=>{} error =>{} ", uid, error);
|
||||
|
@ -84,7 +84,6 @@ public class MapLogic {
|
|||
}
|
||||
user.getPlayerInfoManager().setMapId(100);
|
||||
mapManager.setCurMapId(100);
|
||||
mapManager.setMaxMapId(100);
|
||||
initMap(mapManager, user);
|
||||
user.setMapManager(mapManager);
|
||||
}
|
||||
|
@ -111,11 +110,11 @@ public class MapLogic {
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (mapManager.getMaxMapId() < mapId) {
|
||||
mapManager.setMaxMapId(mapId);
|
||||
if (user.getPlayerInfoManager().getMapId() < mapId) {
|
||||
user.getPlayerInfoManager().setMapId(mapId);
|
||||
}
|
||||
if (mapId > mapManager.getMaxMapId()) {
|
||||
LOGGER.info("enterMap() uid=>{} mapManager.getMaxMapId()=>{} mapId =>{} ", uid, mapManager.getMaxMapId(), mapId);
|
||||
if (mapId > user.getPlayerInfoManager().getMapId()) {
|
||||
LOGGER.info("enterMap() uid=>{} mapManager.getMaxMapId()=>{} mapId =>{} ", uid, user.getPlayerInfoManager().getMapId(), mapId);
|
||||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
|
||||
return;
|
||||
}
|
||||
|
@ -270,7 +269,7 @@ public class MapLogic {
|
|||
newMap.put(xy, cellValue);
|
||||
}
|
||||
}
|
||||
if (mapManager.getMaxMapId() == 100) {
|
||||
if (user.getPlayerInfoManager().getMapId() == 100) {
|
||||
SGameSetting sGameSetting = SGameSetting.getGameSetting();
|
||||
int xy = CellUtil.xy2Pos(sGameSetting.getBornPosition()[0], sGameSetting.getBornPosition()[1]);
|
||||
mapManager.setCurXY(xy);
|
||||
|
|
|
@ -4,6 +4,7 @@ package com.ljsd.jieling.handler.map;
|
|||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.config.SAccomplishmentConfig;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
|
@ -19,7 +20,6 @@ public class MapManager extends MongoBase {
|
|||
|
||||
private int triggerXY;
|
||||
|
||||
private int maxMapId;
|
||||
// 使用编队id
|
||||
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() {
|
||||
return totalStep;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ public class JumpBehavior extends BaseBehavior {
|
|||
public boolean process(User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||
if (behaviorTypeValues[0][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);
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
@ -140,8 +140,7 @@ public class PlayerManager extends MongoBase {
|
|||
public void setMapId(int mapId) throws Exception {
|
||||
if(mapId == 0){
|
||||
setLastUpdateEnergyTime((int)(System.currentTimeMillis()/1000));
|
||||
}
|
||||
if(mapId != 0 ){
|
||||
} else {
|
||||
setLastUpdateEnergyTime(GlobalsDef.BATTLING);
|
||||
}
|
||||
updateString("mapId", mapId);
|
||||
|
|
Loading…
Reference in New Issue