一键助阵
parent
5096e75c4a
commit
31ae65a99c
|
|
@ -132,10 +132,11 @@ public class AssistLogic {
|
||||||
User user = UserManager.getUser(iSession.getUid());
|
User user = UserManager.getUser(iSession.getUid());
|
||||||
HeroManager heroManager = user.getHeroManager();
|
HeroManager heroManager = user.getHeroManager();
|
||||||
Map<Integer, AssistBox> assistBoxMap = heroManager.getAssistBoxMap();
|
Map<Integer, AssistBox> assistBoxMap = heroManager.getAssistBoxMap();
|
||||||
int operate = proto.getOperate();
|
for (AssistBox box : assistBoxMap.values()) {
|
||||||
|
box.setHeroId("");
|
||||||
|
}
|
||||||
|
// int operate = proto.getOperate();
|
||||||
List<CommonProto.AssistBox> boxsList = proto.getBoxsList();
|
List<CommonProto.AssistBox> boxsList = proto.getBoxsList();
|
||||||
// 穿戴
|
|
||||||
if (operate == 1){
|
|
||||||
for (CommonProto.AssistBox box : boxsList) {
|
for (CommonProto.AssistBox box : boxsList) {
|
||||||
int id = box.getId();
|
int id = box.getId();
|
||||||
String heroId = box.getHeroId();
|
String heroId = box.getHeroId();
|
||||||
|
|
@ -167,24 +168,10 @@ public class AssistLogic {
|
||||||
assistBox.setHeroId(heroId);
|
assistBox.setHeroId(heroId);
|
||||||
assistBoxMap.put(id, assistBox);
|
assistBoxMap.put(id, assistBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
// 卸下
|
|
||||||
else {
|
|
||||||
for (CommonProto.AssistBox box : boxsList) {
|
|
||||||
int id = box.getId();
|
|
||||||
AssistBox assistBox = assistBoxMap.get(id);
|
|
||||||
if (assistBox == null || assistBox.getState() == 0){
|
|
||||||
throw new ErrorTableException(162);//格子未开启
|
|
||||||
}
|
|
||||||
assistBox.setHeroId("");
|
|
||||||
assistBoxMap.put(id, assistBox);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
heroManager.setAssistBoxMap(assistBoxMap);
|
heroManager.setAssistBoxMap(assistBoxMap);
|
||||||
// 更新战力
|
// 更新战力
|
||||||
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),""));
|
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),""));
|
||||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.AssistUpDownResponse_VALUE, null, true);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.AssistBatchUpDownResponse_VALUE, null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue