副本修改
parent
db72cde86e
commit
217713bbdb
|
@ -3217,6 +3217,7 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Cell> deleteCell = new ArrayList<>();
|
||||||
//判断添加buff
|
//判断添加buff
|
||||||
for(Cell cell:mapInfo.values()){
|
for(Cell cell:mapInfo.values()){
|
||||||
if(MapPointConfig.getScMapEventMap().get(cell.getPointId()).getStyle()!=9){//9为地图点buff类型
|
if(MapPointConfig.getScMapEventMap().get(cell.getPointId()).getStyle()!=9){//9为地图点buff类型
|
||||||
|
@ -3224,11 +3225,19 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
int optionId = STableManager.getConfig(SEventPointConfig.class).get(cell.getEventId()).getOption()[0];
|
int optionId = STableManager.getConfig(SEventPointConfig.class).get(cell.getEventId()).getOption()[0];
|
||||||
SOptionConfig sOptionConfig = SOptionConfig.sOptionConfigMap.get(optionId);
|
SOptionConfig sOptionConfig = SOptionConfig.sOptionConfigMap.get(optionId);
|
||||||
int behaviorType = sOptionConfig.getBehaviorType();
|
List<Integer> buffIds = mapManager.getTrialInfo().getBuffIds();
|
||||||
BaseBehavior baseBehavior = baseBehaviorMap.get(behaviorType);
|
for(int[] values:sOptionConfig.getBehaviorTypeValues()){
|
||||||
baseBehavior.process(optionId,user,sOptionConfig.getBehaviorTypeValues(),null);
|
for(int value:values){
|
||||||
|
buffIds.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
deleteCell.add(cell);
|
||||||
|
mapManager.updateTrialBuffIds(buffIds);
|
||||||
response.addBuffIds(sOptionConfig.getBehaviorTypeValues()[0][0]);
|
response.addBuffIds(sOptionConfig.getBehaviorTypeValues()[0][0]);
|
||||||
}
|
}
|
||||||
|
for(Cell cell:deleteCell){
|
||||||
|
BehaviorUtil.destoryApointXY(user,cell.getCellId());
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
for(int i = 0 ; i<boxPosition.length;i++){
|
for(int i = 0 ; i<boxPosition.length;i++){
|
||||||
int xyPos = CellUtil.xy2Pos(boxPosition[i][0], boxPosition[i][1]);
|
int xyPos = CellUtil.xy2Pos(boxPosition[i][0], boxPosition[i][1]);
|
||||||
|
@ -3269,7 +3278,7 @@ public class MapLogic {
|
||||||
for(int id:ids){
|
for(int id:ids){
|
||||||
idList.add(id);
|
idList.add(id);
|
||||||
}
|
}
|
||||||
// BehaviorUtil.destoryCurPoint(user);
|
BehaviorUtil.destoryCurPoint(user);
|
||||||
MapInfoProto.MapGameResponse response = MapInfoProto.MapGameResponse.newBuilder().setType(mapGameInfo.getType()).addAllParam(idList).build();
|
MapInfoProto.MapGameResponse response = MapInfoProto.MapGameResponse.newBuilder().setType(mapGameInfo.getType()).addAllParam(idList).build();
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class BombGame extends ColorGame {
|
||||||
public MapInfoProto.MapGameUpdateResponse updateGame(User user, Object... params) throws Exception {
|
public MapInfoProto.MapGameUpdateResponse updateGame(User user, Object... params) throws Exception {
|
||||||
MapGameInfo mapGameInfo = user.getMapManager().getTrialInfo().getMapGameInfo();
|
MapGameInfo mapGameInfo = user.getMapManager().getTrialInfo().getMapGameInfo();
|
||||||
if(mapGameInfo==null){
|
if(mapGameInfo==null){
|
||||||
return null;
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
}
|
}
|
||||||
Set<Integer> operationInfo = mapGameInfo.getOperationInfo();
|
Set<Integer> operationInfo = mapGameInfo.getOperationInfo();
|
||||||
if(operationInfo.size()==3){
|
if(operationInfo.size()==3){
|
||||||
|
@ -74,7 +74,7 @@ public class BombGame extends ColorGame {
|
||||||
|
|
||||||
CommonProto.Drop.Builder drop = null;
|
CommonProto.Drop.Builder drop = null;
|
||||||
|
|
||||||
//是否抽到炸弹
|
//是否已经抽取过该位置
|
||||||
if(operationInfo.contains((int)params[0]-1)){
|
if(operationInfo.contains((int)params[0]-1)){
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
}
|
}
|
||||||
|
@ -88,11 +88,11 @@ public class BombGame extends ColorGame {
|
||||||
}else{
|
}else{
|
||||||
user.getMapManager().updateMapGameInfo(null);
|
user.getMapManager().updateMapGameInfo(null);
|
||||||
}
|
}
|
||||||
MapInfoProto.MapGameUpdateResponse response = MapInfoProto.MapGameUpdateResponse.newBuilder().setDrop(drop)
|
MapInfoProto.MapGameUpdateResponse.Builder response = MapInfoProto.MapGameUpdateResponse.newBuilder().setGameStatus(gameStatus).setResultId(resultId);
|
||||||
.setGameStatus(gameStatus)
|
if(drop!=null){
|
||||||
.setResultId(resultId).build();
|
response.setDrop(drop);
|
||||||
|
}
|
||||||
return response;
|
return response.build();
|
||||||
}
|
}
|
||||||
//乱序数组
|
//乱序数组
|
||||||
private int [] shuffle(int [] arr) {
|
private int [] shuffle(int [] arr) {
|
||||||
|
|
|
@ -20,6 +20,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
* @discribe
|
* @discribe
|
||||||
*/
|
*/
|
||||||
public class ForceCurrRank extends AbstractRank implements IEventHandler{
|
public class ForceCurrRank extends AbstractRank implements IEventHandler{
|
||||||
|
private static int TRANSPORT_SIZE = 100;
|
||||||
|
|
||||||
public ForceCurrRank(int type, String redisKey) {
|
public ForceCurrRank(int type, String redisKey) {
|
||||||
super(type, redisKey);
|
super(type, redisKey);
|
||||||
|
@ -62,11 +63,13 @@ public class ForceCurrRank extends AbstractRank implements IEventHandler{
|
||||||
int size = infoQueue.size();
|
int size = infoQueue.size();
|
||||||
List<UserMainTeamForceEvent> eventList = new ArrayList<>(size);
|
List<UserMainTeamForceEvent> eventList = new ArrayList<>(size);
|
||||||
|
|
||||||
if(size<100){
|
//看队列长度和每次最多传输多少比较,找最小
|
||||||
for(int i = 0 ; i < size;i++){
|
int transport = Math.min(size,TRANSPORT_SIZE);
|
||||||
eventList.add(infoQueue.poll());
|
|
||||||
}
|
for(int i = 0 ; i < transport;i++){
|
||||||
|
eventList.add(infoQueue.poll());
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Integer> changeId = new HashSet<>();
|
Set<Integer> changeId = new HashSet<>();
|
||||||
eventList.forEach(n->changeId.add(n.getUid()));
|
eventList.forEach(n->changeId.add(n.getUid()));
|
||||||
changeId.forEach(i-> {
|
changeId.forEach(i-> {
|
||||||
|
|
Loading…
Reference in New Issue