事件点战力

back_recharge
lvxinran 2019-11-06 18:14:21 +08:00
parent f3587b62cf
commit 29595f48e0
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package com.ljsd.jieling.handler.map.behavior; package com.ljsd.jieling.handler.map.behavior;
import com.googlecode.protobuf.format.JsonFormat; import com.googlecode.protobuf.format.JsonFormat;
import com.ljsd.jieling.util.CBean2Proto;
import config.MapPointConfig; import config.MapPointConfig;
import com.ljsd.jieling.db.redis.RedisKey; import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil; import com.ljsd.jieling.db.redis.RedisUtil;
@ -94,13 +95,17 @@ public class BehaviorUtil {
MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(needDistoryPointId); MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(needDistoryPointId);
Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId()); Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId());
mapManager.addOrUpdateCell(xy, cellValue); mapManager.addOrUpdateCell(xy, cellValue);
MapInfoProto.RefreshMonsterResponse monsterResponse = MapInfoProto.RefreshMonsterResponse.newBuilder().addCell(CBean2Proto.getCell(cellValue)).build();
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()),1, MessageTypeProto.MessageType.ENDLESS_MONSTER_REFRESH_INDICATION_VALUE,monsterResponse,true);
return cellValue; return cellValue;
} }
public static Cell addBehaviorInfo(int needDistoryPointId, MapManager mapManager, int xy) throws Exception { public static Cell addBehaviorInfo(int needDistoryPointId, User user, int xy) throws Exception {
MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(needDistoryPointId); MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(needDistoryPointId);
Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId()); Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId());
mapManager.addOrUpdateCell(xy, cellValue); user.getMapManager().addOrUpdateCell(xy, cellValue);
MapInfoProto.RefreshMonsterResponse monsterResponse = MapInfoProto.RefreshMonsterResponse.newBuilder().addCell(CBean2Proto.getCell(cellValue)).build();
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()),1, MessageTypeProto.MessageType.ENDLESS_MONSTER_REFRESH_INDICATION_VALUE,monsterResponse,true);
return cellValue; return cellValue;
} }

View File

@ -33,7 +33,7 @@ public class DunBehavior extends BaseBehavior {
.setCellId(pos) .setCellId(pos)
.setPointId(pointId) .setPointId(pointId)
.build()); .build());
BehaviorUtil.addBehaviorInfo(pointId,mapManager,pos); BehaviorUtil.addBehaviorInfo(pointId,user,pos);
} }
} }
return true; return true;