事件点战力
parent
f3587b62cf
commit
29595f48e0
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map.behavior;
|
||||
|
||||
import com.googlecode.protobuf.format.JsonFormat;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import config.MapPointConfig;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
|
@ -94,13 +95,17 @@ public class BehaviorUtil {
|
|||
MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(needDistoryPointId);
|
||||
Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId());
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public class DunBehavior extends BaseBehavior {
|
|||
.setCellId(pos)
|
||||
.setPointId(pointId)
|
||||
.build());
|
||||
BehaviorUtil.addBehaviorInfo(pointId,mapManager,pos);
|
||||
BehaviorUtil.addBehaviorInfo(pointId,user,pos);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue